@dmitryrechkin/eslint-standard 1.5.12 → 1.5.13
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/eslint.config.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint.config.mjs
|
|
2
2
|
//
|
|
3
|
-
// ESLint 9.x Flat Config for @dmitryrechkin/eslint-standard
|
|
3
|
+
// ESLint 9.x / 10.x Flat Config for @dmitryrechkin/eslint-standard
|
|
4
4
|
//
|
|
5
5
|
// For optimal compatibility, pass the prettier plugin from your consuming project:
|
|
6
6
|
//
|
|
@@ -21,16 +21,16 @@ import switchCaseBracePlugin from './src/plugins/switch-case-brace.mjs';
|
|
|
21
21
|
import securityPlugin from 'eslint-plugin-security';
|
|
22
22
|
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
|
|
23
23
|
import promisePlugin from 'eslint-plugin-promise';
|
|
24
|
-
import importPlugin from 'eslint-plugin-import';
|
|
24
|
+
import importPlugin from 'eslint-plugin-import-x';
|
|
25
25
|
import sonarjsPlugin from 'eslint-plugin-sonarjs';
|
|
26
26
|
import unicornPlugin from 'eslint-plugin-unicorn';
|
|
27
27
|
import noSecretsPlugin from 'eslint-plugin-no-secrets';
|
|
28
28
|
import regexpPlugin from 'eslint-plugin-regexp';
|
|
29
29
|
import functionalPlugin from 'eslint-plugin-functional';
|
|
30
30
|
import standardConventionsPlugin from './src/plugins/standard-conventions.mjs';
|
|
31
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
31
|
+
// eslint-disable-next-line import-x/no-extraneous-dependencies
|
|
32
32
|
import prettierConfig from 'eslint-config-prettier';
|
|
33
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
33
|
+
// eslint-disable-next-line import-x/no-extraneous-dependencies
|
|
34
34
|
import prettierPlugin from 'eslint-plugin-prettier';
|
|
35
35
|
|
|
36
36
|
export default function ({
|
|
@@ -74,7 +74,7 @@ export default function ({
|
|
|
74
74
|
'security': securityPlugin,
|
|
75
75
|
'jsx-a11y': jsxA11yPlugin,
|
|
76
76
|
'promise': promisePlugin,
|
|
77
|
-
'import': importPlugin,
|
|
77
|
+
'import-x': importPlugin,
|
|
78
78
|
'sonarjs': sonarjsPlugin,
|
|
79
79
|
'unicorn': unicornPlugin,
|
|
80
80
|
'no-secrets': noSecretsPlugin,
|
|
@@ -85,15 +85,15 @@ export default function ({
|
|
|
85
85
|
...plugins,
|
|
86
86
|
},
|
|
87
87
|
settings: {
|
|
88
|
-
'import/resolver': {
|
|
88
|
+
'import-x/resolver': {
|
|
89
89
|
node: {
|
|
90
90
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
91
91
|
},
|
|
92
92
|
},
|
|
93
|
-
'import/parsers': {
|
|
93
|
+
'import-x/parsers': {
|
|
94
94
|
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
95
95
|
},
|
|
96
|
-
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
|
|
96
|
+
'import-x/extensions': ['.js', '.jsx', '.ts', '.tsx'],
|
|
97
97
|
},
|
|
98
98
|
rules: {
|
|
99
99
|
// Prettier integration
|
|
@@ -591,49 +591,48 @@ export default function ({
|
|
|
591
591
|
'promise/prefer-await-to-then': 'warn',
|
|
592
592
|
'promise/prefer-await-to-callbacks': 'warn',
|
|
593
593
|
|
|
594
|
-
// Import plugin rules
|
|
595
|
-
'import/no-unresolved': 'off', // Too many false positives with TypeScript
|
|
596
|
-
'import/named': 'error',
|
|
597
|
-
'import/default': 'error',
|
|
598
|
-
'import/namespace': 'error',
|
|
599
|
-
'import/no-restricted-paths': 'off',
|
|
600
|
-
'import/no-absolute-path': 'error',
|
|
601
|
-
'import/no-dynamic-require': 'error',
|
|
602
|
-
'import/no-internal-modules': 'off',
|
|
603
|
-
'import/no-webpack-loader-syntax': 'error',
|
|
604
|
-
'import/no-self-import': 'error',
|
|
605
|
-
'import/no-cycle': ['error', { maxDepth: 3 }],
|
|
606
|
-
'import/no-useless-path-segments': 'error',
|
|
607
|
-
'import/no-relative-parent-imports': 'off',
|
|
608
|
-
'import/export': 'error',
|
|
609
|
-
'import/no-named-as-default': 'error',
|
|
610
|
-
'import/no-named-as-default-member': 'error',
|
|
611
|
-
'import/no-deprecated': 'warn',
|
|
612
|
-
'import/no-extraneous-dependencies': ['error', {
|
|
594
|
+
// Import plugin rules (eslint-plugin-import-x)
|
|
595
|
+
'import-x/no-unresolved': 'off', // Too many false positives with TypeScript
|
|
596
|
+
'import-x/named': 'error',
|
|
597
|
+
'import-x/default': 'error',
|
|
598
|
+
'import-x/namespace': 'error',
|
|
599
|
+
'import-x/no-restricted-paths': 'off',
|
|
600
|
+
'import-x/no-absolute-path': 'error',
|
|
601
|
+
'import-x/no-dynamic-require': 'error',
|
|
602
|
+
'import-x/no-internal-modules': 'off',
|
|
603
|
+
'import-x/no-webpack-loader-syntax': 'error',
|
|
604
|
+
'import-x/no-self-import': 'error',
|
|
605
|
+
'import-x/no-cycle': ['error', { maxDepth: 3 }],
|
|
606
|
+
'import-x/no-useless-path-segments': 'error',
|
|
607
|
+
'import-x/no-relative-parent-imports': 'off',
|
|
608
|
+
'import-x/export': 'error',
|
|
609
|
+
'import-x/no-named-as-default': 'error',
|
|
610
|
+
'import-x/no-named-as-default-member': 'error',
|
|
611
|
+
'import-x/no-deprecated': 'warn',
|
|
612
|
+
'import-x/no-extraneous-dependencies': ['error', {
|
|
613
613
|
devDependencies: ['**/*.test.{js,jsx,ts,tsx}', '**/*.spec.{js,jsx,ts,tsx}', '**/test/**', '**/tests/**', '**/__tests__/**']
|
|
614
614
|
}],
|
|
615
|
-
'import/no-mutable-exports': 'error',
|
|
616
|
-
|
|
617
|
-
'import/
|
|
618
|
-
'import/no-
|
|
619
|
-
'import/no-
|
|
620
|
-
'import/
|
|
621
|
-
'import/
|
|
622
|
-
'import/
|
|
623
|
-
'import/no-
|
|
624
|
-
'import/
|
|
625
|
-
'import/
|
|
626
|
-
'import/
|
|
627
|
-
'import/
|
|
628
|
-
'import/
|
|
629
|
-
'import/no-
|
|
630
|
-
'import/no-
|
|
631
|
-
'import/no-
|
|
632
|
-
'import/no-
|
|
633
|
-
'import/
|
|
634
|
-
'import/
|
|
635
|
-
'import/
|
|
636
|
-
'import/order': 'off', // Disabled - conflicts with simple-import-sort plugin
|
|
615
|
+
'import-x/no-mutable-exports': 'error',
|
|
616
|
+
'import-x/unambiguous': 'off',
|
|
617
|
+
'import-x/no-commonjs': 'off',
|
|
618
|
+
'import-x/no-amd': 'error',
|
|
619
|
+
'import-x/no-nodejs-modules': 'off',
|
|
620
|
+
'import-x/first': 'error',
|
|
621
|
+
'import-x/exports-last': 'off',
|
|
622
|
+
'import-x/no-duplicates': 'error',
|
|
623
|
+
'import-x/no-namespace': 'off',
|
|
624
|
+
'import-x/extensions': 'off', // Disabled - TypeScript handles this, causes issues with test files and relative imports
|
|
625
|
+
'import-x/newline-after-import': 'error',
|
|
626
|
+
'import-x/prefer-default-export': 'off',
|
|
627
|
+
'import-x/max-dependencies': ['warn', { max: 20 }],
|
|
628
|
+
'import-x/no-unassigned-import': 'off',
|
|
629
|
+
'import-x/no-named-default': 'error',
|
|
630
|
+
'import-x/no-default-export': 'off',
|
|
631
|
+
'import-x/no-named-export': 'off',
|
|
632
|
+
'import-x/no-anonymous-default-export': 'warn',
|
|
633
|
+
'import-x/group-exports': 'off',
|
|
634
|
+
'import-x/dynamic-import-chunkname': 'off',
|
|
635
|
+
'import-x/order': 'off', // Disabled - conflicts with simple-import-sort plugin
|
|
637
636
|
|
|
638
637
|
// JSX A11y plugin rules (only active for React/JSX files)
|
|
639
638
|
'jsx-a11y/alt-text': 'error',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dmitryrechkin/eslint-standard",
|
|
3
3
|
"description": "This package provides a shared ESLint configuration which includes TypeScript support and a set of specific linting rules designed to ensure high-quality and consistent code style across projects.",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.13",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "eslint.config.mjs",
|
|
7
7
|
"types": "./eslint.config.d.ts",
|
|
@@ -45,32 +45,34 @@
|
|
|
45
45
|
"author": "",
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@stylistic/eslint-plugin": "^5.
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
50
|
-
"@typescript-eslint/parser": "^8.
|
|
48
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
50
|
+
"@typescript-eslint/parser": "^8.57.1",
|
|
51
51
|
"eslint-config-prettier": "^10.1.8",
|
|
52
|
-
"eslint-
|
|
53
|
-
"eslint-plugin-
|
|
54
|
-
"eslint-plugin-
|
|
55
|
-
"eslint-plugin-jsdoc": "^61.5.0",
|
|
52
|
+
"eslint-plugin-functional": "^9.0.4",
|
|
53
|
+
"eslint-plugin-import-x": "^4.16.2",
|
|
54
|
+
"eslint-plugin-jsdoc": "^62.8.0",
|
|
56
55
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
57
|
-
"eslint-plugin-no-secrets": "^2.
|
|
58
|
-
"eslint-plugin-perfectionist": "^
|
|
59
|
-
"eslint-plugin-prettier": "^5.5.
|
|
56
|
+
"eslint-plugin-no-secrets": "^2.3.3",
|
|
57
|
+
"eslint-plugin-perfectionist": "^5.7.0",
|
|
58
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
60
59
|
"eslint-plugin-promise": "^7.2.1",
|
|
61
|
-
"eslint-plugin-regexp": "^
|
|
62
|
-
"eslint-plugin-security": "^
|
|
60
|
+
"eslint-plugin-regexp": "^3.1.0",
|
|
61
|
+
"eslint-plugin-security": "^4.0.0",
|
|
63
62
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
64
|
-
"eslint-plugin-sonarjs": "^
|
|
65
|
-
"eslint-plugin-unicorn": "^
|
|
66
|
-
"eslint-plugin-unused-imports": "^4.
|
|
63
|
+
"eslint-plugin-sonarjs": "^4.0.2",
|
|
64
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
65
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
67
66
|
"prettier-plugin-astro": "^0.14.1",
|
|
68
|
-
"prettier-plugin-brace-style": "^0.
|
|
69
|
-
"prettier-plugin-merge": "^0.
|
|
67
|
+
"prettier-plugin-brace-style": "^0.10.0",
|
|
68
|
+
"prettier-plugin-merge": "^0.10.0"
|
|
70
69
|
},
|
|
71
70
|
"peerDependencies": {
|
|
72
|
-
"eslint": "^9.0.0",
|
|
71
|
+
"eslint": "^9.0.0 || ^10.0.0",
|
|
73
72
|
"prettier": "^3.0.0",
|
|
74
73
|
"typescript": "^5.0.0"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"eslint": "^10.1.0"
|
|
75
77
|
}
|
|
76
|
-
}
|
|
78
|
+
}
|
|
@@ -29,7 +29,7 @@ const jsdocIndentRule = {
|
|
|
29
29
|
create(context) {
|
|
30
30
|
const options = context.options[0] || {};
|
|
31
31
|
const tabWidth = options.tabWidth || 4;
|
|
32
|
-
const sourceCode = context.sourceCode
|
|
32
|
+
const sourceCode = context.sourceCode;
|
|
33
33
|
|
|
34
34
|
return {
|
|
35
35
|
Program() {
|
|
@@ -107,7 +107,7 @@ const functionNameMatchFilenameRule = {
|
|
|
107
107
|
schema: []
|
|
108
108
|
},
|
|
109
109
|
create(context) {
|
|
110
|
-
const filename = path.basename(context.
|
|
110
|
+
const filename = path.basename(context.filename, path.extname(context.filename));
|
|
111
111
|
|
|
112
112
|
return {
|
|
113
113
|
FunctionDeclaration(node) {
|
|
@@ -157,7 +157,7 @@ const folderCamelCaseRule = {
|
|
|
157
157
|
create(context) {
|
|
158
158
|
return {
|
|
159
159
|
Program() {
|
|
160
|
-
const fullPath = context.
|
|
160
|
+
const fullPath = context.filename;
|
|
161
161
|
|
|
162
162
|
if (fullPath === '<input>' || fullPath === '<text>') {
|
|
163
163
|
return;
|
|
@@ -353,7 +353,7 @@ const classLocationRule = {
|
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
const className = node.id.name;
|
|
356
|
-
const fullPath = context.
|
|
356
|
+
const fullPath = context.filename;
|
|
357
357
|
|
|
358
358
|
if (fullPath === '<input>' || fullPath === '<text>') {
|
|
359
359
|
return;
|
|
@@ -414,7 +414,7 @@ const typeLocationRule = {
|
|
|
414
414
|
return;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
const fullPath = context.
|
|
417
|
+
const fullPath = context.filename;
|
|
418
418
|
|
|
419
419
|
if (fullPath === '<input>' || fullPath === '<text>') {
|
|
420
420
|
return;
|
|
@@ -443,7 +443,7 @@ const typeLocationRule = {
|
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
const fullPath = context.
|
|
446
|
+
const fullPath = context.filename;
|
|
447
447
|
|
|
448
448
|
if (fullPath === '<input>' || fullPath === '<text>') {
|
|
449
449
|
return;
|
|
@@ -1098,7 +1098,7 @@ const noUtilsFolderRule = {
|
|
|
1098
1098
|
create(context) {
|
|
1099
1099
|
return {
|
|
1100
1100
|
Program(node) {
|
|
1101
|
-
const fullPath = context.
|
|
1101
|
+
const fullPath = context.filename;
|
|
1102
1102
|
|
|
1103
1103
|
if (fullPath === '<input>' || fullPath === '<text>') {
|
|
1104
1104
|
return;
|