47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
import { fileURLToPath } from 'node:url';
|
|
|
|
import tsParser from "@typescript-eslint/parser";
|
|
import tsPlugin from "@typescript-eslint/eslint-plugin";
|
|
import prettier from "eslint-config-prettier";
|
|
|
|
const rootDir = fileURLToPath(new URL(".", import.meta.url));
|
|
|
|
export default [
|
|
{
|
|
ignores: [
|
|
"coverage/**",
|
|
"dist/**",
|
|
"eval-reports/**",
|
|
"node_modules/**",
|
|
],
|
|
},
|
|
{
|
|
files: ["src/**/*.ts"],
|
|
languageOptions: {
|
|
ecmaVersion: "latest",
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
project: true,
|
|
tsconfigRootDir: rootDir,
|
|
},
|
|
sourceType: "module",
|
|
},
|
|
plugins: {
|
|
"@typescript-eslint": tsPlugin,
|
|
},
|
|
rules: {
|
|
...tsPlugin.configs["recommended-type-checked"].rules,
|
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
"@typescript-eslint/no-floating-promises": "error",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
},
|
|
},
|
|
prettier,
|
|
];
|