eslint-config-seek 10.2.0 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{.eslintrc.js → base.js} +3 -22
- package/index.js +32 -0
- package/package.json +5 -4
package/{.eslintrc.js → base.js}
RENAMED
|
@@ -76,17 +76,6 @@ const baseRules = {
|
|
|
76
76
|
'no-return-await': OFF,
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
const reactRules = {
|
|
80
|
-
'react/prefer-es6-class': [ERROR, 'always'],
|
|
81
|
-
'react/self-closing-comp': ERROR,
|
|
82
|
-
'react/jsx-pascal-case': ERROR,
|
|
83
|
-
'react-hooks/rules-of-hooks': ERROR,
|
|
84
|
-
'react-hooks/exhaustive-deps': ERROR,
|
|
85
|
-
'react/no-children-prop': ERROR,
|
|
86
|
-
'react/display-name': OFF,
|
|
87
|
-
'react/prop-types': OFF,
|
|
88
|
-
};
|
|
89
|
-
|
|
90
79
|
const jsExtensions = ['js', 'cjs', 'mjs', 'jsx'];
|
|
91
80
|
const tsExtensions = ['ts', 'cts', 'mts', 'tsx'];
|
|
92
81
|
const allExtensions = [...jsExtensions, ...tsExtensions];
|
|
@@ -95,25 +84,18 @@ const allExtensions = [...jsExtensions, ...tsExtensions];
|
|
|
95
84
|
const baseConfig = {
|
|
96
85
|
parser: '@babel/eslint-parser',
|
|
97
86
|
parserOptions: {
|
|
87
|
+
requireConfigFile: false,
|
|
88
|
+
sourceType: 'module',
|
|
98
89
|
babelOptions: {
|
|
99
90
|
presets: ['@babel/preset-react'],
|
|
100
91
|
},
|
|
101
|
-
requireConfigFile: false,
|
|
102
|
-
sourceType: 'module',
|
|
103
92
|
},
|
|
104
93
|
root: true,
|
|
105
94
|
env: {
|
|
106
|
-
browser: true,
|
|
107
95
|
node: true,
|
|
108
96
|
},
|
|
109
|
-
|
|
110
|
-
react: {
|
|
111
|
-
version: 'detect',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
plugins: ['react', 'react-hooks', 'import'],
|
|
97
|
+
plugins: ['import'],
|
|
115
98
|
extends: [
|
|
116
|
-
'plugin:react/recommended',
|
|
117
99
|
// this config enables eslint-plugin-import to resolve JavaScript and TypeScript files
|
|
118
100
|
// https://github.com/import-js/eslint-plugin-import/blob/v2.26.0/config/typescript.js
|
|
119
101
|
// Some rules provided by eslint-plugin-import e.g. `import/no-duplicates` don't work without it
|
|
@@ -122,7 +104,6 @@ const baseConfig = {
|
|
|
122
104
|
],
|
|
123
105
|
rules: {
|
|
124
106
|
...baseRules,
|
|
125
|
-
...reactRules,
|
|
126
107
|
},
|
|
127
108
|
overrides: [
|
|
128
109
|
{
|
package/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const OFF = 0;
|
|
2
|
+
const ERROR = 2;
|
|
3
|
+
|
|
4
|
+
const reactRules = {
|
|
5
|
+
'react/prefer-es6-class': [ERROR, 'always'],
|
|
6
|
+
'react/self-closing-comp': ERROR,
|
|
7
|
+
'react/jsx-pascal-case': ERROR,
|
|
8
|
+
'react-hooks/rules-of-hooks': ERROR,
|
|
9
|
+
'react-hooks/exhaustive-deps': ERROR,
|
|
10
|
+
'react/no-children-prop': ERROR,
|
|
11
|
+
'react/display-name': OFF,
|
|
12
|
+
'react/prop-types': OFF,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @type {import('eslint').Linter.Config} */
|
|
16
|
+
const eslintConfig = {
|
|
17
|
+
env: {
|
|
18
|
+
browser: true,
|
|
19
|
+
},
|
|
20
|
+
settings: {
|
|
21
|
+
react: {
|
|
22
|
+
version: 'detect',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
plugins: ['react', 'react-hooks'],
|
|
26
|
+
extends: ['plugin:react/recommended', './base.js'],
|
|
27
|
+
rules: {
|
|
28
|
+
...reactRules,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = eslintConfig;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-seek",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.0",
|
|
4
4
|
"description": "ESLint configuration used by SEEK",
|
|
5
|
-
"main": ".
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"files": [
|
|
7
|
-
".
|
|
7
|
+
"index.js",
|
|
8
|
+
"base.js"
|
|
8
9
|
],
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
},
|
|
49
50
|
"scripts": {
|
|
50
51
|
"release": "changeset publish",
|
|
51
|
-
"test": "eslint .",
|
|
52
|
+
"test": "eslint --config index.js . && eslint --config base.js .",
|
|
52
53
|
"changeset-version": "changeset version && prettier --write ."
|
|
53
54
|
}
|
|
54
55
|
}
|