import js from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsparser from "@typescript-eslint/parser";
export default [
js.configs.recommended,
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2020,
sourceType: "module"
}
},
plugins: {
"@typescript-eslint": tseslint
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
],
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/naming-convention": [
"warn",
{ "selector": "default", "format": ["camelCase"] },
{ "selector": "variable", "format": ["camelCase", "UPPER_CASE", "PascalCase"] },
{ "selector": "parameter", "format": ["camelCase"], "leadingUnderscore": "allow" },
{ "selector": "memberLike", "modifiers": ["private"], "format": ["camelCase"], "leadingUnderscore": "allow" },
{ "selector": "typeLike", "format": ["PascalCase"] },
{ "selector": "enum", "format": ["PascalCase"] },
{ "selector": "enumMember", "format": ["PascalCase"] }
],
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "explicit" }],
"@typescript-eslint/no-explicit-any": "warn"
}
}
];