summaryrefslogtreecommitdiff
path: root/eslint.config.js
blob: c65f7520cc353bbe18da8b4200d4481825676972 (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
import globals from "globals";
import js from "@eslint/js";
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard';
import stylistic from '@stylistic/eslint-plugin';

export default [
	{
		files: ["**/*.js"],
		languageOptions: {
			globals: {
				...globals.browser,
			},
			sourceType: "script",
		},
	},
	{
		ignores: [
			...resolveIgnoresFromGitignore(),
			"**/*.min.js",
			"extensions/",
			"p/scripts/vendor/",
		],
	},
	js.configs.recommended,
	// stylistic.configs['recommended-flat'],
	...neostandard(),
	{
		plugins: {
			"@stylistic": stylistic,
		},
		rules: {
			"camelcase": "off",
			"eqeqeq": "off",
			"no-empty": ["error", { "allowEmptyCatch": true }],
			"no-unused-vars": ["error", {
				"args": "none",
				"caughtErrors": "none",
			}],
			"object-shorthand": "off",
			"yoda": "off",
			"@stylistic/indent": ["warn", "tab", { "SwitchCase": 1 }],
			"@stylistic/linebreak-style": ["error", "unix"],
			"@stylistic/max-len": ["warn", 165],
			"@stylistic/no-tabs": "off",
			"@stylistic/quotes": ["off", "single", { "avoidEscape": true }],
			"@stylistic/quote-props": ["warn", "consistent"],
			"@stylistic/semi": ["warn", "always"],
			"@stylistic/space-before-function-paren": ["warn", {
				"anonymous": "always",
				"asyncArrow": "always",
				"named": "never",
			}],
		},
	},
];