diff --git a/etc/eslint/plugins/index.js b/etc/eslint/plugins/index.js index c01b8199234c..a64d6d7a4d79 100644 --- a/etc/eslint/plugins/index.js +++ b/etc/eslint/plugins/index.js @@ -20,6 +20,7 @@ // ESLint plugins: var plugins = [ + '@stylistic/ts', 'jsdoc', 'n', 'stdlib', diff --git a/etc/eslint/rules/typescript.js b/etc/eslint/rules/typescript.js index d0909e83531a..8e43ad673360 100644 --- a/etc/eslint/rules/typescript.js +++ b/etc/eslint/rules/typescript.js @@ -137,7 +137,7 @@ rules[ '@typescript-eslint/ban-ts-comment' ] = 'off'; * type foo = {}; * type bar = object; */ -rules[ '@typescript-eslint/ban-types' ] = 'off'; +rules[ '@typescript-eslint/no-restricted-types' ] = 'off'; /** * Enforces the use of consistent type assertions. @@ -286,7 +286,7 @@ rules[ '@typescript-eslint/explicit-module-boundary-types' ] = 'error'; * return true; * } */ -rules[ '@typescript-eslint/indent' ] = [ 'error', 'tab' ]; +rules[ '@stylistic/ts/indent' ] = [ 'error', 'tab' ]; /** * Enforces a specific member delimiter style in interfaces and type literals. @@ -310,7 +310,7 @@ rules[ '@typescript-eslint/indent' ] = [ 'error', 'tab' ]; * age: number; * } */ -rules[ '@typescript-eslint/member-delimiter-style' ] = [ +rules[ '@stylistic/ts/member-delimiter-style' ] = [ 'error', { 'multiline': { @@ -882,7 +882,7 @@ rules[ '@typescript-eslint/promise-function-async' ] = 'off'; * const good = 'good'; * const goodEscape = "good's"; */ -rules[ '@typescript-eslint/quotes' ] = [ +rules[ '@stylistic/ts/quotes' ] = [ 'error', 'single', { @@ -946,7 +946,7 @@ rules[ '@typescript-eslint/restrict-plus-operands' ] = 'error'; * // Good... * const good = 'semi'; */ -rules[ '@typescript-eslint/semi' ] = [ 'error', 'always' ]; +rules[ '@stylistic/ts/semi' ] = [ 'error', 'always' ]; /** * Disables the rule for strict boolean expressions. @@ -1004,7 +1004,7 @@ rules[ '@typescript-eslint/triple-slash-reference' ] = [ * // Good... * let good: number; */ -rules[ '@typescript-eslint/type-annotation-spacing' ] = 'error'; +rules[ '@stylistic/ts/type-annotation-spacing' ] = 'error'; /** * Requires type annotations to exist. @@ -2611,13 +2611,13 @@ rules[ 'radix' ] = 'error'; /** * Enforces consistent spacing before function parentheses. * -* @name @typescript-eslint/space-before-function-paren +* @name @stylistic/ts/space-before-function-paren * @memberof rules * @type {Array} * @default [ 'error', { 'anonymous': 'always', 'named': 'never', 'asyncArrow': 'always' } ] * @see [space-before-function-paren]{@link https://typescript-eslint.io/rules/space-before-function-paren} */ -rules[ '@typescript-eslint/space-before-function-paren' ] = [ +rules[ '@stylistic/ts/space-before-function-paren' ] = [ 'error', { 'anonymous': 'always', diff --git a/package.json b/package.json index 87cbfab4b8c6..35dfeafe6c9d 100644 --- a/package.json +++ b/package.json @@ -124,8 +124,8 @@ "@conventional-commits/parser": "^0.4.1", "@kaciras/deasync": "^1.0.1", "@types/node": "^13.9.0", - "@typescript-eslint/parser": "^6.9.1", - "@typescript-eslint/eslint-plugin": "^6.9.1", + "@typescript-eslint/parser": "^8.57.0", + "@typescript-eslint/eslint-plugin": "^8.57.0", "ajv": "^5.2.2", "browser-pack-flat": "^3.0.0", "browserify": "^17.0.0", @@ -139,6 +139,7 @@ "doctrine": "^3.0.0", "editorconfig-checker": "^6.0.0", "envify": "^4.0.0", + "@stylistic/eslint-plugin-ts": "^2.13.0", "eslint": "^8.57.0", "eslint-plugin-n": "^17.17.0", "eslint-plugin-expect-type": "^0.2.3", @@ -247,7 +248,7 @@ "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "to-vfile": "^6.0.0", "typedoc": "git+https://github.com/kgryte/typedoc.git#0.16.11-patch", - "typescript": "4.3.5", + "typescript": "4.9.5", "uglify-js": "^3.17.4", "uglifyify": "^5.0.0", "unified-lint-rule": "^1.0.1",