-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
59 lines (59 loc) · 2.35 KB
/
.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// eslint-disable-next-line unicorn/filename-case
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors.
"plugin:unicorn/recommended",
"plugin:import/warnings",
],
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
ecmaVersion: 2_020,
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
project: ['tsconfig.json'],
},
plugins: ["eslint-plugin-jsdoc", "eslint-plugin-unicorn", "@typescript-eslint", "prettier", "prefer-arrow"],
// Fine tune rules
rules: {
"@typescript-eslint/no-var-requires": 0,
eqeqeq: "error",
"no-console": "warn",
"no-undef": "off",
"no-unused-vars": "off",
"prettier/prettier": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"unicorn/prevent-abbreviations": "off",
"unicorn/no-null": "off",
"import/order": "warn",
"unicorn/numeric-separators-style": ["error", { number: { minimumDigits: 0, groupLength: 3 } }],
"unicorn/filename-case": [
"error",
{
case: "pascalCase",
ignore: ["^\\.js$", "^\\.?.*\\.js$", "^\\.?.*\\.cjs$", "^_.*", "main.*?.tsx", "vite.config.ts", ".*?\\.ts"],
},
],
"prefer-arrow/prefer-arrow-functions": [
"error",
{
disallowPrototype: true,
singleReturnOnly: false,
classPropertiesAllowed: false,
},
],
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
"func-style": ["error", "expression", { allowArrowFunctions: true }],
"no-restricted-syntax": ["error", {
"selector": "ExportDefaultDeclaration",
"message": "Prefer named exports"
}],
},
};