diff options
Diffstat (limited to '.eslintrc.cjs')
-rw-r--r-- | .eslintrc.cjs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 8f1451b..e76ff6f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs | |||
@@ -44,8 +44,9 @@ module.exports = { | |||
44 | }, | 44 | }, |
45 | }, | 45 | }, |
46 | rules: { | 46 | rules: { |
47 | // TODO Flip this to `ignorePackages` once we are on `nodenext` resolution. | 47 | // `import/exteions` is buggy with ts files: |
48 | 'import/extensions': ['error', 'never'], | 48 | // https://github.com/import-js/eslint-plugin-import/issues/2111 |
49 | 'import/extensions': 'off', | ||
49 | 'import/no-unresolved': 'error', | 50 | 'import/no-unresolved': 'error', |
50 | 'import/order': [ | 51 | 'import/order': [ |
51 | 'error', | 52 | 'error', |
@@ -85,7 +86,12 @@ module.exports = { | |||
85 | files: ['**/stores/**/*.ts'], | 86 | files: ['**/stores/**/*.ts'], |
86 | rules: { | 87 | rules: { |
87 | // In a mobx-state-tree action, we assign to the properties of `self` to update the store. | 88 | // In a mobx-state-tree action, we assign to the properties of `self` to update the store. |
88 | 'no-param-reassign': 'off', | 89 | 'no-param-reassign': [ |
90 | 'error', | ||
91 | { | ||
92 | props: false, | ||
93 | }, | ||
94 | ], | ||
89 | // mobx-state-tree uses empty interfaces to speed up typechecking. | 95 | // mobx-state-tree uses empty interfaces to speed up typechecking. |
90 | '@typescript-eslint/no-empty-interface': 'off', | 96 | '@typescript-eslint/no-empty-interface': 'off', |
91 | }, | 97 | }, |
@@ -102,17 +108,14 @@ module.exports = { | |||
102 | }, | 108 | }, |
103 | }, | 109 | }, |
104 | { | 110 | { |
105 | files: ['**/*.js'], | ||
106 | rules: { | ||
107 | // ESM requires extensions for imports. | ||
108 | 'import/extensions': ['error', 'ignorePackages'], | ||
109 | }, | ||
110 | }, | ||
111 | { | ||
112 | files: ['**/*.cjs'], | 111 | files: ['**/*.cjs'], |
113 | parserOptions: { | 112 | parserOptions: { |
114 | sourceType: 'script', | 113 | sourceType: 'script', |
115 | }, | 114 | }, |
115 | rules: { | ||
116 | // We have to use `const foo = require('foo')` syntax in CommonJS files. | ||
117 | '@typescript-eslint/no-var-requires': 'off', | ||
118 | }, | ||
116 | }, | 119 | }, |
117 | { | 120 | { |
118 | files: [ | 121 | files: [ |