From cde6af8c1cda39ef5a6fe26549cfcbfd81af0b7f Mon Sep 17 00:00:00 2001 From: Aleksey Kovalevsky Date: Mon, 8 Apr 2024 22:04:55 +0300 Subject: [PATCH] Ver/5.38.12 (#383) * eslint-config-seekingalpha-base ver. 8.0.0 - [breaking] removed `@stylistic/eslint-plugin-js` * eslint-config-seekingalpha-typescript ver. 5.0.0 - [breaking] remove `@stylistic/eslint-plugin-ts` - [deps] upgrade `@typescript-eslint/eslint-plugin` to version `7.6.0` - [deps] upgrade `@typescript-eslint/parser` to version `7.6.0` --- .../CHANGELOG.md | 5 +- .../eslint-config-seekingalpha-base/README.md | 2 +- .../eslint-config-seekingalpha-base/index.js | 3 - .../package.json | 4 +- .../prettier.js | 61 -- .../rules/eslint-plugin-stylistic-js/index.js | 530 ------------------ .../CHANGELOG.md | 6 + .../README.md | 2 +- .../index.js | 3 - .../package.json | 12 +- .../prettier.js | 24 - .../disable-recommended-eslint-rules/index.js | 38 -- .../rules/eslint-plugin-stylistic-ts/index.js | 258 --------- package.json | 3 +- 14 files changed, 19 insertions(+), 932 deletions(-) delete mode 100644 eslint-configs/eslint-config-seekingalpha-base/rules/eslint-plugin-stylistic-js/index.js delete mode 100644 eslint-configs/eslint-config-seekingalpha-typescript/prettier.js delete mode 100644 eslint-configs/eslint-config-seekingalpha-typescript/rules/eslint-plugin-stylistic-ts/index.js diff --git a/eslint-configs/eslint-config-seekingalpha-base/CHANGELOG.md b/eslint-configs/eslint-config-seekingalpha-base/CHANGELOG.md index f9d566ba..8d7ff8b0 100644 --- a/eslint-configs/eslint-config-seekingalpha-base/CHANGELOG.md +++ b/eslint-configs/eslint-config-seekingalpha-base/CHANGELOG.md @@ -1,11 +1,14 @@ # Change Log +## 8.0.0 - 2024-04-00 + +- [breaking] removed `@stylistic/eslint-plugin-js` + ## 7.19.0 - 2024-04-03 - [deps] update `eslint-plugin-unicorn` to version `52.0.0` - [breaking] enable `unicorn/no-await-in-promise-methods` rule - [breaking] enable `unicorn/no-single-promise-in-promise-methods` rule -- ## 7.18.0 - 2024-03-17 diff --git a/eslint-configs/eslint-config-seekingalpha-base/README.md b/eslint-configs/eslint-config-seekingalpha-base/README.md index ea0eed0b..30d9b5cb 100644 --- a/eslint-configs/eslint-config-seekingalpha-base/README.md +++ b/eslint-configs/eslint-config-seekingalpha-base/README.md @@ -6,7 +6,7 @@ This package includes the shareable ESLint config used by [SeekingAlpha](https:/ Install ESLint and all [Peer Dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/): - npm install eslint@8.57.0 @stylistic/eslint-plugin-js@1.7.0 eslint-plugin-array-func@4.0.0 eslint-plugin-import@2.29.1 eslint-plugin-no-use-extend-native@0.5.0 eslint-plugin-promise@6.1.1 eslint-plugin-unicorn@52.0.0 --save-dev + npm install eslint@8.57.0 eslint-plugin-array-func@4.0.0 eslint-plugin-import@2.29.1 eslint-plugin-no-use-extend-native@0.5.0 eslint-plugin-promise@6.1.1 eslint-plugin-unicorn@52.0.0 --save-dev Install SeekingAlpha shareable ESLint: diff --git a/eslint-configs/eslint-config-seekingalpha-base/index.js b/eslint-configs/eslint-config-seekingalpha-base/index.js index 1f1e9a75..3a09bd18 100644 --- a/eslint-configs/eslint-config-seekingalpha-base/index.js +++ b/eslint-configs/eslint-config-seekingalpha-base/index.js @@ -3,9 +3,6 @@ module.exports = { // ESLint rules (https://eslint.org/docs/rules/) './rules/eslint/index.js', - // ESLint Stylistic Stylistic Formatting https://eslint.style/packages/js - './rules/eslint-plugin-stylistic-js/index.js', - // eslint-plugin-import rules (https://github.com/benmosher/eslint-plugin-import) './rules/eslint-plugin-import/index.js', diff --git a/eslint-configs/eslint-config-seekingalpha-base/package.json b/eslint-configs/eslint-config-seekingalpha-base/package.json index 6f0a82ed..55c67657 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": "7.19.0", + "version": "8.0.0", "description": "SeekingAlpha's sharable base ESLint config", "main": "index.js", "scripts": { @@ -48,7 +48,6 @@ "node": ">= 20" }, "peerDependencies": { - "@stylistic/eslint-plugin-js": "1.7.0", "eslint": "8.57.0", "eslint-plugin-array-func": "4.0.0", "eslint-plugin-import": "2.29.1", @@ -57,7 +56,6 @@ "eslint-plugin-unicorn": "52.0.0" }, "devDependencies": { - "@stylistic/eslint-plugin-js": "1.7.0", "eslint": "8.57.0", "eslint-find-rules": "4.1.0", "eslint-plugin-array-func": "4.0.0", diff --git a/eslint-configs/eslint-config-seekingalpha-base/prettier.js b/eslint-configs/eslint-config-seekingalpha-base/prettier.js index 627f180b..9a64ac23 100644 --- a/eslint-configs/eslint-config-seekingalpha-base/prettier.js +++ b/eslint-configs/eslint-config-seekingalpha-base/prettier.js @@ -2,69 +2,8 @@ module.exports = { extends: ['./index.js'], rules: { - '@stylistic/js/array-bracket-newline': 'off', - '@stylistic/js/array-bracket-spacing': 'off', - '@stylistic/js/array-element-newline': 'off', - '@stylistic/js/arrow-parens': 'off', - '@stylistic/js/arrow-spacing': 'off', - '@stylistic/js/block-spacing': 'off', - '@stylistic/js/brace-style': 'off', - '@stylistic/js/comma-dangle': 'off', - '@stylistic/js/comma-spacing': 'off', - '@stylistic/js/comma-style': 'off', - '@stylistic/js/computed-property-spacing': 'off', - '@stylistic/js/dot-location': 'off', - '@stylistic/js/eol-last': 'off', - '@stylistic/js/function-call-spacing': 'off', - '@stylistic/js/function-call-argument-newline': 'off', - '@stylistic/js/function-paren-newline': 'off', - '@stylistic/js/generator-star-spacing': 'off', - '@stylistic/js/implicit-arrow-linebreak': 'off', - '@stylistic/js/indent': 'off', - '@stylistic/js/jsx-quotes': 'off', - '@stylistic/js/key-spacing': 'off', - '@stylistic/js/keyword-spacing': 'off', - '@stylistic/js/linebreak-style': 'off', - '@stylistic/js/multiline-ternary': 'off', - '@stylistic/js/newline-per-chained-call': 'off', - '@stylistic/js/new-parens': 'off', - '@stylistic/js/no-extra-parens': 'off', - '@stylistic/js/no-extra-semi': 'off', - '@stylistic/js/no-floating-decimal': 'off', - '@stylistic/js/no-mixed-spaces-and-tabs': 'off', - '@stylistic/js/no-multi-spaces': 'off', - '@stylistic/js/no-multiple-empty-lines': 'off', - '@stylistic/js/no-trailing-spaces': 'off', - '@stylistic/js/no-whitespace-before-property': 'off', - '@stylistic/js/nonblock-statement-body-position': 'off', - '@stylistic/js/object-curly-newline': 'off', - '@stylistic/js/object-curly-spacing': 'off', - '@stylistic/js/object-property-newline': 'off', - '@stylistic/js/one-var-declaration-per-line': 'off', - '@stylistic/js/operator-linebreak': 'off', - '@stylistic/js/padded-blocks': 'off', - '@stylistic/js/quote-props': 'off', - '@stylistic/js/rest-spread-spacing': 'off', - '@stylistic/js/semi': 'off', - '@stylistic/js/semi-spacing': 'off', - '@stylistic/js/semi-style': 'off', - '@stylistic/js/space-before-blocks': 'off', - '@stylistic/js/space-before-function-paren': 'off', - '@stylistic/js/space-in-parens': 'off', - '@stylistic/js/space-infix-ops': 'off', - '@stylistic/js/space-unary-ops': 'off', - '@stylistic/js/switch-colon-spacing': 'off', - '@stylistic/js/template-curly-spacing': 'off', - '@stylistic/js/template-tag-spacing': 'off', - '@stylistic/js/wrap-iife': 'off', - '@stylistic/js/wrap-regex': 'off', - '@stylistic/js/yield-star-spacing': 'off', 'unicode-bom': 'off', - // Might be enabled - '@stylistic/js/lines-around-comment': 'off', - '@stylistic/js/no-mixed-operators': 'off', - // Unicorn 'unicorn/empty-brace-spaces': 'off', 'unicorn/no-nested-ternary': 'off', diff --git a/eslint-configs/eslint-config-seekingalpha-base/rules/eslint-plugin-stylistic-js/index.js b/eslint-configs/eslint-config-seekingalpha-base/rules/eslint-plugin-stylistic-js/index.js deleted file mode 100644 index cc6a6ce1..00000000 --- a/eslint-configs/eslint-config-seekingalpha-base/rules/eslint-plugin-stylistic-js/index.js +++ /dev/null @@ -1,530 +0,0 @@ -// https://eslint.style/packages/js - -const config = require('../config'); - -module.exports = { - plugins: ['@stylistic/js'], - - rules: { - // https://eslint.style/rules/js/array-bracket-newline - '@stylistic/js/array-bracket-newline': ['error', 'consistent'], - - // https://eslint.style/rules/js/array-bracket-spacing - '@stylistic/js/array-bracket-spacing': ['error', 'never'], - - // https://eslint.style/rules/js/array-element-newline - '@stylistic/js/array-element-newline': 'off', - - // https://eslint.style/rules/js/arrow-parens - '@stylistic/js/arrow-parens': ['error', 'always'], - - // https://eslint.style/rules/js/arrow-spacing - '@stylistic/js/arrow-spacing': [ - 'error', - { - before: true, - after: true, - }, - ], - - // https://eslint.style/rules/js/block-spacing - '@stylistic/js/block-spacing': ['error', 'always'], - - // https://eslint.style/rules/js/brace-style - '@stylistic/js/brace-style': [ - 'error', - '1tbs', - { - allowSingleLine: false, - }, - ], - - // https://eslint.style/rules/js/comma-dangle - '@stylistic/js/comma-dangle': [ - 'error', - { - arrays: 'always-multiline', - objects: 'always-multiline', - imports: 'always-multiline', - exports: 'always-multiline', - functions: 'never', - }, - ], - - // https://eslint.style/rules/js/comma-spacing - '@stylistic/js/comma-spacing': [ - 'error', - { - before: false, - after: true, - }, - ], - - // https://eslint.style/rules/js/comma-style - '@stylistic/js/comma-style': [ - 'error', - 'last', - { - exceptions: { - ArrayExpression: false, - ArrayPattern: false, - ArrowFunctionExpression: false, - CallExpression: false, - FunctionDeclaration: false, - FunctionExpression: false, - ImportDeclaration: false, - ObjectExpression: false, - ObjectPattern: false, - VariableDeclaration: false, - NewExpression: false, - }, - }, - ], - - // https://eslint.style/rules/js/computed-property-spacing - '@stylistic/js/computed-property-spacing': ['error', 'never'], - - // https://eslint.style/rules/js/dot-location - '@stylistic/js/dot-location': ['error', 'property'], - - // https://eslint.style/rules/js/eol-last - '@stylistic/js/eol-last': ['error', 'always'], - - // https://eslint.style/rules/js/function-call-spacing - '@stylistic/js/function-call-spacing': ['error', 'never'], - - /* - * TODO Enable when fixed for arrow functions - * https://eslint.style/rules/js/function-call-argument-newline - */ - '@stylistic/js/function-call-argument-newline': 'off', - - // https://eslint.style/rules/js/function-paren-newline - '@stylistic/js/function-paren-newline': ['error', 'consistent'], - - // https://eslint.style/rules/js/generator-star-spacing - '@stylistic/js/generator-star-spacing': [ - 'error', - { - before: false, - after: true, - }, - ], - - // https://eslint.style/rules/js/implicit-arrow-linebreak - '@stylistic/js/implicit-arrow-linebreak': ['error', 'beside'], - - // https://eslint.style/rules/js/indent - '@stylistic/js/indent': [ - 'error', - config.indent, - { - SwitchCase: 1, - VariableDeclarator: 1, - outerIIFEBody: 1, - MemberExpression: 0, - FunctionDeclaration: { - parameters: 1, - body: 1, - }, - FunctionExpression: { - parameters: 1, - body: 1, - }, - CallExpression: { - arguments: 1, - }, - ArrayExpression: 1, - ObjectExpression: 1, - ImportDeclaration: 1, - flatTernaryExpressions: false, - offsetTernaryExpressions: false, - ignoredNodes: [], - ignoreComments: false, - }, - ], - - // https://eslint.style/rules/js/jsx-quotes - '@stylistic/js/jsx-quotes': ['error', 'prefer-double'], - - // https://eslint.style/rules/js/key-spacing - '@stylistic/js/key-spacing': [ - 'error', - { - beforeColon: false, - afterColon: true, - mode: 'strict', - }, - ], - - // https://eslint.style/rules/js/keyword-spacing - '@stylistic/js/keyword-spacing': [ - 'error', - { - before: true, - after: true, - overrides: { - return: { - after: true, - }, - throw: { - after: true, - }, - case: { - after: true, - }, - }, - }, - ], - - // https://eslint.style/rules/js/linebreak-style - '@stylistic/js/linebreak-style': ['error', 'unix'], - - // https://eslint.style/rules/js/lines-around-comment - '@stylistic/js/lines-around-comment': [ - 'error', - { - beforeBlockComment: true, - afterBlockComment: false, - beforeLineComment: true, - afterLineComment: false, - allowBlockStart: true, - allowBlockEnd: false, - allowObjectStart: true, - allowObjectEnd: false, - allowArrayStart: false, - allowArrayEnd: false, - allowClassStart: true, - allowClassEnd: false, - applyDefaultIgnorePatterns: true, - ignorePattern: '@ts-expect-error', - }, - ], - - // https://eslint.style/rules/js/lines-between-class-members - '@stylistic/js/lines-between-class-members': [ - 'error', - 'always', - { - exceptAfterSingleLine: false, - }, - ], - - // https://eslint.style/rules/js/max-len - '@stylistic/js/max-len': [ - 'error', - { - code: config.maxLen, - tabWidth: config.indent, - comments: config.maxLen, - ignorePattern: 'ignore-long-line', - ignoreComments: false, - ignoreTrailingComments: false, - ignoreRegExpLiterals: false, - ignoreStrings: false, - ignoreTemplateLiterals: false, - ignoreUrls: true, - }, - ], - - // https://eslint.style/rules/js/max-statements-per-line - '@stylistic/js/max-statements-per-line': [ - 'error', - { - max: config.maxStatementsPerLine, - }, - ], - - // https://eslint.style/rules/js/multiline-ternary - '@stylistic/js/multiline-ternary': 'off', - - // https://eslint.style/rules/js/new-parens - '@stylistic/js/new-parens': 'error', - - // https://eslint.style/rules/js/newline-per-chained-call - '@stylistic/js/newline-per-chained-call': [ - 'error', - { - ignoreChainWithDepth: 2, - }, - ], - - // https://eslint.style/rules/js/no-confusing-arrow - '@stylistic/js/no-confusing-arrow': [ - 'error', - { - allowParens: false, - onlyOneSimpleParam: false, - }, - ], - - // https://eslint.style/rules/js/no-extra-parens - '@stylistic/js/no-extra-parens': [ - 'error', - 'all', - { - conditionalAssign: false, - nestedBinaryExpressions: false, - returnAssign: false, - ignoreJSX: 'all', - enforceForArrowConditionals: false, - enforceForSequenceExpressions: false, - enforceForNewInMemberExpressions: false, - enforceForFunctionPrototypeMethods: false, - }, - ], - - // https://eslint.style/rules/js/no-extra-semi - '@stylistic/js/no-extra-semi': 'error', - - // https://eslint.style/rules/js/no-floating-decimal - '@stylistic/js/no-floating-decimal': 'error', - - // https://eslint.style/rules/js/no-mixed-operators - '@stylistic/js/no-mixed-operators': [ - 'error', - { - groups: [ - ['+', '-', '*', '/', '%', '**'], - ['&', '|', '^', '~', '<<', '>>', '>>>'], - ['==', '!=', '===', '!==', '>', '>=', '<', '<='], - ['&&', '||'], - ['in', 'instanceof'], - ], - allowSamePrecedence: true, - }, - ], - - // https://eslint.style/rules/js/no-mixed-spaces-and-tabs - '@stylistic/js/no-mixed-spaces-and-tabs': 'error', - - // https://eslint.style/rules/js/no-multi-spaces - '@stylistic/js/no-multi-spaces': 'error', - - // https://eslint.style/rules/js/no-multiple-empty-lines - '@stylistic/js/no-multiple-empty-lines': [ - 'error', - { - max: config.noMultipleEmptyLinesMax, - maxEOF: config.noMultipleEmptyLinesEOF, - maxBOF: config.noMultipleEmptyLinesBOF, - }, - ], - - // https://eslint.style/rules/js/no-tabs - '@stylistic/js/no-tabs': 'error', - - // https://eslint.style/rules/js/no-trailing-spaces - '@stylistic/js/no-trailing-spaces': [ - 'error', - { - skipBlankLines: false, - ignoreComments: false, - }, - ], - - // https://eslint.style/rules/js/no-whitespace-before-property - '@stylistic/js/no-whitespace-before-property': 'error', - - // https://eslint.style/rules/js/nonblock-statement-body-position - '@stylistic/js/nonblock-statement-body-position': [ - 'error', - 'beside', - { - overrides: {}, - }, - ], - - // https://eslint.style/rules/js/object-curly-newline - '@stylistic/js/object-curly-newline': [ - 'error', - { - ObjectExpression: { - minProperties: config.newlineObjectExpressionMin, - multiline: true, - consistent: true, - }, - ObjectPattern: { - minProperties: config.newlineObjectPatternMin, - multiline: true, - consistent: true, - }, - ImportDeclaration: { - minProperties: config.newlineImportDeclarationMin, - multiline: true, - consistent: true, - }, - ExportDeclaration: { - minProperties: config.newlineExportDeclarationMin, - multiline: true, - consistent: true, - }, - }, - ], - - // https://eslint.style/rules/js/object-curly-spacing - '@stylistic/js/object-curly-spacing': [ - 'error', - 'always', - { - arraysInObjects: true, - objectsInObjects: true, - }, - ], - - // https://eslint.style/rules/js/object-property-newline - '@stylistic/js/object-property-newline': [ - 'error', - { - allowAllPropertiesOnSameLine: false, - }, - ], - - // https://eslint.style/rules/js/one-var-declaration-per-line - '@stylistic/js/one-var-declaration-per-line': ['error', 'initializations'], - - // https://eslint.style/rules/js/operator-linebreak - '@stylistic/js/operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }], - - // https://eslint.style/rules/js/padded-blocks - '@stylistic/js/padded-blocks': [ - 'error', - { - blocks: 'never', - classes: 'never', - switches: 'never', - }, - ], - - // https://eslint.style/rules/js/padding-line-between-statements - '@stylistic/js/padding-line-between-statements': [ - 'error', - { - blankLine: 'always', - prev: 'directive', - next: '*', - }, - { - blankLine: 'any', - prev: 'directive', - next: 'directive', - }, - { - blankLine: 'always', - prev: ['const', 'let', 'var'], - next: '*', - }, - { - blankLine: 'any', - prev: ['const', 'let', 'var'], - next: ['const', 'let', 'var'], - }, - { - blankLine: 'always', - prev: '*', - next: 'return', - }, - ], - - // https://eslint.style/rules/js/quote-props - '@stylistic/js/quote-props': [ - 'error', - 'as-needed', - { - keywords: false, - unnecessary: true, - numbers: false, - }, - ], - - // https://eslint.style/rules/js/quotes - '@stylistic/js/quotes': [ - 'error', - 'single', - { - avoidEscape: true, - allowTemplateLiterals: true, - }, - ], - - // https://eslint.style/rules/js/rest-spread-spacing - '@stylistic/js/rest-spread-spacing': ['error', 'never'], - - // https://eslint.style/rules/js/semi - '@stylistic/js/semi': ['error', 'always'], - - // https://eslint.style/rules/js/semi-spacing - '@stylistic/js/semi-spacing': [ - 'error', - { - before: false, - after: true, - }, - ], - - // https://eslint.style/rules/js/semi-style - '@stylistic/js/semi-style': ['error', 'last'], - - // https://eslint.style/rules/js/space-before-blocks - '@stylistic/js/space-before-blocks': 'error', - - // https://eslint.style/rules/js/space-before-function-paren - '@stylistic/js/space-before-function-paren': [ - 'error', - { - anonymous: 'never', - named: 'never', - asyncArrow: 'always', - }, - ], - - // https://eslint.style/rules/js/space-in-parens - '@stylistic/js/space-in-parens': ['error', 'never'], - - // https://eslint.style/rules/js/space-infix-ops - '@stylistic/js/space-infix-ops': 'error', - - // https://eslint.style/rules/js/space-unary-ops - '@stylistic/js/space-unary-ops': [ - 'error', - { - words: true, - nonwords: false, - overrides: {}, - }, - ], - - // https://eslint.style/rules/js/spaced-comment - '@stylistic/js/spaced-comment': ['error', 'always'], - - // https://eslint.style/rules/js/switch-colon-spacing - '@stylistic/js/switch-colon-spacing': [ - 'error', - { - after: true, - before: false, - }, - ], - - // https://eslint.style/rules/js/template-curly-spacing - '@stylistic/js/template-curly-spacing': 'error', - - // https://eslint.style/rules/js/template-tag-spacing - '@stylistic/js/template-tag-spacing': ['error', 'never'], - - // https://eslint.style/rules/js/wrap-iife - '@stylistic/js/wrap-iife': [ - 'error', - 'outside', - { - functionPrototypeMethods: false, - }, - ], - - // https://eslint.style/rules/js/wrap-regex - '@stylistic/js/wrap-regex': 'error', - - // https://eslint.style/rules/js/yield-star-spacing - '@stylistic/js/yield-star-spacing': ['error', 'after'], - }, -}; diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/CHANGELOG.md b/eslint-configs/eslint-config-seekingalpha-typescript/CHANGELOG.md index d17456d0..4c5b2ce1 100644 --- a/eslint-configs/eslint-config-seekingalpha-typescript/CHANGELOG.md +++ b/eslint-configs/eslint-config-seekingalpha-typescript/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 5.0.0 - 2024-04-08 + +- [breaking] remove `@stylistic/eslint-plugin-ts` +- [deps] upgrade `@typescript-eslint/eslint-plugin` to version `7.6.0` +- [deps] upgrade `@typescript-eslint/parser` to version `7.6.0` + ## 4.35.0 - 2024-04-08 - [breaking] disable `@stylistic/ts/lines-around-comment` for prettier config diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/README.md b/eslint-configs/eslint-config-seekingalpha-typescript/README.md index d2e2f0c8..d68ec129 100644 --- a/eslint-configs/eslint-config-seekingalpha-typescript/README.md +++ b/eslint-configs/eslint-config-seekingalpha-typescript/README.md @@ -6,7 +6,7 @@ This package includes the shareable ESLint config used by [SeekingAlpha](https:/ Install ESLint and all [Peer Dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/): - npm install eslint@8.57.0 @typescript-eslint/eslint-plugin@7.5.0 @typescript-eslint/parser@7.5.0 @stylistic/eslint-plugin-ts@1.7.0 --save-dev + npm install eslint@8.57.0 @typescript-eslint/eslint-plugin@7.6.0 @typescript-eslint/parser@7.6.0 --save-dev Install SeekingAlpha shareable ESLint: diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/index.js b/eslint-configs/eslint-config-seekingalpha-typescript/index.js index 5e928e14..1f17be9e 100644 --- a/eslint-configs/eslint-config-seekingalpha-typescript/index.js +++ b/eslint-configs/eslint-config-seekingalpha-typescript/index.js @@ -4,9 +4,6 @@ module.exports = { // https://github.com/typescript-eslint/typescript-eslint './rules/typescript-eslint/index.js', - - // https://eslint.style/packages/ts - './rules/eslint-plugin-stylistic-ts/index.js', ], parserOptions: { diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/package.json b/eslint-configs/eslint-config-seekingalpha-typescript/package.json index 603739ad..31fd784a 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": "4.35.0", + "version": "5.0.0", "description": "SeekingAlpha's sharable typescript ESLint config", "main": "index.js", "scripts": { @@ -37,15 +37,13 @@ "node": ">= 20" }, "peerDependencies": { - "@stylistic/eslint-plugin-ts": "1.7.0", - "@typescript-eslint/eslint-plugin": "7.5.0", - "@typescript-eslint/parser": "7.5.0", + "@typescript-eslint/eslint-plugin": "7.6.0", + "@typescript-eslint/parser": "7.6.0", "eslint": "8.57.0" }, "devDependencies": { - "@stylistic/eslint-plugin-ts": "1.7.0", - "@typescript-eslint/eslint-plugin": "7.5.0", - "@typescript-eslint/parser": "7.5.0", + "@typescript-eslint/eslint-plugin": "7.6.0", + "@typescript-eslint/parser": "7.6.0", "eslint": "8.57.0", "eslint-find-rules": "4.1.0" } diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/prettier.js b/eslint-configs/eslint-config-seekingalpha-typescript/prettier.js deleted file mode 100644 index 4abff0bb..00000000 --- a/eslint-configs/eslint-config-seekingalpha-typescript/prettier.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports = { - extends: ['./index.js'], - - rules: { - '@stylistic/ts/block-spacing': 'off', - '@stylistic/ts/brace-style': 'off', - '@stylistic/ts/comma-dangle': 'off', - '@stylistic/ts/comma-spacing': 'off', - '@stylistic/ts/function-call-spacing': 'off', - '@stylistic/ts/indent': 'off', - '@stylistic/ts/lines-around-comment': 'off', - '@stylistic/ts/key-spacing': 'off', - '@stylistic/ts/keyword-spacing': 'off', - '@stylistic/ts/member-delimiter-style': 'off', - '@stylistic/ts/no-extra-parens': 'off', - '@stylistic/ts/no-extra-semi': 'off', - '@stylistic/ts/object-curly-spacing': 'off', - '@stylistic/ts/semi': 'off', - '@stylistic/ts/space-before-blocks': 'off', - '@stylistic/ts/space-before-function-paren': 'off', - '@stylistic/ts/space-infix-ops': 'off', - '@stylistic/ts/type-annotation-spacing': 'off', - }, -}; diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/rules/disable-recommended-eslint-rules/index.js b/eslint-configs/eslint-config-seekingalpha-typescript/rules/disable-recommended-eslint-rules/index.js index c595becd..33e6c56a 100644 --- a/eslint-configs/eslint-config-seekingalpha-typescript/rules/disable-recommended-eslint-rules/index.js +++ b/eslint-configs/eslint-config-seekingalpha-typescript/rules/disable-recommended-eslint-rules/index.js @@ -6,14 +6,6 @@ module.exports = { */ 'no-undef': 'off', - '@stylistic/js/block-spacing': 'off', - - '@stylistic/js/brace-style': 'off', - - '@stylistic/js/comma-dangle': 'off', - - '@stylistic/js/comma-spacing': 'off', - 'class-methods-use-this': 'off', 'default-param-last': 'off', @@ -23,26 +15,14 @@ module.exports = { * 'dot-notation': 'off', */ - '@stylistic/js/function-call-spacing': 'off', - - '@stylistic/js/indent': 'off', - 'init-declarations': 'off', - '@stylistic/js/keyword-spacing': 'off', - - '@stylistic/js/lines-around-comment': 'off', - - '@stylistic/js/lines-between-class-members': 'off', - 'no-array-constructor': 'off', 'no-dupe-class-members': 'off', 'no-empty-function': 'off', - '@stylistic/js/no-extra-semi': 'off', - /* * Requires TS * 'no-implied-eval': 'off', @@ -68,34 +48,16 @@ module.exports = { 'no-useless-constructor': 'off', - '@stylistic/js/object-curly-spacing': 'off', - - '@stylistic/js/padding-line-between-statements': 'off', - /* * Requires TS * 'prefer-destructuring': 'off', */ - '@stylistic/js/quotes': 'off', - /* * Requires TS * 'require-await': 'off', */ - '@stylistic/js/semi': 'off', - - '@stylistic/js/space-before-blocks': 'off', - - '@stylistic/js/space-before-function-paren': 'off', - - '@stylistic/js/space-infix-ops': 'off', - - '@stylistic/js/no-extra-parens': 'off', - 'no-invalid-this': 'off', - - '@stylistic/js/key-spacing': 'off', }, }; diff --git a/eslint-configs/eslint-config-seekingalpha-typescript/rules/eslint-plugin-stylistic-ts/index.js b/eslint-configs/eslint-config-seekingalpha-typescript/rules/eslint-plugin-stylistic-ts/index.js deleted file mode 100644 index 56158b83..00000000 --- a/eslint-configs/eslint-config-seekingalpha-typescript/rules/eslint-plugin-stylistic-ts/index.js +++ /dev/null @@ -1,258 +0,0 @@ -// https://eslint.style/packages/ts - -const config = require('../config'); - -module.exports = { - plugins: ['@stylistic/ts'], - - rules: { - // https://eslint.style/rules/ts/block-spacing - '@stylistic/ts/block-spacing': ['error', 'always'], - - // https://eslint.style/rules/ts/brace-style - '@stylistic/ts/brace-style': [ - 'error', - '1tbs', - { - allowSingleLine: false, - }, - ], - - // https://eslint.style/rules/ts/comma-dangle - '@stylistic/ts/comma-dangle': [ - 'error', - { - arrays: 'always-multiline', - objects: 'always-multiline', - imports: 'always-multiline', - exports: 'always-multiline', - functions: 'never', - }, - ], - - // https://eslint.style/rules/ts/comma-spacing - '@stylistic/ts/comma-spacing': [ - 'error', - { - before: false, - after: true, - }, - ], - - // https://eslint.style/rules/ts/function-call-spacing - '@stylistic/ts/function-call-spacing': ['error', 'never'], - - // https://eslint.style/rules/ts/indent - '@stylistic/ts/indent': [ - 'error', - config.indent, - { - SwitchCase: 1, - VariableDeclarator: 1, - outerIIFEBody: 1, - MemberExpression: 0, - FunctionDeclaration: { - parameters: 1, - body: 1, - }, - FunctionExpression: { - parameters: 1, - body: 1, - }, - CallExpression: { - arguments: 1, - }, - ArrayExpression: 1, - ObjectExpression: 1, - ImportDeclaration: 1, - flatTernaryExpressions: false, - offsetTernaryExpressions: false, - ignoredNodes: [], - ignoreComments: false, - }, - ], - - // https://eslint.style/rules/ts/key-spacing - '@stylistic/ts/key-spacing': [ - 'error', - { - beforeColon: false, - afterColon: true, - mode: 'strict', - }, - ], - - // https://eslint.style/rules/ts/keyword-spacing - '@stylistic/ts/keyword-spacing': [ - 'error', - { - before: true, - after: true, - overrides: { - return: { - after: true, - }, - throw: { - after: true, - }, - case: { - after: true, - }, - }, - }, - ], - - // https://eslint.style/rules/ts/lines-around-comment - '@stylistic/ts/lines-around-comment': [ - 'error', - { - beforeBlockComment: true, - afterBlockComment: false, - beforeLineComment: true, - afterLineComment: false, - allowBlockStart: true, - allowBlockEnd: false, - allowObjectStart: true, - allowObjectEnd: false, - allowArrayStart: false, - allowArrayEnd: false, - allowClassStart: true, - allowClassEnd: false, - applyDefaultIgnorePatterns: true, - ignorePattern: '@ts-expect-error', - - // typescript extension - allowEnumEnd: true, - allowEnumStart: true, - allowInterfaceEnd: true, - allowInterfaceStart: true, - allowModuleEnd: true, - allowModuleStart: true, - allowTypeEnd: true, - allowTypeStart: true, - }, - ], - - // https://eslint.style/rules/ts/lines-between-class-members - '@stylistic/ts/lines-between-class-members': [ - 'error', - 'always', - { - exceptAfterSingleLine: false, - }, - ], - - // https://eslint.style/rules/ts/member-delimiter-style - '@stylistic/ts/member-delimiter-style': [ - 'error', - { - multiline: { - delimiter: 'comma', - requireLast: true, - }, - singleline: { - delimiter: 'comma', - requireLast: false, - }, - multilineDetection: 'brackets', - }, - ], - - // https://eslint.style/rules/ts/no-extra-parens - '@stylistic/ts/no-extra-parens': [ - 'error', - 'all', - { - conditionalAssign: false, - nestedBinaryExpressions: false, - returnAssign: false, - ignoreJSX: 'all', - enforceForArrowConditionals: false, - enforceForSequenceExpressions: false, - enforceForNewInMemberExpressions: false, - enforceForFunctionPrototypeMethods: false, - }, - ], - - // https://eslint.style/rules/ts/no-extra-semi - '@stylistic/ts/no-extra-semi': 'error', - - // https://eslint.style/rules/ts/object-curly-spacing - '@stylistic/ts/object-curly-spacing': [ - 'error', - 'always', - { - arraysInObjects: true, - objectsInObjects: true, - }, - ], - - // https://eslint.style/rules/ts/padding-line-between-statements - '@stylistic/ts/padding-line-between-statements': [ - 'error', - - // following 2 lines are replacement for deprecated lines-around-directive https://eslint.org/docs/rules/lines-around-directive - { - blankLine: 'always', - prev: 'directive', - next: '*', - }, - { - blankLine: 'any', - prev: 'directive', - next: 'directive', - }, - - // following 2 lines are replacement for deprecated newline-after-var https://eslint.org/docs/rules/newline-after-var - { - blankLine: 'always', - prev: ['const', 'let', 'var'], - next: '*', - }, - { - blankLine: 'any', - prev: ['const', 'let', 'var'], - next: ['const', 'let', 'var'], - }, - - // following line are replacement for deprecated newline-before-return https://eslint.org/docs/rules/newline-before-return - { - blankLine: 'always', - prev: '*', - next: 'return', - }, - ], - - // https://eslint.style/rules/ts/quotes - '@stylistic/ts/quotes': [ - 'error', - 'single', - { - avoidEscape: true, - allowTemplateLiterals: true, - }, - ], - - // https://eslint.style/rules/ts/semi - '@stylistic/ts/semi': ['error', 'always'], - - // https://eslint.style/rules/ts/space-before-blocks - '@stylistic/ts/space-before-blocks': 'error', - - // https://eslint.style/rules/ts/space-before-function-paren - '@stylistic/ts/space-before-function-paren': [ - 'error', - { - anonymous: 'never', - named: 'never', - asyncArrow: 'always', - }, - ], - - // https://eslint.style/rules/ts/space-infix-ops - '@stylistic/ts/space-infix-ops': 'error', - - // https://eslint.style/rules/ts/type-annotation-spacing - '@stylistic/ts/type-annotation-spacing': 'error', - }, -}; diff --git a/package.json b/package.json index d0801a67..3b846d8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seekingalpha-javascript-style", - "version": "5.38.11", + "version": "5.38.12", "description": "Set of linting rules, guides and best practices for best Javascript code", "main": "index.js", "type": "module", @@ -46,7 +46,6 @@ }, "devDependencies": { "@seekingalpha/prettier-config-samw": "1.2.0", - "@stylistic/eslint-plugin-js": "1.6.2", "eslint": "8.57.0", "eslint-config-seekingalpha-base": "7.16.0", "eslint-config-seekingalpha-node": "5.54.0",