53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
|
|
import tseslint from "@typescript-eslint/eslint-plugin";
|
||
|
|
import tsparser from "@typescript-eslint/parser";
|
||
|
|
import prettier from "eslint-config-prettier";
|
||
|
|
import unicorn from "eslint-plugin-unicorn";
|
||
|
|
import importX from "eslint-plugin-import-x";
|
||
|
|
|
||
|
|
export default [
|
||
|
|
{
|
||
|
|
files: ["**/*.ts"],
|
||
|
|
languageOptions: {
|
||
|
|
parser: tsparser,
|
||
|
|
parserOptions: {
|
||
|
|
ecmaVersion: 2022,
|
||
|
|
sourceType: "module",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
plugins: {
|
||
|
|
"@typescript-eslint": tseslint,
|
||
|
|
unicorn,
|
||
|
|
"import-x": importX,
|
||
|
|
},
|
||
|
|
rules: {
|
||
|
|
...tseslint.configs.recommended.rules,
|
||
|
|
...unicorn.configs.recommended.rules,
|
||
|
|
|
||
|
|
// Relax unicorn rules
|
||
|
|
"unicorn/no-null": "off",
|
||
|
|
"unicorn/prevent-abbreviations": "off",
|
||
|
|
"unicorn/no-process-exit": "off",
|
||
|
|
"unicorn/prefer-top-level-await": "off",
|
||
|
|
|
||
|
|
// Import rules
|
||
|
|
"import-x/no-duplicates": "error",
|
||
|
|
"import-x/order": [
|
||
|
|
"error",
|
||
|
|
{
|
||
|
|
groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
|
||
|
|
"newlines-between": "always",
|
||
|
|
alphabetize: { order: "asc" },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
|
||
|
|
// TypeScript rules
|
||
|
|
"@typescript-eslint/no-unused-vars": [
|
||
|
|
"error",
|
||
|
|
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
||
|
|
],
|
||
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
prettier,
|
||
|
|
];
|