|
1 | 1 | // @ts-check |
2 | 2 |
|
3 | 3 | import eslint from '@eslint/js'; |
4 | | -import tseslint from 'typescript-eslint'; |
5 | | -import react from 'eslint-plugin-react'; |
6 | 4 | import stylistic from '@stylistic/eslint-plugin'; |
7 | | -import globals from 'globals'; |
| 5 | +import react from 'eslint-plugin-react'; |
8 | 6 | import reactHooks from 'eslint-plugin-react-hooks'; |
| 7 | +import globals from 'globals'; |
| 8 | +import tseslint from 'typescript-eslint'; |
9 | 9 |
|
10 | 10 | export default tseslint.config( |
11 | 11 | eslint.configs.recommended, |
12 | 12 | ...tseslint.configs.recommended, |
13 | 13 | { |
14 | | - ignores: ['**/*.js'] |
| 14 | + ignores: ['dist/**', 'website/**', 'build/**', 'extern/**', 'extensions/**', './**.mjs', './**.js'] |
15 | 15 | }, |
16 | 16 | { |
17 | | - files: ['**/*.{ts,tsx}'], |
18 | | - plugins: { |
19 | | - react, |
20 | | - '@stylistic': stylistic, |
21 | | - }, |
22 | | - settings: { |
23 | | - react: { |
24 | | - version: '17' |
25 | | - } |
26 | | - }, |
27 | | - languageOptions: { |
28 | | - parserOptions: { |
29 | | - ecmaFeatures: { |
30 | | - jsx: true, |
31 | | - }, |
32 | | - }, |
33 | | - globals: { |
34 | | - ...globals.browser, |
| 17 | + files: ['**/*.{ts,tsx}'], |
| 18 | + plugins: { |
| 19 | + react, |
| 20 | + '@stylistic': stylistic, |
| 21 | + }, |
| 22 | + settings: { |
| 23 | + react: { |
| 24 | + version: '17' |
| 25 | + } |
| 26 | + }, |
| 27 | + languageOptions: { |
| 28 | + parserOptions: { |
| 29 | + ecmaFeatures: { |
| 30 | + jsx: true, |
35 | 31 | }, |
36 | 32 | }, |
37 | | - rules: { |
38 | | - "@stylistic/object-curly-spacing": ["warn", "always"], |
39 | | - "@typescript-eslint/adjacent-overload-signatures": "off", |
40 | | - "@typescript-eslint/explicit-function-return-type": "off", |
41 | | - "@typescript-eslint/explicit-module-boundary-types": "off", |
42 | | - "@stylistic/indent": ["error", 2, { |
43 | | - "MemberExpression": 0, |
44 | | - "SwitchCase": 1 |
45 | | - }], |
46 | | - "@typescript-eslint/no-empty-function": ["error", { "allow": ["arrowFunctions"] }], |
47 | | - "@typescript-eslint/no-explicit-any": "off", |
48 | | - "@typescript-eslint/no-invalid-void-type": ["error", { "allowInGenericTypeArguments": true }], |
49 | | - "@typescript-eslint/no-namespace": "off", |
50 | | - "@typescript-eslint/no-unused-vars": ["error", { |
51 | | - "vars": "all", |
52 | | - "caughtErrors": "none", |
53 | | - "args": "none" |
54 | | - }], |
55 | | - "@typescript-eslint/no-use-before-define": "off", |
56 | | - "@typescript-eslint/prefer-interface": "off", |
57 | | - //"react/no-access-state-in-setstate": "error", (requires restructuring of "app.tsx") |
58 | | - "react/no-direct-mutation-state": "error", |
59 | | - "react/no-render-return-value": "error", |
60 | | - "react/no-string-refs": "error", |
61 | | - "react/no-unescaped-entities": ["error", {"forbid": [{ |
62 | | - "char": ">", |
63 | | - "alternatives": [">"] |
64 | | - }, { |
65 | | - "char": "}", |
66 | | - "alternatives": ["}"] |
67 | | - }]}], |
68 | | - "react/no-unused-prop-types": "error", |
69 | | - "react/no-unused-state": "error", |
70 | | - "curly": ["error", "all"], |
71 | | - "eol-last": "error", |
72 | | - "for-direction": "error", |
73 | | - "getter-return": "error", |
74 | | - "keyword-spacing": "error", |
75 | | - "no-compare-neg-zero": "error", |
76 | | - "no-cond-assign": "error", |
77 | | - "no-constant-condition": ["error", { "checkLoops": false }], |
78 | | - "no-control-regex": "off", |
79 | | - "no-debugger": "error", |
80 | | - "no-delete-var": "error", |
81 | | - "no-dupe-args": "error", |
82 | | - "no-dupe-keys": "error", |
83 | | - "no-duplicate-case": "error", |
84 | | - "no-empty": "error", |
85 | | - "no-empty-character-class": "error", |
86 | | - "no-empty-pattern": "error", |
87 | | - "no-ex-assign": "error", |
88 | | - "no-extra-boolean-cast": "error", |
89 | | - "no-extra-semi": "error", |
90 | | - "no-func-assign": "error", |
91 | | - "no-global-assign": "error", |
92 | | - "no-inner-declarations": "off", |
93 | | - "no-invalid-regexp": "error", |
94 | | - "no-irregular-whitespace": "error", |
95 | | - "no-mixed-spaces-and-tabs": "error", |
96 | | - "no-obj-calls": "error", |
97 | | - "no-octal": "error", |
98 | | - "no-prototype-builtins": "error", |
99 | | - "no-redeclare": "off", |
100 | | - "@typescript-eslint/no-redeclare": "error", |
101 | | - "no-regex-spaces": "error", |
102 | | - "no-self-assign": "error", |
103 | | - "no-shadow-restricted-names": "error", |
104 | | - "no-spaced-func": "error", |
105 | | - "no-sparse-arrays": "error", |
106 | | - "no-trailing-spaces": "error", |
107 | | - "no-unexpected-multiline": "error", |
108 | | - "no-unreachable": "error", |
109 | | - "no-unsafe-finally": "error", |
110 | | - "no-unsafe-negation": "error", |
111 | | - "no-unused-labels": "error", |
112 | | - "no-useless-catch": "error", |
113 | | - "no-useless-escape": "error", |
114 | | - "no-whitespace-before-property": "error", |
115 | | - "no-with": "error", |
116 | | - "quotes": ["error", "single"], |
117 | | - //"require-atomic-updates": "error", (requires restructuring of "recursiveDirectory()") |
118 | | - "semi": ["error", "always"], |
119 | | - "space-before-blocks": "error", |
120 | | - "space-unary-ops": "error", |
121 | | - "spaced-comment": "error", |
122 | | - "use-isnan": "error", |
123 | | - "valid-typeof": "error", |
124 | | - "wrap-iife": "error", |
125 | | - "yoda": "error", |
126 | | - } |
| 33 | + globals: { |
| 34 | + ...globals.browser, |
| 35 | + }, |
| 36 | + }, |
| 37 | + rules: { |
| 38 | + "@stylistic/object-curly-spacing": ["warn", "always"], |
| 39 | + "@typescript-eslint/adjacent-overload-signatures": "off", |
| 40 | + "@typescript-eslint/explicit-function-return-type": "off", |
| 41 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 42 | + "@stylistic/indent": ["error", 2, { |
| 43 | + "MemberExpression": 0, |
| 44 | + "SwitchCase": 1 |
| 45 | + }], |
| 46 | + "@typescript-eslint/no-empty-function": ["error", { "allow": ["arrowFunctions"] }], |
| 47 | + "@typescript-eslint/no-explicit-any": "off", |
| 48 | + "@typescript-eslint/no-invalid-void-type": ["error", { "allowInGenericTypeArguments": true }], |
| 49 | + "@typescript-eslint/no-namespace": "off", |
| 50 | + "@typescript-eslint/no-unused-vars": ["error", { |
| 51 | + "vars": "all", |
| 52 | + "caughtErrors": "none", |
| 53 | + "args": "none" |
| 54 | + }], |
| 55 | + "@typescript-eslint/no-use-before-define": "off", |
| 56 | + "@typescript-eslint/prefer-interface": "off", |
| 57 | + //"react/no-access-state-in-setstate": "error", (requires restructuring of "app.tsx") |
| 58 | + "react/no-direct-mutation-state": "error", |
| 59 | + "react/no-render-return-value": "error", |
| 60 | + "react/no-string-refs": "error", |
| 61 | + "react/no-unescaped-entities": ["error", {"forbid": [{ |
| 62 | + "char": ">", |
| 63 | + "alternatives": [">"] |
| 64 | + }, { |
| 65 | + "char": "}", |
| 66 | + "alternatives": ["}"] |
| 67 | + }]}], |
| 68 | + "react/no-unused-prop-types": "error", |
| 69 | + "react/no-unused-state": "error", |
| 70 | + "curly": ["error", "all"], |
| 71 | + "eol-last": "error", |
| 72 | + "for-direction": "error", |
| 73 | + "getter-return": "error", |
| 74 | + "keyword-spacing": "error", |
| 75 | + "no-compare-neg-zero": "error", |
| 76 | + "no-cond-assign": "error", |
| 77 | + "no-constant-condition": ["error", { "checkLoops": false }], |
| 78 | + "no-control-regex": "off", |
| 79 | + "no-debugger": "error", |
| 80 | + "no-delete-var": "error", |
| 81 | + "no-dupe-args": "error", |
| 82 | + "no-dupe-keys": "error", |
| 83 | + "no-duplicate-case": "error", |
| 84 | + "no-empty": "error", |
| 85 | + "no-empty-character-class": "error", |
| 86 | + "no-empty-pattern": "error", |
| 87 | + "no-ex-assign": "error", |
| 88 | + "no-extra-boolean-cast": "error", |
| 89 | + "no-extra-semi": "error", |
| 90 | + "no-func-assign": "error", |
| 91 | + "no-global-assign": "error", |
| 92 | + "no-inner-declarations": "off", |
| 93 | + "no-invalid-regexp": "error", |
| 94 | + "no-irregular-whitespace": "error", |
| 95 | + "no-mixed-spaces-and-tabs": "error", |
| 96 | + "no-obj-calls": "error", |
| 97 | + "no-octal": "error", |
| 98 | + "no-prototype-builtins": "error", |
| 99 | + "no-redeclare": "off", |
| 100 | + "@typescript-eslint/no-redeclare": "error", |
| 101 | + "no-regex-spaces": "error", |
| 102 | + "no-self-assign": "error", |
| 103 | + "no-shadow-restricted-names": "error", |
| 104 | + "no-spaced-func": "error", |
| 105 | + "no-sparse-arrays": "error", |
| 106 | + "no-trailing-spaces": "error", |
| 107 | + "no-unexpected-multiline": "error", |
| 108 | + "no-unreachable": "error", |
| 109 | + "no-unsafe-finally": "error", |
| 110 | + "no-unsafe-negation": "error", |
| 111 | + "no-unused-labels": "error", |
| 112 | + "no-useless-catch": "error", |
| 113 | + "no-useless-escape": "error", |
| 114 | + "no-whitespace-before-property": "error", |
| 115 | + "no-with": "error", |
| 116 | + "quotes": ["error", "single"], |
| 117 | + //"require-atomic-updates": "error", (requires restructuring of "recursiveDirectory()") |
| 118 | + "semi": ["error", "always"], |
| 119 | + "space-before-blocks": "error", |
| 120 | + "space-unary-ops": "error", |
| 121 | + "spaced-comment": "error", |
| 122 | + "use-isnan": "error", |
| 123 | + "valid-typeof": "error", |
| 124 | + "wrap-iife": "error", |
| 125 | + "yoda": "error", |
| 126 | + } |
127 | 127 | }, |
128 | 128 | reactHooks.configs.flat['recommended-latest'], |
129 | 129 | ); |
0 commit comments