From 9de9ef3e1c6cca0dfb8d121ffafcb02f7015e07b Mon Sep 17 00:00:00 2001 From: Aleksey Kovalevsky Date: Wed, 19 Mar 2025 10:53:34 +0200 Subject: [PATCH 1/2] eslint-config-seekingalpha-base ver. 11.2.0 - [breaking] disabled rules `n/no-extraneous-require`, `n/no-missing-require`, `n/exports-style`, `n/no-extraneous-import`, `n/no-missing-import`, `n/no-callback-literal`, `n/global-require`, `n/handle-callback-err`, `n/no-mixed-requires`, `n/no-new-require`, `n/callback-return`, `n/file-extension-in-import`, `n/file-extension-in-import`, `n/no-exports-assign` after migration to ESM --- .../CHANGELOG.md | 4 ++ .../package.json | 2 +- .../rules/eslint-plugin-n/index.js | 43 ++++++++++--------- package.json | 4 +- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/eslint-configs/eslint-config-seekingalpha-base/CHANGELOG.md b/eslint-configs/eslint-config-seekingalpha-base/CHANGELOG.md index 8cce1ec8..a23f896c 100644 --- a/eslint-configs/eslint-config-seekingalpha-base/CHANGELOG.md +++ b/eslint-configs/eslint-config-seekingalpha-base/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 11.2.0 - 2025-03-19 + +- [breaking] disabled rules `n/no-extraneous-require`, `n/no-missing-require`, `n/exports-style`, `n/no-extraneous-import`, `n/no-missing-import`, `n/no-callback-literal`, `n/global-require`, `n/handle-callback-err`, `n/no-mixed-requires`, `n/no-new-require`, `n/callback-return`, `n/file-extension-in-import`, `n/file-extension-in-import`, `n/no-exports-assign` after migration to ESM + ## 11.1.0 - 2025-03-09 - [deps] update `eslint-plugin-unicorn` to version `57.0.0` diff --git a/eslint-configs/eslint-config-seekingalpha-base/package.json b/eslint-configs/eslint-config-seekingalpha-base/package.json index 9cf74d7f..61b9fae0 100644 --- a/eslint-configs/eslint-config-seekingalpha-base/package.json +++ b/eslint-configs/eslint-config-seekingalpha-base/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-seekingalpha-base", - "version": "11.1.0", + "version": "11.2.0", "description": "SeekingAlpha's sharable base ESLint config", "main": "index.js", "type": "module", diff --git a/eslint-configs/eslint-config-seekingalpha-node/rules/eslint-plugin-n/index.js b/eslint-configs/eslint-config-seekingalpha-node/rules/eslint-plugin-n/index.js index 60658a3c..9791b719 100644 --- a/eslint-configs/eslint-config-seekingalpha-node/rules/eslint-plugin-n/index.js +++ b/eslint-configs/eslint-config-seekingalpha-node/rules/eslint-plugin-n/index.js @@ -7,16 +7,19 @@ export default { }, rules: { // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-require.md - 'n/no-extraneous-require': 'error', + // migrated to ESM + 'n/no-extraneous-require': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-require.md - 'n/no-missing-require': 'error', + // migrated to ESM + 'n/no-missing-require': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-syntax.md 'n/no-unsupported-features/es-syntax': 'error', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/exports-style.md - 'n/exports-style': ['error', 'module.exports'], + // migrated to ESM + 'n/exports-style': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/buffer.md 'n/prefer-global/buffer': ['error', 'always'], @@ -34,7 +37,8 @@ export default { 'n/prefer-global/url': ['error', 'always'], // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-import.md - 'n/no-extraneous-import': 'error', + // disabled in favour of import/no-extraneous-dependencies + 'n/no-extraneous-import': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/process-exit-as-throw.md 'n/process-exit-as-throw': 'error', @@ -49,7 +53,8 @@ export default { 'n/no-unpublished-bin': 'error', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-import.md - 'n/no-missing-import': 'error', + // disabled in favor of import/no-unresolved + 'n/no-missing-import': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-import.md 'n/no-unpublished-import': 'off', @@ -61,19 +66,22 @@ export default { 'n/no-deprecated-api': 'error', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-callback-literal.md - 'n/no-callback-literal': 'error', + 'n/no-callback-literal': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/global-require.md - 'n/global-require': 'error', + // migrated to ESM + 'n/global-require': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/handle-callback-err.md - 'n/handle-callback-err': 'error', + 'n/handle-callback-err': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-mixed-requires.md - 'n/no-mixed-requires': 'error', + // migrated to ESM + 'n/no-mixed-requires': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-new-require.md - 'n/no-new-require': 'error', + // migrated to ESM + 'n/no-new-require': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-path-concat.md 'n/no-path-concat': 'error', @@ -94,7 +102,7 @@ export default { 'n/no-sync': 'error', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md - 'n/callback-return': 'error', + 'n/callback-return': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/shebang.md 'n/shebang': 'off', @@ -106,14 +114,8 @@ export default { 'n/prefer-global/text-encoder': ['error', 'always'], // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/file-extension-in-import.md - 'n/file-extension-in-import': [ - 'error', - 'always', - { - '.js': 'never', - '.jsx': 'never', - }, - ], + // disabled in favour of import/extensions + 'n/file-extension-in-import': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-promises/dns.md 'n/prefer-promises/dns': 'error', @@ -122,7 +124,8 @@ export default { 'n/prefer-promises/fs': 'error', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-exports-assign.md - 'n/no-exports-assign': 'error', + // migrated to ESM + 'n/no-exports-assign': 'off', // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/hashbang.md 'n/hashbang': 'off', diff --git a/package.json b/package.json index 6d4dcf13..284fc227 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seekingalpha-javascript-style", - "version": "9.2.0", + "version": "9.3.0", "description": "Set of linting rules, guides and best practices for best Javascript code", "main": "index.js", "type": "module", @@ -55,7 +55,7 @@ "eslint-plugin-promise": "7.2.1", "eslint-plugin-unicorn": "57.0.0", "husky": "9.1.7", - "lint-staged": "15.4.3", + "lint-staged": "15.5.0", "prettier": "3.5.3" } } From 275598fefc7ade8e36856b3cd6d0ef6c051ea926 Mon Sep 17 00:00:00 2001 From: Aleksey Kovalevsky Date: Wed, 19 Mar 2025 10:59:08 +0200 Subject: [PATCH 2/2] eslint-config-seekingalpha-typescript ver. 8.2.0 - [breaking] disabled `@typescript-eslint/no-magic-numbers` and `@typescript-eslint/sort-type-constituents` --- .../CHANGELOG.md | 5 ++++- .../package.json | 2 +- .../rules/typescript-eslint/index.js | 17 +---------------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/CHANGELOG.md b/eslint-configs/eslint-config-seekingalpha-typescript/CHANGELOG.md index 7c11d5cc..04fb1b79 100644 --- a/eslint-configs/eslint-config-seekingalpha-typescript/CHANGELOG.md +++ b/eslint-configs/eslint-config-seekingalpha-typescript/CHANGELOG.md @@ -1,10 +1,13 @@ # Change Log +## 8.2.0 - 2025-03-19 + +- [breaking] disabled `@typescript-eslint/no-magic-numbers` and `@typescript-eslint/sort-type-constituents` + ## 8.1.0 - 2025-03-10 - [deps] replace `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` with `typescript-eslin` - [deps] upgrade `typescript-eslin` to version `8.26.1` -- ## 8.0.0 - 2025-03-09 diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/package.json b/eslint-configs/eslint-config-seekingalpha-typescript/package.json index a4a6c894..e27e78c1 100644 --- a/eslint-configs/eslint-config-seekingalpha-typescript/package.json +++ b/eslint-configs/eslint-config-seekingalpha-typescript/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-seekingalpha-typescript", - "version": "8.1.0", + "version": "8.2.0", "description": "SeekingAlpha's sharable typescript ESLint config", "main": "index.js", "type": "module", diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/rules/typescript-eslint/index.js b/eslint-configs/eslint-config-seekingalpha-typescript/rules/typescript-eslint/index.js index 22c35508..9788bc46 100644 --- a/eslint-configs/eslint-config-seekingalpha-typescript/rules/typescript-eslint/index.js +++ b/eslint-configs/eslint-config-seekingalpha-typescript/rules/typescript-eslint/index.js @@ -198,20 +198,7 @@ export default { '@typescript-eslint/no-loop-func': 'error', - '@typescript-eslint/no-magic-numbers': [ - 'error', - { - // These numbers are used in simple cases, we can exclude them - ignore: [-1, 0, 1], - ignoreArrayIndexes: true, - enforceConst: true, - detectObjects: false, - ignoreEnums: true, - ignoreNumericLiteralTypes: true, - ignoreReadonlyClassProperties: true, - ignoreTypeIndexes: true, - }, - ], + '@typescript-eslint/no-magic-numbers': 'off', '@typescript-eslint/no-misused-new': 'error', @@ -303,8 +290,6 @@ export default { '@typescript-eslint/prefer-namespace-keyword': 'error', - '@typescript-eslint/sort-type-constituents': 'error', - '@typescript-eslint/triple-slash-reference': 'error', '@typescript-eslint/typedef': 'error',