@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
- // 'import/no-unused-modules': 'off', // Disabled - incompatible with flat config, requires legacy .eslintrc
617
- 'import/unambiguous': 'off',
618
- 'import/no-commonjs': 'off',
619
- 'import/no-amd': 'error',
620
- 'import/no-nodejs-modules': 'off',
621
- 'import/first': 'error',
622
- 'import/exports-last': 'off',
623
- 'import/no-duplicates': 'error',
624
- 'import/no-namespace': 'off',
625
- 'import/extensions': 'off', // Disabled - TypeScript handles this, causes issues with test files and relative imports
626
- 'import/newline-after-import': 'error',
627
- 'import/prefer-default-export': 'off',
628
- 'import/max-dependencies': ['warn', { max: 20 }],
629
- 'import/no-unassigned-import': 'off',
630
- 'import/no-named-default': 'error',
631
- 'import/no-default-export': 'off',
632
- 'import/no-named-export': 'off',
633
- 'import/no-anonymous-default-export': 'warn',
634
- 'import/group-exports': 'off',
635
- 'import/dynamic-import-chunkname': 'off',
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.12",
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.6.1",
49
- "@typescript-eslint/eslint-plugin": "^8.50.0",
50
- "@typescript-eslint/parser": "^8.50.0",
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-import-resolver-typescript": "^4.4.4",
53
- "eslint-plugin-functional": "^9.0.2",
54
- "eslint-plugin-import": "^2.32.0",
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.2.1",
58
- "eslint-plugin-perfectionist": "^4.15.1",
59
- "eslint-plugin-prettier": "^5.5.3",
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": "^2.10.0",
62
- "eslint-plugin-security": "^3.0.1",
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": "^3.0.5",
65
- "eslint-plugin-unicorn": "^62.0.0",
66
- "eslint-plugin-unused-imports": "^4.3.0",
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.8.2",
69
- "prettier-plugin-merge": "^0.8.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
+ }
@@ -19,7 +19,7 @@ const interfaceBraceRule = {
19
19
  },
20
20
 
21
21
  create(context) {
22
- const sourceCode = context.sourceCode || context.getSourceCode();
22
+ const sourceCode = context.sourceCode;
23
23
 
24
24
  return {
25
25
  TSInterfaceDeclaration(node) {
@@ -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 || context.getSourceCode();
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.getFilename(), path.extname(context.getFilename()));
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.getFilename();
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.getFilename();
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.getFilename();
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.getFilename();
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.getFilename();
1101
+ const fullPath = context.filename;
1102
1102
 
1103
1103
  if (fullPath === '<input>' || fullPath === '<text>') {
1104
1104
  return;
@@ -26,7 +26,7 @@ const switchCaseBraceRule = {
26
26
  },
27
27
 
28
28
  create(context) {
29
- const sourceCode = context.getSourceCode();
29
+ const sourceCode = context.sourceCode;
30
30
 
31
31
  /**
32
32
  * Check if a case clause has a block statement and enforce proper brace placement