@guardian/eslint-plugin-source-foundations
TypeScript icon, indicating that this package has built-in type declarations

18.0.0 • Public • Published

@guardian/eslint-plugin-source-foundations

ESLint plugin for Guardian projects using the @guardian/source-foundations package.

This package is part of the Source design system.

Installation

yarn add -D @guardian/eslint-plugin-source-foundations

or

npm install --save-dev @guardian/eslint-plugin-source-foundations

Usage

// ESLint configuration file
{
    "extends": "plugin:@guardian/source-foundations/recommended"
}

Rules

Valid import path

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.

No * imports or exports

This rule errors for import or export * statements from any src-* or source-* package as this pattern is not recommended.

No duplicate imports

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.

Known Issues

  • 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.

Readme

Keywords

none

Package Sidebar

Install

npm i @guardian/eslint-plugin-source-foundations

Weekly Downloads

117

Version

18.0.0

License

MIT

Unpacked Size

91.9 kB

Total Files

24

Last publish

Collaborators

  • joecowton1
  • guardian-developers
  • akash1810
  • reetta
  • sndrs
  • mxdvl