Closed apoblock closed 3 years ago
@gonzalocordero @Gr8Gatsby @pmdartus - this new i18n
configuration is to supplement the rollout of @salesforce/i18n-service (a.k.a. localizerjs), which is now released to production. Please review. (Note: this needs https://github.com/salesforce/eslint-plugin-lwc/pull/52 to be merged first).
@apoblock Once https://github.com/salesforce/eslint-config-lwc/pull/61 is merged, could you rebase this PR?
@pmdartus @gonzalocordero please review.
@apoblock The CircleCI is not running against this PR. I double-checked and it is configured to PRs originated forked repo.
I ran into a similar issue in the past, and it appears to be a known issue between GH and CircleCI. Could you please revoke your CircleCI tokens from Github, log out from CircleCI, and log back again. This should fix the issue. Once you are done push an empty commit to trigger the CI again.
@apoblock The CircleCI is not running against this PR.
Thanks for this @pmdartus - it is now fixed. I thought it was waiting for a review to start the validation ;)
Adding configuration for I18N rules. This is to promote the use of @salesforce/localizer as a best practice for I18N in LWC:
Note that this change needs https://github.com/salesforce/eslint-plugin-lwc/pull/52 to be merged first.
I18N configuration contains following rules:
prefer-localizer
: give warnings (not errors), and suggest to use localizer over using Intl directlyno-moment
: discourage use of moment (again as a warning)no-aura-localization-service
: will mark references to$A.localizationService
as warnings (this is only used in Core).This is 1st change, where existing configurations are untouched:
i18n
config that only includes those i18n rules - that can be added on top of other configs by devs who need it (e.g. in base-components) or want to test it. Note: this configuration generates warnings, and not errors like other lwc configs.Then, when @salesforce/localizer is available in the public npm repository, update the existing sets:
recommended
: include prefer-localizer and no-moment with a warn levelextended
: include all 3 rules with a warn level