Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Commit 3e83e74

Browse files
committed
feat: split react config
1 parent d8e9a10 commit 3e83e74

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
!/dev.js
44
!/index.js
55
!/integration.js
6+
!/project.js
7+
!/react.js
68
!/shared.js

index.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
extends: ['airbnb', 'prettier', 'prettier/react'],
2+
extends: ['airbnb/base', 'prettier'],
33
parser: 'babel-eslint',
44
env: {
55
node: true,
@@ -9,27 +9,9 @@ module.exports = {
99
ecmaVersion: 2018,
1010
sourceType: 'module',
1111
},
12-
settings: {
13-
'import/resolver': {
14-
node: {
15-
moduleDirectory: ['node_modules', 'src'],
16-
},
17-
},
18-
},
1912
rules: {
20-
'react/jsx-filename-extension': ['error', { extensions: ['.js'] }],
21-
'react/prop-types': 'off',
22-
'react/sort-comp': 'off',
23-
'react/no-did-mount-set-state': 'off',
24-
'react/require-default-props': 'off',
25-
'react/no-array-index-key': 'off',
26-
'react/no-typos': 'off',
27-
2813
'import/prefer-default-export': 'off',
2914

30-
'jsx-a11y/anchor-is-valid': 'off',
31-
'jsx-a11y/anchor-has-content': 'off',
32-
3315
'no-param-reassign': 'off',
3416
'no-shadow': 'off',
3517
'no-nested-ternary': 'off',

project.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
settings: {
3+
'import/resolver': {
4+
node: {
5+
moduleDirectory: ['node_modules', 'src'],
6+
},
7+
},
8+
},
9+
}

react.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const baseRules = require('./index').rules
2+
3+
module.exports = {
4+
extends: ['airbnb', 'prettier', 'prettier/react'],
5+
rules: {
6+
...baseRules,
7+
8+
'react/jsx-filename-extension': ['error', { extensions: ['.js'] }],
9+
'react/prop-types': 'off',
10+
'react/sort-comp': 'off',
11+
'react/no-did-mount-set-state': 'off',
12+
'react/require-default-props': 'off',
13+
'react/no-array-index-key': 'off',
14+
'react/no-typos': 'off',
15+
16+
'jsx-a11y/anchor-is-valid': 'off',
17+
'jsx-a11y/anchor-has-content': 'off',
18+
},
19+
}

0 commit comments

Comments
 (0)