import tseslint from "typescript-eslint";
import pluginVue from "eslint-plugin-vue";
export default [
{
ignores: [
"**/dist/**",
"**/build/**",
"**/target/**",
"**/node_modules/**",
"**/*.min.js",
"**/*.lock",
"package-lock.json",
".git/**",
"threat-model-*/**",
],
},
{
rules: {
"no-eval": "warn",
"no-implied-eval": "warn",
"no-alert": "warn",
"no-debugger": "warn",
"default-case": "warn",
"no-fallthrough": "warn",
"no-case-declarations": "warn",
"no-cond-assign": "warn",
"no-var": "warn",
"no-multi-assign": "warn",
"no-undef-init": "warn",
"no-array-constructor": "warn",
"no-unsafe-finally": "warn",
eqeqeq: "warn",
"no-nested-ternary": "warn",
"no-new-func": "warn",
"prefer-rest-params": "warn",
"prefer-arrow-callback": "warn",
"no-prototype-builtins": "warn",
"guard-for-in": "warn",
"no-extend-native": "warn",
"use-isnan": "warn",
"no-implicit-coercion": "warn",
"no-with": "warn",
},
},
{
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: {
allowDefaultProject: ["*.ts", "*.tsx", "*.mts", "*.cts", "*.vue"],
},
},
},
plugins: {
"@typescript-eslint": tseslint.plugin,
},
rules: {
"@typescript-eslint/no-implied-eval": "warn",
"@typescript-eslint/prefer-return-this-type": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-array-constructor": "warn",
"@typescript-eslint/prefer-enum-initializers": "warn",
"@typescript-eslint/prefer-literal-enum-member": "warn",
},
},
...pluginVue.configs["flat/base"],
{
files: ["**/*.vue"],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
},
},
];