-
Notifications
You must be signed in to change notification settings - Fork 4
/
eslint.config.js
48 lines (47 loc) · 1.54 KB
/
eslint.config.js
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
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import stylistic from '@stylistic/eslint-plugin';
import compat from "eslint-plugin-compat";
export default [
{ ignores: ["dist/", "dev-dist/"] },
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{ languageOptions: { globals: globals.browser } },
compat.configs["flat/recommended"],
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
plugins: { "@stylistic": stylistic },
rules: {
"react/react-in-jsx-scope": "off",
"@stylistic/indent": ["error", 2],
"@stylistic/semi": "error",
"@stylistic/comma-dangle": ["error", {
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
}],
"@stylistic/brace-style": ["error", "stroustrup", {
allowSingleLine: true,
}],
"@stylistic/arrow-parens": ["error", "always"],
"@stylistic/space-infix-ops": "error",
"@stylistic/operator-linebreak": ["error", "before"],
"@stylistic/member-delimiter-style": ["error", {
multiline: { delimiter: "comma" },
singleline: { delimiter: "comma" },
}],
"@stylistic/no-mixed-operators": "error",
"@stylistic/quote-props": ["error", "consistent-as-needed"],
},
},
{
settings: {
react: { version: "detect" },
polyfills: ["DecompressionStream"],
},
},
];