url-processor/eslint.config.mjs
Alexander Borsuk 77fc96a519 Migrate to a new eslint
Linter is not yet autoenabled, need to fix some issues first in npm run test

Signed-off-by: Alexander Borsuk <me@alex.bio>
2024-08-03 13:55:02 +02:00

50 lines
No EOL
1.2 KiB
JavaScript

import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
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 [...compat.extends("plugin:@typescript-eslint/recommended"), {
languageOptions: {
globals: {
...globals.worker,
},
parser: tsParser,
ecmaVersion: 2020,
sourceType: "module",
parserOptions: {
ecmaFeatures: {
impliedStrict: true,
},
},
},
rules: {
indent: ["error", 2, {
SwitchCase: 1,
}],
semi: ["error", "always"],
quotes: ["error", "single", "avoid-escape"],
"no-trailing-spaces": ["error"],
"no-unused-vars": ["error", {
argsIgnorePattern: "^_",
}],
"prefer-const": ["error", {
destructuring: "all",
}],
},
}];