Skip to content

Commit

Permalink
Use eslint-config-arcticicestudio preset and override conflicting rules
Browse files Browse the repository at this point in the history
The used preset eslint-config-arcticicestudio (1) implements the Arctic
Ice Studio JavaScript Style (2). It it built on top of
eslint-config-arcticicestudio-base (3) and includes support for rules of
the following plugins:

- eslint-plugin-import (4)
- eslint-plugin-jsx-a11y (5)
- eslint-plugin-react (6)

>> Disabled rules

Due to compatibility problems and message noise the `no-confusing-arrow`
rule has been disabled. It can be re-enabled again when the used preset
handles the problem or disables the rule too.

Also to suppress errors in the future with Gatsby the
`import/no-extraneous-dependencies` has been overridden (still error
`level`) by adding the `devDependencies` option and add the exception
for `./.gatsby/**/*.js`. This allows to use development dependencies in
Gatsby configuration files without linting errors since these are
necessary and some will be provided by Gatsby itself without being
explicitly added to the `package.json`.

References:

  (1) https://github.com/arcticicestudio/eslint-config-arcticicestudio
  (2) https://arcticicestudio.github.io/styleguide-javascript
  (3) https://github.com/arcticicestudio/eslint-config-arcticicestudio-base

  (4) https://github.com/benmosher/eslint-plugin-import
  (5) https://github.com/evcohen/eslint-plugin-jsx-a11y
  (6) https://github.com/yannickcr/eslint-plugin-react

GH-15
  • Loading branch information
arcticicestudio committed Nov 17, 2018
1 parent cf849a8 commit 23c2d25
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@
*/

module.exports = {
extends: "arcticicestudio",
env: {
browser: true,
node: true
},
rules: {
"no-confusing-arrow": "off",
/* Suppress errors when importing development dependencies */
"import/no-extraneous-dependencies": ["error", { devDependencies: ["./.gatsby/**/*.js"] }]
}
};

0 comments on commit 23c2d25

Please sign in to comment.