pokerogue/eslint.config.js

46 lines
3.0 KiB
JavaScript
Raw Permalink Normal View History

2024-05-24 15:37:42 +01:00
import tseslint from '@typescript-eslint/eslint-plugin';
[Dependencies] Update to resolve install warnings (after beta rebase) (#3213) * bump up `vitest` and `eslint` version to resolve inflight warning... - remove and disable `eslint-plugin-import` due to not supporting `eslint@9` yet (can be reactivated later) - bump `eslint` to `9.7.0`. - bump `@typescript-eslint/eslint-plugin` to `8.0.0-alpha.54` - update `@typescript-eslint/parser` to `8.0.0-alpha.54` - update `typescript-eslint` to `8.0.0-alpha.54` - update `vitest` to `2.0.4` - update `@vitest/coverage-istanbul` to `2.0.4` * remove `vite-plugin-fs` dependency... - removed `api-generatort-script.ts` file (this was in consultations with devs https://discord.com/channels/1125469663833370665/1250836282926436413/1266469312609259550) * bump `vite` to version 5 * fix pokemonSprite.test.ts to run locally It should ignore hidden (starting with `.`) files! * 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` * delete `pokenode-ts` dependency * remove `phaser3spectorjs` It's a WebGL debugging tool but I've never seen anyone using it * remove `axios` and `axios-cache-interceptor` dependency They are unused * remove unused `json-beautify` dependency * move `dependency-cruiser` to dev dependencies * Revert "remove `phaser3spectorjs`" This reverts commit 725e6815386be5e39455b41d53f165ad5320173a. * fix pokemonSprite.test.ts (invert condition) whops.. * move `@hpcc-js/wasm` to devDependencies See #2275 * move `@types/jsdom` to devDependencies See #2275 * update package-lock.json
2024-07-30 05:29:34 +01:00
import stylisticTs from '@stylistic/eslint-plugin-ts'
2024-05-24 15:37:42 +01:00
import parser from '@typescript-eslint/parser';
[Dependencies] Update to resolve install warnings (after beta rebase) (#3213) * bump up `vitest` and `eslint` version to resolve inflight warning... - remove and disable `eslint-plugin-import` due to not supporting `eslint@9` yet (can be reactivated later) - bump `eslint` to `9.7.0`. - bump `@typescript-eslint/eslint-plugin` to `8.0.0-alpha.54` - update `@typescript-eslint/parser` to `8.0.0-alpha.54` - update `typescript-eslint` to `8.0.0-alpha.54` - update `vitest` to `2.0.4` - update `@vitest/coverage-istanbul` to `2.0.4` * remove `vite-plugin-fs` dependency... - removed `api-generatort-script.ts` file (this was in consultations with devs https://discord.com/channels/1125469663833370665/1250836282926436413/1266469312609259550) * bump `vite` to version 5 * fix pokemonSprite.test.ts to run locally It should ignore hidden (starting with `.`) files! * 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` * delete `pokenode-ts` dependency * remove `phaser3spectorjs` It's a WebGL debugging tool but I've never seen anyone using it * remove `axios` and `axios-cache-interceptor` dependency They are unused * remove unused `json-beautify` dependency * move `dependency-cruiser` to dev dependencies * Revert "remove `phaser3spectorjs`" This reverts commit 725e6815386be5e39455b41d53f165ad5320173a. * fix pokemonSprite.test.ts (invert condition) whops.. * move `@hpcc-js/wasm` to devDependencies See #2275 * move `@types/jsdom` to devDependencies See #2275 * update package-lock.json
2024-07-30 05:29:34 +01:00
// import imports from 'eslint-plugin-import'; // Disabled due to not being compatible with eslint v9
2024-05-24 15:37:42 +01:00
export default [
{
files: ["src/**/*.{ts,tsx,js,jsx}"],
ignores: ["dist/*", "build/*", "coverage/*", "public/*", ".github/*", "node_modules/*", ".vscode/*"],
languageOptions: {
parser: parser
},
plugins: {
[Dependencies] Update to resolve install warnings (after beta rebase) (#3213) * bump up `vitest` and `eslint` version to resolve inflight warning... - remove and disable `eslint-plugin-import` due to not supporting `eslint@9` yet (can be reactivated later) - bump `eslint` to `9.7.0`. - bump `@typescript-eslint/eslint-plugin` to `8.0.0-alpha.54` - update `@typescript-eslint/parser` to `8.0.0-alpha.54` - update `typescript-eslint` to `8.0.0-alpha.54` - update `vitest` to `2.0.4` - update `@vitest/coverage-istanbul` to `2.0.4` * remove `vite-plugin-fs` dependency... - removed `api-generatort-script.ts` file (this was in consultations with devs https://discord.com/channels/1125469663833370665/1250836282926436413/1266469312609259550) * bump `vite` to version 5 * fix pokemonSprite.test.ts to run locally It should ignore hidden (starting with `.`) files! * 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` * delete `pokenode-ts` dependency * remove `phaser3spectorjs` It's a WebGL debugging tool but I've never seen anyone using it * remove `axios` and `axios-cache-interceptor` dependency They are unused * remove unused `json-beautify` dependency * move `dependency-cruiser` to dev dependencies * Revert "remove `phaser3spectorjs`" This reverts commit 725e6815386be5e39455b41d53f165ad5320173a. * fix pokemonSprite.test.ts (invert condition) whops.. * move `@hpcc-js/wasm` to devDependencies See #2275 * move `@types/jsdom` to devDependencies See #2275 * update package-lock.json
2024-07-30 05:29:34 +01:00
// imports: imports.configs.recommended // Disabled due to not being compatible with eslint v9
'@stylistic/ts': stylisticTs,
2024-05-24 15:37:42 +01:00
'@typescript-eslint': tseslint
},
rules: {
"eqeqeq": ["error", "always"], // Enforces the use of === and !== instead of == and !=
"indent": ["error", 2], // Enforces a 2-space indentation
"quotes": ["error", "double"], // Enforces the use of double quotes for strings
"no-var": "error", // Disallows the use of var, enforcing let or const instead
"prefer-const": "error", // Prefers the use of const for variables that are never reassigned
"no-undef": "off", // Disables the rule that disallows the use of undeclared variables (TypeScript handles this)
"@typescript-eslint/no-unused-vars": [ "error", {
"args": "none", // Allows unused function parameters. Useful for functions with specific signatures where not all parameters are always used.
"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
[Dependencies] Update to resolve install warnings (after beta rebase) (#3213) * bump up `vitest` and `eslint` version to resolve inflight warning... - remove and disable `eslint-plugin-import` due to not supporting `eslint@9` yet (can be reactivated later) - bump `eslint` to `9.7.0`. - bump `@typescript-eslint/eslint-plugin` to `8.0.0-alpha.54` - update `@typescript-eslint/parser` to `8.0.0-alpha.54` - update `typescript-eslint` to `8.0.0-alpha.54` - update `vitest` to `2.0.4` - update `@vitest/coverage-istanbul` to `2.0.4` * remove `vite-plugin-fs` dependency... - removed `api-generatort-script.ts` file (this was in consultations with devs https://discord.com/channels/1125469663833370665/1250836282926436413/1266469312609259550) * bump `vite` to version 5 * fix pokemonSprite.test.ts to run locally It should ignore hidden (starting with `.`) files! * 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` * delete `pokenode-ts` dependency * remove `phaser3spectorjs` It's a WebGL debugging tool but I've never seen anyone using it * remove `axios` and `axios-cache-interceptor` dependency They are unused * remove unused `json-beautify` dependency * move `dependency-cruiser` to dev dependencies * Revert "remove `phaser3spectorjs`" This reverts commit 725e6815386be5e39455b41d53f165ad5320173a. * fix pokemonSprite.test.ts (invert condition) whops.. * move `@hpcc-js/wasm` to devDependencies See #2275 * move `@types/jsdom` to devDependencies See #2275 * update package-lock.json
2024-07-30 05:29:34 +01:00
"@stylistic/ts/semi": ["error", "always"], // Requires semicolons for TypeScript-specific syntax
2024-05-24 15:37:42 +01:00
"semi": "off", // Disables the general semi rule for TypeScript files
"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
"curly": ["error", "all"], // Enforces the use of curly braces for all control statements
[Dependencies] Update to resolve install warnings (after beta rebase) (#3213) * bump up `vitest` and `eslint` version to resolve inflight warning... - remove and disable `eslint-plugin-import` due to not supporting `eslint@9` yet (can be reactivated later) - bump `eslint` to `9.7.0`. - bump `@typescript-eslint/eslint-plugin` to `8.0.0-alpha.54` - update `@typescript-eslint/parser` to `8.0.0-alpha.54` - update `typescript-eslint` to `8.0.0-alpha.54` - update `vitest` to `2.0.4` - update `@vitest/coverage-istanbul` to `2.0.4` * remove `vite-plugin-fs` dependency... - removed `api-generatort-script.ts` file (this was in consultations with devs https://discord.com/channels/1125469663833370665/1250836282926436413/1266469312609259550) * bump `vite` to version 5 * fix pokemonSprite.test.ts to run locally It should ignore hidden (starting with `.`) files! * 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` * delete `pokenode-ts` dependency * remove `phaser3spectorjs` It's a WebGL debugging tool but I've never seen anyone using it * remove `axios` and `axios-cache-interceptor` dependency They are unused * remove unused `json-beautify` dependency * move `dependency-cruiser` to dev dependencies * Revert "remove `phaser3spectorjs`" This reverts commit 725e6815386be5e39455b41d53f165ad5320173a. * fix pokemonSprite.test.ts (invert condition) whops.. * move `@hpcc-js/wasm` to devDependencies See #2275 * move `@types/jsdom` to devDependencies See #2275 * update package-lock.json
2024-07-30 05:29:34 +01:00
"@stylistic/ts/brace-style": ["error", "1tbs"],
2024-05-24 15:37:42 +01:00
"no-trailing-spaces": ["error", { // Disallows trailing whitespace at the end of lines
"skipBlankLines": false, // Enforces the rule even on blank lines
"ignoreComments": false // Enforces the rule on lines containing comments
}],
"space-before-blocks": ["error", "always"], // Enforces a space before blocks
"keyword-spacing": ["error", { "before": true, "after": true }], // Enforces spacing before and after keywords
"comma-spacing": ["error", { "before": false, "after": true }] // Enforces spacing after comma
2024-05-24 15:37:42 +01:00
}
}
2024-05-24 15:41:46 +01:00
]