-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
75 lines (68 loc) · 2.28 KB
/
.eslintrc.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
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
module.exports = {
plugins: [
"matrix-org",
"react",
],
env: {
es2020: true,
browser: true,
node: true,
},
parserOptions: {
sourceType: "module",
},
overrides: [
{
files: [
"**/*.ts",
"**/*.tsx",
],
extends: [
"plugin:matrix-org/typescript",
],
settings: {
react: {
pragma: "h",
},
},
rules: {
"quotes": ["error", "double"],
// React rules adapted from eslint-plugin-matrix-org
// Rules for hooks removed to avoid extra dependencies
"max-len": ["warn", {
// Ignore pure JSX lines
ignorePattern: "^\\s*<",
ignoreComments: true,
code: 120,
}],
// This just uses the React plugin to help ESLint known when
// variables have been used in JSX
"react/jsx-uses-vars": ["error"],
// Don't mark React as unused if we're using JSX
"react/jsx-uses-react": ["error"],
// Components in JSX should always be defined
"react/jsx-no-undef": ["error"],
// Assert spacing before self-closing JSX tags, and no spacing before
// or after the closing slash, and no spacing after the opening
// bracket of the opening tag or closing tag.
// https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-tag-spacing.md
"react/jsx-tag-spacing": ["error"],
// Empty interfaces are useful for declaring new names
"@typescript-eslint/no-empty-interface": ["off"],
// Always use `import type` for type-only imports
"@typescript-eslint/consistent-type-imports": ["error"],
},
},
{
files: [
"**/*.js",
],
extends: [
"plugin:matrix-org/javascript",
],
rules: {
"quotes": ["error", "double"],
},
},
],
};