summaryrefslogtreecommitdiffhomepage
path: root/eslint.config.mjs
blob: 2783f8f5d2ea3134fe508ce4c333b43016c67613 (plain)
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
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import globals from 'globals';

export default tseslint.config(
	eslint.configs.recommended,
	...tseslint.configs.recommendedTypeChecked,
	{
		languageOptions: {
			parserOptions: {
				sourceType: "module",
				parser: "@typescript-eslint/parser",
				project: "./tsconfig.json",
			},
			globals: {
				...globals.browser, ...globals.worker
			}
		},
		rules: {
			"no-unused-vars": "off",
			"no-prototype-bultins": "off",
			"no-self-compare": "warn",
			"no-eval": "error",
			"no-implied-eval": "error",
			"prefer-const": "off",
			"no-console": [
				"warn",
				{
					"allow": ["warn", "error", "debug"]
				}
			],
			"no-restricted-globals": [
				"error",
				{
					"name": "app",
					"message": "Avoid using the global app object. Instead use the reference provided by your plugin instance."
				}
			],
			"no-alert": "error",
			"no-undef": "error",
			"@typescript/eslint-ban-ts-comment": "off",
			"@typescript-eslint/no-unused-vars": [
				"error",
				{
					"args": "none"
				}
			],
			"@typescript-eslint/ban-ts-comment": "off",
			"@typescript-eslint/await-thenable": "warn",
			"@typescript-eslint/no-invalid-this": "error",
			"@typescript-eslint/no-require-imports": "warn",
			"@typescript-eslint/no-var-requires": "off",
			"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn"
		}
	},
);