eslint-config-fabulator 4.3.0 → 5.0.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 +10 -0
- package/index.js +75 -73
- package/package.json +17 -24
- package/jest.js +0 -16
- package/react.js +0 -50
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## v5.0.0 (2025-03-20)
|
|
5
|
+
### Changed
|
|
6
|
+
- [09dd656](https://github.com/fabulator/eslint-config-fabulator/commit/09dd656e7c1e57ee4c9f019bd898774f183dab05) Upgrade to eslint 9 BREAKING
|
|
7
|
+
- [74201a1](https://github.com/fabulator/eslint-config-fabulator/commit/74201a156a9826e2cb1c39bcb2b79ece3ce2ed93) Update Github Flow dependency node to v20.19.0 (#186)
|
|
8
|
+
|
|
9
|
+
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
|
|
10
|
+
- [6d90841](https://github.com/fabulator/eslint-config-fabulator/commit/6d9084148b1d22bf01339fee772c04b75bef1057) Update Github Flow dependency node to v20.18.3 (#184)
|
|
11
|
+
|
|
12
|
+
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
|
|
13
|
+
|
|
4
14
|
## v4.3.0 (2024-10-24)
|
|
5
15
|
### Changed
|
|
6
16
|
- [8b8aef0](https://github.com/fabulator/eslint-config-fabulator/commit/8b8aef01f3329c335951a1f1ec5ea49496bc9282) Remove sonarjs - too louzy
|
package/index.js
CHANGED
|
@@ -1,82 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { defineConfig } from 'eslint/config';
|
|
2
|
+
import reactPlugin from 'eslint-plugin-react';
|
|
3
|
+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
4
|
+
import arrayFunc from 'eslint-plugin-array-func';
|
|
5
|
+
import js from '@eslint/js';
|
|
6
|
+
import canonical from 'eslint-plugin-canonical';
|
|
7
|
+
import importPlugin from 'eslint-plugin-import';
|
|
8
|
+
import tseslint from 'typescript-eslint';
|
|
9
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
10
|
+
import globals from 'globals';
|
|
4
11
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
files: ['*.test.*'],
|
|
16
|
-
...jestConfig,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
files: ['*.*sx'],
|
|
20
|
-
...reactConfig,
|
|
12
|
+
export default defineConfig([
|
|
13
|
+
{
|
|
14
|
+
extends: [arrayFunc.configs.recommended],
|
|
15
|
+
rules: { 'array-func/prefer-array-from': 0 },
|
|
16
|
+
},
|
|
17
|
+
js.configs.recommended,
|
|
18
|
+
importPlugin.flatConfigs.recommended,
|
|
19
|
+
{
|
|
20
|
+
plugins: {
|
|
21
|
+
canonical: canonical,
|
|
21
22
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
extends: [reactHooks.configs['recommended-latest']],
|
|
26
|
+
files: ['use*.*sx', 'use*.js', 'use*.ts', '*.tsx', '*.jsx'],
|
|
27
|
+
rules: {
|
|
28
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
29
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
29
30
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
extends: [reactPlugin.configs.recommended],
|
|
34
|
+
files: ['*.tsx', '*.jsx'],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
extends: [
|
|
38
|
+
tseslint.configs.strictTypeChecked,
|
|
39
|
+
tseslint.configs.stylisticTypeChecked,
|
|
40
|
+
],
|
|
41
|
+
files: ['*.tsx', '*.ts'],
|
|
42
|
+
rules: {
|
|
43
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
|
|
44
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
45
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
46
|
+
'@typescript-eslint/no-unused-vars': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
args: 'all',
|
|
50
|
+
argsIgnorePattern: '^_',
|
|
51
|
+
ignoreRestSiblings: true,
|
|
52
|
+
vars: 'all',
|
|
53
|
+
},
|
|
36
54
|
],
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
args: 'all',
|
|
46
|
-
argsIgnorePattern: '^_',
|
|
47
|
-
ignoreRestSiblings: true,
|
|
48
|
-
vars: 'all',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
'@typescript-eslint/non-nullable-type-assertion-style': 'error',
|
|
52
|
-
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
53
|
-
},
|
|
55
|
+
'@typescript-eslint/non-nullable-type-assertion-style': 'error',
|
|
56
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
languageOptions: {
|
|
61
|
+
globals: { ...globals.browser, ...globals.node },
|
|
62
|
+
parserOptions: { ecmaVersion: 'latest' },
|
|
54
63
|
},
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
settings: {
|
|
65
|
+
'import/resolver': {
|
|
66
|
+
// You will also need to install and configure the TypeScript resolver
|
|
67
|
+
// See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
|
|
68
|
+
typescript: true,
|
|
69
|
+
node: true,
|
|
60
70
|
},
|
|
61
71
|
},
|
|
62
|
-
],
|
|
63
|
-
parserOptions: {
|
|
64
|
-
ecmaVersion: 'latest',
|
|
65
72
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
'error',
|
|
77
|
-
{
|
|
78
|
-
singleQuote: true,
|
|
79
|
-
},
|
|
80
|
-
],
|
|
73
|
+
eslintPluginPrettierRecommended,
|
|
74
|
+
{
|
|
75
|
+
rules: {
|
|
76
|
+
'prettier/prettier': [
|
|
77
|
+
'error',
|
|
78
|
+
{
|
|
79
|
+
singleQuote: true,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
81
83
|
},
|
|
82
|
-
|
|
84
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-fabulator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Shared ESLint config for fabulator projects",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"eslint",
|
|
7
8
|
"eslint-config",
|
|
@@ -19,36 +20,28 @@
|
|
|
19
20
|
"author": "Michal Ozogán <michal@ozogan.eu>",
|
|
20
21
|
"main": "index.js",
|
|
21
22
|
"scripts": {
|
|
22
|
-
"lint": "eslint ./ --ext .js --
|
|
23
|
+
"lint": "eslint ./ --ext .js --config index.js",
|
|
23
24
|
"lint:fix": "npm run lint -- --fix",
|
|
24
|
-
"release": "semantic-release"
|
|
25
|
-
"test": "node node_modules/jest/bin/jest.js",
|
|
26
|
-
"test-and-lint": "npm run test && npm run lint"
|
|
25
|
+
"release": "semantic-release"
|
|
27
26
|
},
|
|
28
27
|
"dependencies": {
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"eslint": "
|
|
32
|
-
"eslint-
|
|
33
|
-
"eslint-plugin-
|
|
34
|
-
"eslint-plugin-
|
|
35
|
-
"eslint-plugin-
|
|
36
|
-
"eslint-plugin-
|
|
37
|
-
"eslint-plugin-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"eslint
|
|
41
|
-
"eslint-plugin-react": "^7.35.2",
|
|
42
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
43
|
-
"eslint-plugin-typescript-sort-keys": "^3.2.0",
|
|
44
|
-
"prettier": "^3.3.3"
|
|
28
|
+
"eslint": "^9.22.0",
|
|
29
|
+
"eslint-config-prettier": "^10.1.1",
|
|
30
|
+
"eslint-plugin-array-func": "5.0.2",
|
|
31
|
+
"eslint-plugin-canonical": "^5.1.3",
|
|
32
|
+
"eslint-plugin-import": "^2.31.0",
|
|
33
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
34
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
35
|
+
"eslint-plugin-react": "^7.37.4",
|
|
36
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
37
|
+
"globals": "^16.0.0",
|
|
38
|
+
"prettier": "^3.5.3",
|
|
39
|
+
"typescript-eslint": "^8.27.0"
|
|
45
40
|
},
|
|
46
41
|
"devDependencies": {
|
|
47
42
|
"commitlint-config-fabulator": "^6.1.0",
|
|
48
|
-
"enhanced-resolve": "^5.17.1",
|
|
49
|
-
"jest": "^29.7.0",
|
|
50
43
|
"semantic-release-config-fabulator": "^7.0.0",
|
|
51
|
-
"typescript": "^5.
|
|
44
|
+
"typescript": "^5.8.2"
|
|
52
45
|
},
|
|
53
46
|
"peerDependencies": {
|
|
54
47
|
"typescript": "^5"
|
package/jest.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
jest: true,
|
|
4
|
-
},
|
|
5
|
-
extends: ['plugin:jest/recommended'],
|
|
6
|
-
plugins: ['jest'],
|
|
7
|
-
rules: {
|
|
8
|
-
'compat/compat': 0,
|
|
9
|
-
// no need for testing env
|
|
10
|
-
'promise/catch-or-return': 0,
|
|
11
|
-
|
|
12
|
-
// do not check for browser support
|
|
13
|
-
'promise/no-callback-in-promise': 0,
|
|
14
|
-
'sonarjs/no-duplicate-string': 0, // no need for testing env
|
|
15
|
-
},
|
|
16
|
-
};
|
package/react.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
'plugin:react/recommended',
|
|
4
|
-
'plugin:prettier/recommended',
|
|
5
|
-
'plugin:jsx-a11y/recommended',
|
|
6
|
-
'plugin:react-hooks/recommended',
|
|
7
|
-
],
|
|
8
|
-
rules: {
|
|
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
|
-
],
|
|
17
|
-
'react/jsx-max-props-per-line': [
|
|
18
|
-
'error',
|
|
19
|
-
{ maximum: 1, when: 'multiline' },
|
|
20
|
-
],
|
|
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
|
-
2,
|
|
27
|
-
{
|
|
28
|
-
callbacksLast: true,
|
|
29
|
-
shorthandFirst: true,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
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
|
-
'prettier/prettier': [
|
|
44
|
-
'error',
|
|
45
|
-
{
|
|
46
|
-
singleQuote: true,
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
};
|