eslint-config-fabulator 4.0.0 → 4.1.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/CHANGELOG.md +9 -0
- package/index.js +54 -27
- package/jest.js +6 -6
- package/package.json +1 -2
- package/react.js +30 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## v4.1.0 (2023-12-17)
|
|
5
|
+
### Changed
|
|
6
|
+
- [9fabc21](https://github.com/fabulator/eslint-config-fabulator/commit/9fabc217e4c7c166e963f078ecc725f57a8739b2) Update rules
|
|
7
|
+
- [5b3da45](https://github.com/fabulator/eslint-config-fabulator/commit/5b3da452de18f787e52c4c9fa2476a1010890bd9) Update rules
|
|
8
|
+
|
|
9
|
+
## v4.0.1 (2023-12-16)
|
|
10
|
+
### Fixed
|
|
11
|
+
- [24a5a9e](https://github.com/fabulator/eslint-config-fabulator/commit/24a5a9edcf9d3c48c241eb9ed63423b13cbdf743) Remove unsed dependency
|
|
12
|
+
|
|
4
13
|
## v4.0.0 (2023-12-16)
|
|
5
14
|
### Fixed
|
|
6
15
|
- [3b2fa3f](https://github.com/fabulator/eslint-config-fabulator/commit/3b2fa3fe3b1f694d677c786dcec30b7369833a00) formatting
|
package/index.js
CHANGED
|
@@ -1,58 +1,85 @@
|
|
|
1
1
|
// eslint-disable-next-line canonical/filename-no-index
|
|
2
|
-
const jestConfig = require(
|
|
3
|
-
const reactConfig = require(
|
|
2
|
+
const jestConfig = require('./jest');
|
|
3
|
+
const reactConfig = require('./react');
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
6
|
extends: [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
'eslint:recommended',
|
|
8
|
+
'plugin:sonarjs/recommended',
|
|
9
|
+
'plugin:canonical/recommended',
|
|
10
|
+
'plugin:import/recommended',
|
|
11
|
+
'plugin:array-func/recommended',
|
|
12
|
+
'plugin:prettier/recommended',
|
|
13
13
|
],
|
|
14
14
|
overrides: [
|
|
15
15
|
{
|
|
16
|
-
files: [
|
|
16
|
+
files: ['*.test.*'],
|
|
17
17
|
...jestConfig,
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
files: [
|
|
20
|
+
files: ['*.*sx'],
|
|
21
21
|
...reactConfig,
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
extends: [
|
|
25
|
-
files: [
|
|
24
|
+
extends: ['plugin:react-hooks/recommended'],
|
|
25
|
+
files: ['use*.*sx', 'use*.js', 'use*.ts'],
|
|
26
26
|
rules: {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
28
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
extends: [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
'plugin:@typescript-eslint/strict-type-checked',
|
|
34
|
+
'plugin:typescript-sort-keys/recommended',
|
|
35
|
+
'plugin:import/typescript',
|
|
36
|
+
'plugin:prettier/recommended',
|
|
37
37
|
],
|
|
38
|
-
files: [
|
|
39
|
-
parser:
|
|
38
|
+
files: ['*.tsx', '*.ts'],
|
|
39
|
+
parser: '@typescript-eslint/parser',
|
|
40
|
+
rules: {
|
|
41
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
|
|
42
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
43
|
+
'@typescript-eslint/no-unused-vars': [
|
|
44
|
+
'error',
|
|
45
|
+
{
|
|
46
|
+
args: 'all',
|
|
47
|
+
argsIgnorePattern: '^_',
|
|
48
|
+
ignoreRestSiblings: true,
|
|
49
|
+
vars: 'all',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
'@typescript-eslint/non-nullable-type-assertion-style': 'error',
|
|
53
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
54
|
+
},
|
|
40
55
|
},
|
|
41
56
|
{
|
|
42
|
-
files: [
|
|
43
|
-
plugins: [
|
|
57
|
+
files: ['*.json'],
|
|
58
|
+
plugins: ['json-format'],
|
|
44
59
|
rules: {
|
|
45
|
-
|
|
60
|
+
'json/sort-package-json': [2, 'standard'],
|
|
46
61
|
},
|
|
47
62
|
},
|
|
48
63
|
],
|
|
49
64
|
parserOptions: {
|
|
50
|
-
ecmaVersion:
|
|
65
|
+
ecmaVersion: 'latest',
|
|
51
66
|
},
|
|
52
|
-
plugins: [
|
|
67
|
+
plugins: ['filenames'],
|
|
53
68
|
reportUnusedDisableDirectives: true,
|
|
54
69
|
rules: {
|
|
55
|
-
|
|
56
|
-
|
|
70
|
+
'canonical/destructuring-property-newline': 0,
|
|
71
|
+
'canonical/export-specifier-newline': 0,
|
|
72
|
+
'canonical/filename-no-index': 'error',
|
|
73
|
+
'canonical/import-specifier-newline': 0,
|
|
74
|
+
'filenames/match-exported': [2, null, '\\.config.js$'],
|
|
75
|
+
'no-irregular-whitespace': 0,
|
|
76
|
+
'prettier/prettier': [
|
|
77
|
+
'error',
|
|
78
|
+
{
|
|
79
|
+
singleQuote: true,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
'sonarjs/no-duplicate-string': 0,
|
|
83
|
+
'sonarjs/no-nested-template-literals': 0,
|
|
57
84
|
},
|
|
58
85
|
};
|
package/jest.js
CHANGED
|
@@ -2,15 +2,15 @@ module.exports = {
|
|
|
2
2
|
env: {
|
|
3
3
|
jest: true,
|
|
4
4
|
},
|
|
5
|
-
extends: [
|
|
6
|
-
plugins: [
|
|
5
|
+
extends: ['plugin:jest/recommended'],
|
|
6
|
+
plugins: ['jest'],
|
|
7
7
|
rules: {
|
|
8
|
-
|
|
8
|
+
'compat/compat': 0,
|
|
9
9
|
// no need for testing env
|
|
10
|
-
|
|
10
|
+
'promise/catch-or-return': 0,
|
|
11
11
|
|
|
12
12
|
// do not check for browser support
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
'promise/no-callback-in-promise': 0,
|
|
14
|
+
'sonarjs/no-duplicate-string': 0, // no need for testing env
|
|
15
15
|
},
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-fabulator",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Shared ESLint config for fabulator projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"test-and-lint": "npm run test && npm run lint"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@babel/eslint-parser": "^7.23.3",
|
|
30
29
|
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
31
30
|
"@typescript-eslint/parser": "^6.14.0",
|
|
32
31
|
"eslint": "^8.56.0",
|
package/react.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
extends: [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
'plugin:react/recommended',
|
|
4
|
+
'plugin:prettier/recommended',
|
|
5
|
+
'plugin:jsx-a11y/recommended',
|
|
6
|
+
'plugin:react-hooks/recommended',
|
|
7
7
|
],
|
|
8
8
|
rules: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{ extensions: [
|
|
9
|
+
'jsx-a11y/label-has-associated-control': [2, { assert: 'htmlFor' }],
|
|
10
|
+
'react/button-has-type': 'error',
|
|
11
|
+
'react/display-name': 0,
|
|
12
|
+
'react/function-component-definition': 'off',
|
|
13
|
+
'react/jsx-filename-extension': [
|
|
14
|
+
'error',
|
|
15
|
+
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
|
|
16
16
|
],
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{ maximum: 1, when:
|
|
17
|
+
'react/jsx-max-props-per-line': [
|
|
18
|
+
'error',
|
|
19
|
+
{ maximum: 1, when: 'multiline' },
|
|
20
20
|
],
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
'react/jsx-no-constructed-context-values': 0,
|
|
22
|
+
'react/jsx-no-useless-fragment': 'off',
|
|
23
|
+
'react/jsx-one-expression-per-line': 'off',
|
|
24
|
+
'react/jsx-props-no-spreading': 0,
|
|
25
|
+
'react/jsx-sort-props': [
|
|
26
26
|
2,
|
|
27
27
|
{
|
|
28
28
|
callbacksLast: true,
|
|
29
29
|
shorthandFirst: true,
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
'react/no-array-index-key': 'error',
|
|
33
|
+
'react/no-danger': 'error',
|
|
34
|
+
'react/no-typos': 'error',
|
|
35
|
+
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
|
|
36
|
+
'react/no-unused-class-component-methods': 'error',
|
|
37
|
+
'react/no-unused-prop-types': 0,
|
|
38
|
+
'react/prefer-stateless-function': 'error',
|
|
39
|
+
'react/prop-types': 'off',
|
|
40
|
+
'react/react-in-jsx-scope': 0,
|
|
41
|
+
'react/require-default-props': 0,
|
|
42
|
+
'react/state-in-constructor': 'error',
|
|
43
43
|
},
|
|
44
44
|
};
|