Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 583 Bytes

no-moment.md

File metadata and controls

28 lines (17 loc) · 583 Bytes

Prevent usage of the moment library (no-moment)

The use of moment library is not recommended because it has bad performance and is large in size.

You should be using the @salesforce/i18n-service methods instead.

Usage of following moment imports are detected:

  • require('moment');
  • import moment from 'moment';

Rule details

Example of incorrect code:

var moment = require('moment');

// OR

import moment from 'moment';

Example of correct code:

import { getDateTimeFormat, getNumberFormat } from '@salesforce/i18n-service';