Skip to content

Commit

Permalink
Migrate to ESLint to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
sirDonovan committed Dec 15, 2024
1 parent 6846f8e commit d9095cf
Show file tree
Hide file tree
Showing 162 changed files with 1,974 additions and 1,524 deletions.
17 changes: 0 additions & 17 deletions .eslintignore

This file was deleted.

93 changes: 0 additions & 93 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
node-version: [20.x, 22.x]
node-version: [22.x, 23.x]

runs-on: ${{ matrix.platform }}

Expand Down
4 changes: 2 additions & 2 deletions build-src.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const removeFromPackageJson = [
// devDependencies
"@types/better-sqlite3", "@types/cloud-env", "@types/node", "@types/node-static", "@types/nodemailer", "@types/pg", "@types/sockjs",
"@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", "eslint", "eslint-plugin-import", "husky", "mocha", "smogon",
"typescript",
"typescript", "typescript-eslint",
];
const overrideVersions: Dict<string> = {
"esbuild": "0.23.0",
"esbuild": "0.24.0",
};

function getPokemonShowdownFolder(): string {
Expand Down
67 changes: 67 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config({
extends: [
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
],
files: [
"**/*.ts",
"**/*.tsx"
],
rules: {
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-deprecated": "off",
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
"@typescript-eslint/no-unnecessary-type-parameters": "off",
"@typescript-eslint/prefer-string-starts-ends-with": "off",
"@typescript-eslint/prefer-regexp-exec": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/ban-ts-comment": ['error', {
'ts-check': true,
'ts-expect-error': false,
'ts-ignore': true,
'ts-nocheck': true,
}],
"@typescript-eslint/no-require-imports": ['error', {
allowAsImport: true
}]
}
}, {
ignores: [
".github/*",
".vscode/*",
"archived-databases/*",
"build/*",
"client-data/*",
"data/*",
"databases/*",
"errors/*",
"game-debug-logs/*",
"Lanette-private/*",
"local-utils/*",
"pokemon-showdown/*",
"private-data/*",
"roomlogs/*",
"runtime-output/*",
"src/config.ts",
"src/local-scripts/*",
"web/*",
]
});
1 change: 1 addition & 0 deletions local-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = (async() => {
await initializeSrc();

const localScriptPath = path.join(getInputFolders().src.buildPath, "local-scripts", options.script + ".js");
// eslint-disable-next-line @typescript-eslint/no-require-imports
require(localScriptPath);
})().catch((error) => {
console.error(error);
Expand Down
Loading

0 comments on commit d9095cf

Please sign in to comment.