forked from podman-desktop/podman-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
137 lines (136 loc) · 4.21 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{
"root": true,
"env": {
"es2021": true,
"node": true,
"browser": false
},
"extends": [
"eslint:recommended",
/** @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#recommended-configs */
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:etc/recommended",
"plugin:sonarjs/recommended-legacy",
"plugin:svelte/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"extraFileExtensions": [".svelte"],
"warnOnUnsupportedTypeScriptVersion": false,
"project": [
"packages/*/tsconfig.json",
"./website/tsconfig.json",
"./website-argos/tsconfig.json",
"./extensions/*/tsconfig.json",
"./tests/playwright/tsconfig.json",
"./tools/tsconfig.json",
"./storybook/tsconfig.json"
]
},
"overrides": [
{
"files": ["*.svelte"],
"parser": "svelte-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser"
}
},
{
// enable the rule specifically for TypeScript files
"files": ["*.ts", "*.tsx", "*.svelte"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "error"
}
},
{
"files": ["*.svelte", "*.tsx"],
"rules": {
"header/header": "off",
"unicorn/prefer-node-protocol": "off"
}
}
],
"settings": {
"import/resolver": {
"typescript": true,
"node": true,
"eslint-import-resolver-custom-alias": {
"alias": {
"/@": "./src",
"/@gen": "./src-generated"
},
"extensions": [".ts"],
"packages": ["packages/*", "extensions/*"]
}
}
},
"plugins": [
"@typescript-eslint",
"sonarjs",
"etc",
"redundant-undefined",
"no-null",
"header",
"simple-import-sort",
"unicorn"
],
"ignorePatterns": [
"packages/preload/exposedInMainWorld.d.ts",
"packages/preload-docker-extension/exposedInDockerExtension.d.ts",
"packages/preload-webview/exposedInWebview.d.ts",
"node_modules/**",
"**/dist/**"
],
"rules": {
"eqeqeq": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-explicit-any": "error",
"prefer-promise-reject-errors": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"no-null/no-null": "error",
"@typescript-eslint/prefer-nullish-coalescing": ["error", { "ignoreConditionalTests": true }],
/**
* Having a semicolon helps the optimizer interpret your code correctly.
* This avoids rare errors in optimized code.
* @see https://twitter.com/alex_kozack/status/1364210394328408066
*/
"semi": ["error", "always"],
/**
* This will make the history of changes in the hit a little cleaner
*/
"comma-dangle": ["warn", "always-multiline"],
/**
* Just for beauty
*/
"quotes": ["error", "single", { "allowTemplateLiterals": true }],
"import/no-duplicates": "error",
"import/no-unresolved": "off",
"import/default": "off",
"import/no-named-as-default-member": "off",
"import/no-named-as-default": "off",
"import/first": "error",
"import/newline-after-import": "error",
"sonarjs/cognitive-complexity": "off",
"sonarjs/no-duplicate-string": "off",
"sonarjs/no-empty-collection": "off",
"sonarjs/no-small-switch": "off",
"etc/no-commented-out-code": "error",
"etc/no-deprecated": "off",
"redundant-undefined/redundant-undefined": "error",
"import/no-extraneous-dependencies": "error",
"header/header": [2, "block", [{ "pattern": "SPDX-License-Identifier: Apache-2\\.0" }]],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"unicorn/prefer-node-protocol": "error"
}
}