Skip to content
This repository was archived by the owner on Mar 29, 2020. It is now read-only.

Commit 63724d0

Browse files
committed
feat: extract babel-related rules etc. into a separate config
BREAKING CHANGE: if you use babel with your project, you will need to explicitly include `anvilabs/babel` config together with the base config
1 parent 861b721 commit 63724d0

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Or in combination with the base config (recommended):
4949

5050
Available configs include:
5151

52+
- `"anvilabs/babel"` for usage with [babel transformations](https://github.com/babel/babel-eslint)
5253
- `"anvilabs/flowtype"` for [Flow](https://flowtype.org/) related rules
5354
- `"anvilabs/jest"` for [Jest](https://facebook.github.io/jest/) related rules
5455
- `"anvilabs/lodash"` for [Lodash](https://lodash.com/) related rules

babel.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
plugins: ['babel'],
3+
parser: 'babel-eslint',
4+
rules: {
5+
// https://github.com/babel/eslint-plugin-babel
6+
'babel/array-bracket-spacing': 'off',
7+
'babel/arrow-parens': 'off',
8+
'babel/flow-object-type': 'off',
9+
'babel/func-params-comma-dangle': 'off',
10+
'babel/generator-star-spacing': 'off',
11+
'babel/new-cap': 'off',
12+
'babel/no-await-in-loop': 'off',
13+
'babel/no-invalid-this': 'error',
14+
'babel/object-curly-spacing': 'off',
15+
'babel/object-shorthand': 'off',
16+
'babel/semi': 'off',
17+
},
18+
};

index.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Rules.load(path.join(__dirname, 'rules'));
77
module.exports = {
88
extends: ['airbnb-base', 'prettier'],
99
plugins: [
10-
'babel',
1110
'eslint-comments',
1211
'no-use-extend-native',
1312
'prettier',
@@ -39,18 +38,6 @@ module.exports = {
3938
detectObjects: false,
4039
},
4140
],
42-
// https://github.com/babel/eslint-plugin-babel
43-
'babel/array-bracket-spacing': 'off',
44-
'babel/arrow-parens': 'off',
45-
'babel/flow-object-type': 'off',
46-
'babel/func-params-comma-dangle': 'off',
47-
'babel/generator-star-spacing': 'off',
48-
'babel/new-cap': 'off',
49-
'babel/no-await-in-loop': 'off',
50-
'babel/no-invalid-this': 'error',
51-
'babel/object-curly-spacing': 'off',
52-
'babel/object-shorthand': 'off',
53-
'babel/semi': 'off',
5441
// https://github.com/mysticatea/eslint-plugin-eslint-comments
5542
'eslint-comments/disable-enable-pair': 'error',
5643
'eslint-comments/no-duplicate-disable': 'error',

react-base.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = {
22
extends: ['prettier/react'],
33
plugins: ['react'],
4-
parser: 'babel-eslint',
54
parserOptions: {
65
ecmaFeatures: {
76
jsx: true,

0 commit comments

Comments
 (0)