feat(eslint): add eslint flat config

This commit is contained in:
Shintaro Jokagi 2025-05-28 13:38:11 +12:00
parent 1937be58a6
commit 01f4dac75d
No known key found for this signature in database
GPG key ID: 0DDF8FA44C9A0DA8
16 changed files with 4607 additions and 2125 deletions

35
.eslint/javascript.ts Normal file
View file

@ -0,0 +1,35 @@
import type { Linter } from "eslint";
import { javascriptFiles } from "./shared";
export const javascriptConfig: Linter.Config = {
name: "eslint/javascript",
files: javascriptFiles,
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"no-console": ["warn", { allow: ["warn", "error"] }],
"no-debugger": "error",
"prefer-const": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-template": "error",
curly: ["error", "all"],
eqeqeq: ["error", "always"],
"no-implicit-coercion": "error",
},
};