8.0.0 • Published 3 years ago

@commonground/eslint-config v8.0.0

Weekly downloads
617
License
-
Repository
gitlab
Last release
3 years ago

Shared eslint-config

Common Ground shared ESLint config for all our JavaScript projects.

For a create-react-app project see our CRA lint config.

Usage

Note: if you use a NPM version <7.x you should install the peer dependencies manually.

npm install --save-dev --save-exact @commonground/eslint-config

Then add the eslintConfig setting in package.json:

"eslintConfig": {
  "extends": "@commonground/eslint-config"
}

Alternatively, you can remove the eslintConfig entry and create a .eslintrc.js file, with:

module.exports = {
  extends: ['@commonground/eslint-config']
}

You can also extend only parts of our config, for instance to only use/add our prettier and header config to your linting:

// .eslintrc.js
module.exports = {
  extends: [
    '@commonground/eslint-config/rules/prettier',
    '@commonground/eslint-config/rules/header',
  ]
}

Related plugins will automatically be added, so you don't need to add eg: plugins: ['header'] yourself.

Editor integration

VSCode

Add the following extension:

Then create the following file in the frontend project directory: .vscode/settings.json (it's .gitignored) containing:

{
  "editor.defaultFormatter": "dbaeumer.vscode-eslint",
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}

You may define this file at a higher level as well, but then make sure you add this to the settings.json:

{
  "eslint.workingDirectories": [
    "./ui-directory"
  ]
}

How to contribute

See CONTRIBUTING

7.0.4

3 years ago

8.0.0

3 years ago

7.0.3

3 years ago

5.0.1

4 years ago

6.0.0

4 years ago

7.0.0

4 years ago

7.0.2

3 years ago

7.0.1

3 years ago

5.0.0

4 years ago

4.2.1

4 years ago

4.2.0

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.0

5 years ago

1.0.0

5 years ago

2.0.0

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago