|
1 | 1 | module.exports = {
|
2 | 2 | plugins: ["matrix-org"],
|
3 |
| - extends: [ |
4 |
| - "plugin:matrix-org/babel", |
5 |
| - "plugin:matrix-org/react", |
6 |
| - ], |
| 3 | + extends: ["plugin:matrix-org/babel", "plugin:matrix-org/react"], |
7 | 4 | env: {
|
8 | 5 | browser: true,
|
9 | 6 | node: true,
|
10 | 7 | },
|
11 | 8 | rules: {
|
12 | 9 | // Things we do that break the ideal style
|
13 |
| - "quotes": "off", |
| 10 | + quotes: "off", |
14 | 11 | },
|
15 | 12 | settings: {
|
16 | 13 | react: {
|
17 |
| - version: 'detect', |
| 14 | + version: "detect", |
18 | 15 | },
|
19 | 16 | },
|
20 |
| - overrides: [{ |
21 |
| - files: [ |
22 |
| - "src/**/*.{ts,tsx}", |
23 |
| - "test/**/*.{ts,tsx}", |
24 |
| - "module_system/**/*.{ts,tsx}", |
25 |
| - ], |
26 |
| - extends: [ |
27 |
| - "plugin:matrix-org/typescript", |
28 |
| - "plugin:matrix-org/react", |
29 |
| - ], |
30 |
| - // NOTE: These rules are frozen and new rules should not be added here. |
31 |
| - // New changes belong in https://github.com/matrix-org/eslint-plugin-matrix-org/ |
32 |
| - rules: { |
33 |
| - // Things we do that break the ideal style |
34 |
| - "prefer-promise-reject-errors": "off", |
35 |
| - "quotes": "off", |
| 17 | + overrides: [ |
| 18 | + { |
| 19 | + files: ["src/**/*.{ts,tsx}", "test/**/*.{ts,tsx}", "module_system/**/*.{ts,tsx}"], |
| 20 | + extends: ["plugin:matrix-org/typescript", "plugin:matrix-org/react"], |
| 21 | + // NOTE: These rules are frozen and new rules should not be added here. |
| 22 | + // New changes belong in https://github.com/matrix-org/eslint-plugin-matrix-org/ |
| 23 | + rules: { |
| 24 | + // Things we do that break the ideal style |
| 25 | + "prefer-promise-reject-errors": "off", |
| 26 | + "quotes": "off", |
36 | 27 |
|
37 |
| - // We disable this while we're transitioning |
38 |
| - "@typescript-eslint/no-explicit-any": "off", |
39 |
| - // We're okay with assertion errors when we ask for them |
40 |
| - "@typescript-eslint/no-non-null-assertion": "off", |
| 28 | + // We disable this while we're transitioning |
| 29 | + "@typescript-eslint/no-explicit-any": "off", |
| 30 | + // We're okay with assertion errors when we ask for them |
| 31 | + "@typescript-eslint/no-non-null-assertion": "off", |
41 | 32 |
|
42 |
| - // Ban matrix-js-sdk/src imports in favour of matrix-js-sdk/src/matrix imports to prevent unleashing hell. |
43 |
| - "no-restricted-imports": ["error", { |
44 |
| - "paths": [{ |
45 |
| - "name": "matrix-js-sdk", |
46 |
| - "message": "Please use matrix-js-sdk/src/matrix instead", |
47 |
| - }, { |
48 |
| - "name": "matrix-js-sdk/", |
49 |
| - "message": "Please use matrix-js-sdk/src/matrix instead", |
50 |
| - }, { |
51 |
| - "name": "matrix-js-sdk/src", |
52 |
| - "message": "Please use matrix-js-sdk/src/matrix instead", |
53 |
| - }, { |
54 |
| - "name": "matrix-js-sdk/src/", |
55 |
| - "message": "Please use matrix-js-sdk/src/matrix instead", |
56 |
| - }, { |
57 |
| - "name": "matrix-js-sdk/src/index", |
58 |
| - "message": "Please use matrix-js-sdk/src/matrix instead", |
59 |
| - }, { |
60 |
| - "name": "matrix-react-sdk", |
61 |
| - "message": "Please use matrix-react-sdk/src/index instead", |
62 |
| - }, { |
63 |
| - "name": "matrix-react-sdk/", |
64 |
| - "message": "Please use matrix-react-sdk/src/index instead", |
65 |
| - }], |
66 |
| - "patterns": [{ |
67 |
| - "group": ["matrix-js-sdk/lib", "matrix-js-sdk/lib/", "matrix-js-sdk/lib/**"], |
68 |
| - "message": "Please use matrix-js-sdk/src/* instead", |
69 |
| - }, { |
70 |
| - "group": ["matrix-react-sdk/lib", "matrix-react-sdk/lib/", "matrix-react-sdk/lib/**"], |
71 |
| - "message": "Please use matrix-react-sdk/src/* instead", |
72 |
| - }], |
73 |
| - }], |
| 33 | + // Ban matrix-js-sdk/src imports in favour of matrix-js-sdk/src/matrix imports to prevent unleashing hell. |
| 34 | + "no-restricted-imports": [ |
| 35 | + "error", |
| 36 | + { |
| 37 | + paths: [ |
| 38 | + { |
| 39 | + name: "matrix-js-sdk", |
| 40 | + message: "Please use matrix-js-sdk/src/matrix instead", |
| 41 | + }, |
| 42 | + { |
| 43 | + name: "matrix-js-sdk/", |
| 44 | + message: "Please use matrix-js-sdk/src/matrix instead", |
| 45 | + }, |
| 46 | + { |
| 47 | + name: "matrix-js-sdk/src", |
| 48 | + message: "Please use matrix-js-sdk/src/matrix instead", |
| 49 | + }, |
| 50 | + { |
| 51 | + name: "matrix-js-sdk/src/", |
| 52 | + message: "Please use matrix-js-sdk/src/matrix instead", |
| 53 | + }, |
| 54 | + { |
| 55 | + name: "matrix-js-sdk/src/index", |
| 56 | + message: "Please use matrix-js-sdk/src/matrix instead", |
| 57 | + }, |
| 58 | + { |
| 59 | + name: "matrix-react-sdk", |
| 60 | + message: "Please use matrix-react-sdk/src/index instead", |
| 61 | + }, |
| 62 | + { |
| 63 | + name: "matrix-react-sdk/", |
| 64 | + message: "Please use matrix-react-sdk/src/index instead", |
| 65 | + }, |
| 66 | + ], |
| 67 | + patterns: [ |
| 68 | + { |
| 69 | + group: ["matrix-js-sdk/lib", "matrix-js-sdk/lib/", "matrix-js-sdk/lib/**"], |
| 70 | + message: "Please use matrix-js-sdk/src/* instead", |
| 71 | + }, |
| 72 | + { |
| 73 | + group: ["matrix-react-sdk/lib", "matrix-react-sdk/lib/", "matrix-react-sdk/lib/**"], |
| 74 | + message: "Please use matrix-react-sdk/src/* instead", |
| 75 | + }, |
| 76 | + ], |
| 77 | + }, |
| 78 | + ], |
| 79 | + }, |
74 | 80 | },
|
75 |
| - }, { |
76 |
| - files: [ |
77 |
| - "test/**/*.{ts,tsx}", |
78 |
| - ], |
79 |
| - rules: { |
80 |
| - // We don't need super strict typing in test utilities |
81 |
| - "@typescript-eslint/explicit-function-return-type": "off", |
82 |
| - "@typescript-eslint/explicit-member-accessibility": "off", |
| 81 | + { |
| 82 | + files: ["test/**/*.{ts,tsx}"], |
| 83 | + rules: { |
| 84 | + // We don't need super strict typing in test utilities |
| 85 | + "@typescript-eslint/explicit-function-return-type": "off", |
| 86 | + "@typescript-eslint/explicit-member-accessibility": "off", |
| 87 | + }, |
83 | 88 | },
|
84 |
| - }], |
| 89 | + ], |
85 | 90 | };
|
0 commit comments