ESLint plugin for Guardian projects using the
@guardian/source-foundations
package.
This package is part of the Source design system.
yarn add -D @guardian/eslint-plugin-source-foundations
or
npm install --save-dev @guardian/eslint-plugin-source-foundations
// ESLint configuration file
{
"extends": "plugin:@guardian/source-foundations/recommended"
}
This rules errors for imports from @guardian/src-foundations
or any sub module. If possible, it will autofix the import to the new location.
Some breaking changes can not be autofixed, for example, in cases where the export has been removed from Source. Developers must manually provide an alternative.
This rule errors for import or export *
statements from any src-*
or source-*
package as this pattern is not recommended.
This rule, from eslint-plugin-import, errors when multiple import statements import from the same pacakge. These issues can be autofixed. This rule is included as, due to the remove of sub modules and the consolidation of component packages, many import statements are fixed by the valid-import-path
rule to import from the same location in v4.
-
New theme names not always updated automatically
The theme variables have changed both name and location in the v4. The plugin should automatically update both but sometimes this does not work.