generated from gapitio/htmlgraphics-svg-bundler-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
98 lines (97 loc) · 3.05 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
module.exports = {
extends: [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:promise/recommended",
"plugin:unicorn/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"prettier",
],
plugins: ["import", "svelte3"],
rules: {
"array-callback-return": ["error", { allowImplicit: true }],
"consistent-return": "off",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off", // https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html
"no-continue": "off",
"no-dupe-else-if": "error",
"no-param-reassign": ["error", { props: false }], // Disallow reassignment of function parameters
// Too restrictive, writing ugly code to defend against a very unlikely scenario: https://eslint.org/docs/rules/no-prototype-builtins
"no-prototype-builtins": "off",
// Disallow certain syntax forms
"no-restricted-syntax": [
"error",
{
message:
"for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.",
selector: "ForInStatement",
},
{
message:
"Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.",
selector: "LabeledStatement",
},
{
message:
"`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
selector: "WithStatement",
},
],
"unicorn/filename-case": [
"error",
{ cases: { camelCase: true, pascalCase: true, kebabCase: true } },
],
"unicorn/no-useless-undefined": ["error", { checkArguments: false }],
"unicorn/prefer-module": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prevent-abbreviations": "off", // Common abbreviations are known and readable
},
overrides: [
{
files: ["*.ts", "*.tsx"],
parser: "@typescript-eslint/parser",
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
],
},
{
files: ["*.svelte"],
processor: "svelte3/svelte3",
parser: "@typescript-eslint/parser",
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
],
rules: {
// Disable "broken" rules
// https://github.com/sveltejs/eslint-plugin-svelte3/blob/master/OTHER_PLUGINS.md
"prettier/prettier": "off",
"import/first": "off",
"import/no-duplicates": "off",
"import/no-mutable-exports": "off",
"import/no-unresolved": "off",
"no-undef": "off",
},
},
],
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".d.ts"],
},
"import/resolver": {
node: {
extensions: [".js", ".ts"],
},
typescript: {
alwaysTryTypes: true,
},
},
"svelte3/typescript": require("typescript"),
},
env: {
browser: true,
node: true,
},
};