migrate some typescript-eslint to @stylistic/eslint-plugin-ts

as stated here: https://typescript-eslint.io/blog/deprecating-formatting-rules#upgrading-to-eslint-stylistic

- fix eslint complaints inside `i18next.d.ts`
This commit is contained in:
Felix Staud 2024-07-26 13:02:26 -07:00
parent 04c8f27f60
commit 71403cecae
4 changed files with 1012 additions and 931 deletions

View File

@ -1,4 +1,5 @@
import tseslint from '@typescript-eslint/eslint-plugin'; import tseslint from '@typescript-eslint/eslint-plugin';
import stylisticTs from '@stylistic/eslint-plugin-ts'
import parser from '@typescript-eslint/parser'; import parser from '@typescript-eslint/parser';
// import imports from 'eslint-plugin-import'; // Disabled due to not being compatible with eslint v9 // import imports from 'eslint-plugin-import'; // Disabled due to not being compatible with eslint v9
@ -11,6 +12,7 @@ export default [
}, },
plugins: { plugins: {
// imports: imports.configs.recommended // Disabled due to not being compatible with eslint v9 // imports: imports.configs.recommended // Disabled due to not being compatible with eslint v9
'@stylistic/ts': stylisticTs,
'@typescript-eslint': tseslint '@typescript-eslint': tseslint
}, },
rules: { rules: {
@ -25,12 +27,12 @@ export default [
"ignoreRestSiblings": true // Allows unused variables that are part of a rest property in object destructuring. Useful for excluding certain properties from an object while using the rest. "ignoreRestSiblings": true // Allows unused variables that are part of a rest property in object destructuring. Useful for excluding certain properties from an object while using the rest.
}], }],
"eol-last": ["error", "always"], // Enforces at least one newline at the end of files "eol-last": ["error", "always"], // Enforces at least one newline at the end of files
"@typescript-eslint/semi": ["error", "always"], // Requires semicolons for TypeScript-specific syntax "@stylistic/ts/semi": ["error", "always"], // Requires semicolons for TypeScript-specific syntax
"semi": "off", // Disables the general semi rule for TypeScript files "semi": "off", // Disables the general semi rule for TypeScript files
"no-extra-semi": ["error"], // Disallows unnecessary semicolons for TypeScript-specific syntax "no-extra-semi": ["error"], // Disallows unnecessary semicolons for TypeScript-specific syntax
"brace-style": "off", // Note: you must disable the base rule as it can report incorrect errors "brace-style": "off", // Note: you must disable the base rule as it can report incorrect errors
"curly": ["error", "all"], // Enforces the use of curly braces for all control statements "curly": ["error", "all"], // Enforces the use of curly braces for all control statements
"@typescript-eslint/brace-style": ["error", "1tbs"], "@stylistic/ts/brace-style": ["error", "1tbs"],
"no-trailing-spaces": ["error", { // Disallows trailing whitespace at the end of lines "no-trailing-spaces": ["error", { // Disallows trailing whitespace at the end of lines
"skipBlankLines": false, // Enforces the rule even on blank lines "skipBlankLines": false, // Enforces the rule even on blank lines
"ignoreComments": false // Enforces the rule on lines containing comments "ignoreComments": false // Enforces the rule on lines containing comments

1934
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,7 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.3.0", "@eslint/js": "^9.3.0",
"@stylistic/eslint-plugin-ts": "^2.6.0-beta.0",
"@types/node": "^20.12.13", "@types/node": "^20.12.13",
"@typescript-eslint/eslint-plugin": "^8.0.0-alpha.54", "@typescript-eslint/eslint-plugin": "^8.0.0-alpha.54",
"@typescript-eslint/parser": "^8.0.0-alpha.54", "@typescript-eslint/parser": "^8.0.0-alpha.54",

View File

@ -1,4 +1,4 @@
import { enConfig } from "#app/locales/en/config.js"; import { type enConfig } from "#app/locales/en/config.js";
// Module declared to make referencing keys in the localization files type-safe. // Module declared to make referencing keys in the localization files type-safe.
declare module "i18next" { declare module "i18next" {