mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-04-07 19:03:38 +00:00
51 lines
2.0 KiB
JavaScript
51 lines
2.0 KiB
JavaScript
import js from "@eslint/js";
|
|
import stylistic from "@stylistic/eslint-plugin";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import tseslint from "typescript-eslint";
|
|
|
|
export default tseslint.config(
|
|
{ ignores: ["dist"] },
|
|
{
|
|
extends: [js.configs.recommended, ...tseslint.configs.recommendedTypeChecked],
|
|
files: ["src/**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
plugins: {
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
"@stylistic": stylistic,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
|
|
|
"curly": "error",
|
|
"@stylistic/brace-style": ["error", "1tbs"],
|
|
|
|
// stylistic
|
|
"@stylistic/indent": ["error", 4],
|
|
"@stylistic/quotes": ["error", "double"],
|
|
"@stylistic/semi": ["error", "always"],
|
|
"@stylistic/comma-dangle": ["error", "always-multiline"],
|
|
"@stylistic/object-curly-spacing": ["error", "always"],
|
|
"@stylistic/array-bracket-spacing": ["error", "never"],
|
|
"@stylistic/arrow-parens": ["error", "always"],
|
|
"@stylistic/eol-last": ["error", "always"],
|
|
"@stylistic/no-trailing-spaces": "error",
|
|
"@stylistic/no-multiple-empty-lines": ["error", { max: 1 }],
|
|
"@stylistic/jsx-quotes": ["error", "prefer-double"],
|
|
|
|
// typescript
|
|
"@typescript-eslint/explicit-function-return-type": ["error", { allowExpressions: true }],
|
|
"@typescript-eslint/no-deprecated": "error",
|
|
"@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports" }],
|
|
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
},
|
|
},
|
|
);
|