Skip to content

Commit

Permalink
fix eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorniaky committed Oct 20, 2024
1 parent 232ed98 commit 0aefd56
Showing 1 changed file with 22 additions and 27 deletions.
49 changes: 22 additions & 27 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,45 +1,40 @@
import pluginJs from "@eslint/js";
import { Linter } from "eslint";
import globals from "globals";
import tseslint from "typescript-eslint";

/** @type {Linter.Config[]} */
export default [
{ files: ["**/*.ts"] },
{ ignores: ["out/", "**/*.js", "**/.d.ts"] },
{ files: ["**/*.ts"], languageOptions: { sourceType: "script" } },
{ files: ["**/*.?(c|m)ts"] },
{ ignores: ["**/*.?(c|m)js", "**/*.d.?(c|m)ts"] },
{ languageOptions: { globals: globals.node } },
{ languageOptions: { sourceType: "script" } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "import",
format: ["camelCase", "PascalCase"],
},
],
"@typescript-eslint/consistent-type-imports": ["warn", { fixStyle: "inline-type-imports" }],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/semi": "warn",
"@typescript-eslint/no-unsafe-declaration-merging": "off",
"@typescript-eslint/no-unused-vars": ["warn", {
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
}],
"@typescript-eslint/prefer-ts-expect-error": "warn",
"comma-dangle": ["warn", "always-multiline"],
curly: "off",
"eol-last": "warn",
eqeqeq: "warn",
"no-case-declarations": "off",
"func-style": ["warn", "declaration"],
indent: ["warn", 2, { SwitchCase: 1 }],
"no-duplicate-imports": ["warn", { includeExports: true }],
"no-empty": "off",
"no-extra-semi": "warn",
"no-throw-literal": "warn",
"no-unused-private-class-members": "warn",
"no-unused-vars": "off",
"prefer-const": "warn",
"prefer-object-has-own": "warn",
"prefer-regex-literals": "warn",
quotes: ["warn", "double"],
semi: "off",
semi: ["warn", "always"],
},
},
];

0 comments on commit 0aefd56

Please sign in to comment.