pokerogue/eslint.config.js
Bertie690 43d73b01b1
[Code] Added and enforced no-fallthrough + added eslint type checking (#5705)
* Added and enforced `no-fallthrough`

* Fixed errors

* Fix package.json

* Moved vule to biom

* Fixed stuff

* Added workspace files to .gitignore for anyone who wants to do this stuff

* reverted accidental gitignore changes

* Update biome.jsonc

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>

* Update biome.jsonc

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>

* Update pokemon-species.ts

* Update biome.jsonc to apply reviews

* Fixed package.json

* Fix typo

---------

Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-04-29 23:21:28 +00:00

44 lines
1.6 KiB
JavaScript

/** @ts-check */
import tseslint from "typescript-eslint";
import stylisticTs from "@stylistic/eslint-plugin-ts";
import parser from "@typescript-eslint/parser";
import importX from "eslint-plugin-import-x";
export default tseslint.config(
{
name: "eslint-config",
files: ["src/**/*.{ts,tsx,js,jsx}", "test/**/*.{ts,tsx,js,jsx}"],
ignores: ["dist/*", "build/*", "coverage/*", "public/*", ".github/*", "node_modules/*", ".vscode/*"],
languageOptions: {
parser: parser,
},
plugins: {
"import-x": importX,
"@stylistic/ts": stylisticTs,
"@typescript-eslint": tseslint.plugin,
},
rules: {
"no-undef": "off", // Disables the rule that disallows the use of undeclared variables (TypeScript handles this)
"no-extra-semi": "error", // Disallows unnecessary semicolons for TypeScript-specific syntax
"import-x/extensions": ["error", "never", { json: "always" }], // Enforces no extension for imports unless json
},
},
{
name: "eslint-tests",
files: ["test/**/**.test.ts"],
languageOptions: {
parser: parser,
parserOptions: {
project: ["./tsconfig.json"],
},
},
plugins: {
"@typescript-eslint": tseslint.plugin,
},
rules: {
"@typescript-eslint/no-floating-promises": "error", // Require Promise-like statements to be handled appropriately. - https://typescript-eslint.io/rules/no-floating-promises/
"@typescript-eslint/no-misused-promises": "error", // Disallow Promises in places not designed to handle them. - https://typescript-eslint.io/rules/no-misused-promises/
},
},
);