mirror of
https://github.com/doukutsu-rs/doukutsu-rs.github.io.git
synced 2026-08-24 13:04:48 -07:00
81 lines
2.1 KiB
JavaScript
81 lines
2.1 KiB
JavaScript
import { FlatCompat } from "@eslint/eslintrc";
|
|
import js from "@eslint/js";
|
|
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const compat = new FlatCompat({
|
|
baseDirectory: __dirname,
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all,
|
|
});
|
|
|
|
/**
|
|
* @type {import("eslint").Linter.Config[]}
|
|
*/
|
|
const config = [
|
|
{
|
|
ignores: ["src/common/api/*"],
|
|
},
|
|
...compat.extends(
|
|
"next/core-web-vitals",
|
|
"plugin:@typescript-eslint/recommended",
|
|
),
|
|
{
|
|
plugins: {
|
|
"@typescript-eslint": typescriptEslint,
|
|
},
|
|
|
|
languageOptions: {
|
|
ecmaVersion: 5,
|
|
sourceType: "script",
|
|
|
|
parserOptions: {
|
|
project: "./tsconfig.json",
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
"react/function-component-definition": [
|
|
"error",
|
|
{
|
|
namedComponents: "function-declaration",
|
|
},
|
|
],
|
|
|
|
"react/jsx-curly-brace-presence": ["error", "never"],
|
|
"react/jsx-no-useless-fragment": "error",
|
|
"no-else-return": "error",
|
|
"@typescript-eslint/no-explicit-any": "error",
|
|
"@typescript-eslint/array-type": [
|
|
"error",
|
|
{
|
|
default: "generic",
|
|
},
|
|
],
|
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
"@typescript-eslint/consistent-type-exports": "error",
|
|
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
"no-shadow": "off",
|
|
"@typescript-eslint/no-shadow": "error",
|
|
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
|
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
"@typescript-eslint/prefer-optional-chain": "error",
|
|
"@typescript-eslint/prefer-ts-expect-error": "error",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
caughtErrorsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|
|
|
|
export default config;
|