@apolitical/eslint-config 2.0.0-rc.0 → 2.0.0-rc.3
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/README.md +6 -1
- package/api.config.js +10 -8
- package/package.json +3 -2
- package/prettier.config.js +5 -5
- package/ui.config.js +25 -23
package/README.md
CHANGED
|
@@ -25,8 +25,13 @@ yarn add -D @apolitical/eslint-config
|
|
|
25
25
|
Link the ESLint configurations from your `package.json`:
|
|
26
26
|
|
|
27
27
|
```json
|
|
28
|
+
// for node modules
|
|
28
29
|
"eslintConfig": {
|
|
29
|
-
"extends": "@apolitical/eslint-config/
|
|
30
|
+
"extends": "@apolitical/eslint-config/api.config"
|
|
31
|
+
},
|
|
32
|
+
// in react applications
|
|
33
|
+
"eslintConfig": {
|
|
34
|
+
"extends": "@apolitical/eslint-config/ui.config"
|
|
30
35
|
},
|
|
31
36
|
"prettier": "@apolitical/eslint-config/prettier.config",
|
|
32
37
|
```
|
package/api.config.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
const {
|
|
3
|
-
|
|
4
|
-
env.node = true
|
|
1
|
+
'use strict';
|
|
2
|
+
const { commonRules, env, rules, parserOptions } = require('./base.settings');
|
|
5
3
|
|
|
6
4
|
module.exports = {
|
|
7
5
|
parserOptions,
|
|
8
|
-
env
|
|
9
|
-
|
|
6
|
+
'env': {
|
|
7
|
+
...env,
|
|
8
|
+
node: true,
|
|
9
|
+
},
|
|
10
|
+
'extends': [
|
|
10
11
|
...commonRules,
|
|
11
|
-
|
|
12
|
+
'plugin:jest/recommended'
|
|
12
13
|
],
|
|
13
|
-
|
|
14
|
+
'plugins': ['jest'],
|
|
15
|
+
rules,
|
|
14
16
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apolitical/eslint-config",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.3",
|
|
4
4
|
"description": "Apolitical ESLint and Prettier configurations",
|
|
5
5
|
"author": "Apolitical Group Limited <engineering@apolitical.co>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "api.config.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"api.config.js",
|
|
10
|
+
"eslint.settings.js",
|
|
10
11
|
"prettier.config.js",
|
|
11
12
|
"ui.config.js"
|
|
12
13
|
],
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"eslint": "8.11.0",
|
|
27
28
|
"eslint-config-prettier": "8.5.0",
|
|
28
|
-
"eslint-plugin-jest": "26.1.
|
|
29
|
+
"eslint-plugin-jest": "26.1.3",
|
|
29
30
|
"prettier": "2.6.0"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
package/prettier.config.js
CHANGED
package/ui.config.js
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { commonRules, env, parserOptions, rules } = require('./base.settings');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
module.exports = {
|
|
6
|
+
parserOptions: {
|
|
7
|
+
...parserOptions,
|
|
8
|
+
'sourceType': 'module',
|
|
9
|
+
'ecmaFeatures': {
|
|
10
|
+
'jsx': true
|
|
10
11
|
}
|
|
11
|
-
}
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
env.browser = true;
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
},
|
|
14
|
+
env: {
|
|
15
|
+
...env,
|
|
16
|
+
browser: true
|
|
17
|
+
},
|
|
18
|
+
'extends': [
|
|
20
19
|
...commonRules,
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
'react-app',
|
|
21
|
+
'react-app/jest'
|
|
23
22
|
],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
'rules': {
|
|
24
|
+
...rules,
|
|
25
|
+
'strict': ['error', 'never'],
|
|
26
|
+
'no-duplicate-imports': 'warn',
|
|
27
|
+
'no-empty-function': 'warn',
|
|
28
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
29
|
+
'testing-library/no-render-in-setup': 'warn',
|
|
30
|
+
'testing-library/prefer-screen-queries': 'warn'
|
|
29
31
|
},
|
|
30
|
-
|
|
32
|
+
'ignorePatterns': ['locales']
|
|
31
33
|
};
|