Skip to content

Commit

Permalink
Integrate "eslint-plugin-babel" with override rules
Browse files Browse the repository at this point in the history
To make use of the latest experimental Babel features and proposals
eslint-plugin-babel (1) has been added. The following rules have been
enabled and configured:

- `babel/camelcase` with level `error` - doesn't complain about optional
  chaining (`let foo = bar?.a_b;`). The core rule `camelcase` (2) has
  been disabled.
- `babel/no-unused-expressions` with level `error` - doesn't fail when
  using `do` expressions or optional chaining (`a?.b()`). The core rule
  `no-unused-expressions` (3) has been disabled.

References:

  (1) https://github.com/babel/eslint-plugin-babel
  (2) https://eslint.org/docs/rules/camelcase
  (3) https://eslint.org/docs/rules/no-unused-expressions

GH-15
  • Loading branch information
arcticicestudio committed Nov 17, 2018
1 parent f043313 commit f23215e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const { resolve } = require("path");

module.exports = {
extends: "arcticicestudio",
plugins: ["babel"],
parser: "babel-eslint",
env: {
browser: true,
Expand All @@ -35,6 +36,16 @@ module.exports = {
rules: {
"no-confusing-arrow": "off",
/* Suppress errors when importing development dependencies */
"import/no-extraneous-dependencies": ["error", { devDependencies: ["./.gatsby/**/*.js"] }]
"import/no-extraneous-dependencies": ["error", { devDependencies: ["./.gatsby/**/*.js"] }],
/*
* Enable support for experimental features:
*
* - `babel/camelcase` - doesn't complain about optional chaining (`let foo = bar?.a_b;`).
* - `babel/no-unused-expressions` - doesn't fail when using `do` expressions or optional chaining (`a?.b()`).
*/
"babel/camelcase": "error",
camelcase: "off",
"babel/no-unused-expressions": "error",
"no-unused-expressions": "off"
}
};

0 comments on commit f23215e

Please sign in to comment.