forked from ifagian/graph3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
32 lines (32 loc) · 1.9 KB
/
.eslintrc.json
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
{
"extends": [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"project": "./tsconfig.json",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
// - - - - - - - - - - - -
// ESLint
// - - - - - - - - - - - -
"curly": "error", // Enforce consistent brace style for all control statements
"eqeqeq": ["error", "always", { "null": "ignore" }], // Require the use of === and !== "ignore" -------> Do not apply this rule to null
"max-depth": ["warn", 3], // Enforce a maximum depth that blocks can be nested. Many developers consider code difficult to read if blocks are nested beyond a certain depth
"no-alert": "error", // Disallow the use of alert, confirm, and prompt
"no-console": "warn", // Warning when using console.log, console.warn or console.error
"no-debugger": "error", // Error when using debugger;
"no-duplicate-case": "error", // This rule disallows duplicate test expressions in case clauses of switch statements
"no-empty": "error", // Disallow empty block statements
"no-lonely-if": "error", // Disallow if statements as the only statement in else blocks
"no-nested-ternary": "warn", // Warns the use of nested ternary expressions
"no-sequences": "error", // Disallow comma operators
"no-undef": "off", // Allows defining undefined variables
"no-unneeded-ternary": "error", // Disallow ternary operators when simpler alternatives exist
"spaced-comment": ["error", "always", { "exceptions": ["-", "+", "/"] }] // Enforce consistent spacing after the // or /* in a comment
}
}