forked from canonical/ubuntu.com
-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
63 lines (61 loc) · 1.71 KB
/
eslint.config.mjs
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
import eslint from "@eslint/js";
import reactPlugin from "eslint-plugin-react";
import tsParser from '@typescript-eslint/parser'
import globals from "globals";
const config = [
eslint.configs.recommended,
reactPlugin.configs.flat.recommended,
{
languageOptions: {
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
dataLayer: "readonly",
d3: "readonly",
topojson: "readonly",
ga: "readonly",
grecaptcha: "readonly",
serialize: "readonly",
"JSX": "readonly",
"React": "readonly",
"ReactDOM": "readonly",
"ReactNode": "readonly",
...globals.node,
...globals.browser,
...globals.jest,
},
parser: tsParser,
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
project: "./tsconfig.json",
ecmaFeatures: {
jsx: true
}
},
},
rules: {
semi: ["error", "always"],
"react/prop-types": "off",
"no-redeclare": "off",
"react/display-name": "off",
"no-constant-binary-expression": "off",
"no-unused-vars": "off",
"no-undef": "off",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-prototype-builtins": "off",
},
files: ["**/*.jsx", "**/*.tsx", "**/*.js", "**/*.ts"],
settings: {
react: {
version: "detect", // Automatically detect the React version
}
}
},
];
export default config;