Chore: move to eslint (#6270)
Some checks failed
Docker CI / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Crowdin Action / Crowdin Sync (push) Has been cancelled

This commit is contained in:
shamoon
2026-02-02 15:18:30 -08:00
committed by GitHub
parent 1233b5e803
commit 97e909ebf4
29 changed files with 121 additions and 85 deletions

69
eslint.config.mjs Normal file
View File

@@ -0,0 +1,69 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import { fixupConfigRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import prettier from "eslint-plugin-prettier";
import { defineConfig, globalIgnores } from "eslint/config";
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,
});
export default defineConfig([
{
extends: fixupConfigRules(compat.extends("next/core-web-vitals", "prettier", "plugin:react-hooks/recommended")),
plugins: {
prettier,
},
languageOptions: {
ecmaVersion: 6,
sourceType: "module",
parserOptions: {
ecmaFeatures: {
modules: true,
},
},
},
settings: {
"import/resolver": {
node: {
paths: ["src"],
},
},
},
rules: {
"import/no-cycle": [
"error",
{
maxDepth: 1,
},
],
"import/order": [
"error",
{
"newlines-between": "always",
},
],
"no-else-return": [
"error",
{
allowElseIf: true,
},
],
},
},
globalIgnores(["./config/", "./.venv/", "./.next/", "./site/"]),
]);