aboutsummaryrefslogtreecommitdiffstats
path: root/.eslintrc.cjs
diff options
context:
space:
mode:
Diffstat (limited to '.eslintrc.cjs')
-rw-r--r--.eslintrc.cjs40
1 files changed, 11 insertions, 29 deletions
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 7b05d5d..1301de4 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -1,19 +1,15 @@
1const project = [ 1const project = ['./tsconfig.json', './packages/*/tsconfig.json'];
2 './tsconfig.json',
3 './packages/*/tsconfig.json',
4];
5 2
6module.exports = { 3module.exports = {
7 root: true, 4 root: true,
8 plugins: [ 5 plugins: ['@typescript-eslint'],
9 '@typescript-eslint',
10 ],
11 extends: [ 6 extends: [
12 'airbnb', 7 'airbnb',
13 'airbnb-typescript', 8 'airbnb-typescript',
14 'airbnb/hooks', 9 'airbnb/hooks',
15 'plugin:@typescript-eslint/recommended', 10 'plugin:@typescript-eslint/recommended',
16 'plugin:@typescript-eslint/recommended-requiring-type-checking', 11 'plugin:@typescript-eslint/recommended-requiring-type-checking',
12 'plugin:prettier/recommended',
17 ], 13 ],
18 env: { 14 env: {
19 es6: true, 15 es6: true,
@@ -56,9 +52,7 @@ module.exports = {
56 }, 52 },
57 overrides: [ 53 overrides: [
58 { 54 {
59 files: [ 55 files: ['**/stores/**/*.ts'],
60 '**/stores/**/*.ts',
61 ],
62 rules: { 56 rules: {
63 // In a mobx-state-tree action, we assign to the properties of `self` to update the store. 57 // In a mobx-state-tree action, we assign to the properties of `self` to update the store.
64 'no-param-reassign': 'off', 58 'no-param-reassign': 'off',
@@ -67,10 +61,7 @@ module.exports = {
67 }, 61 },
68 }, 62 },
69 { 63 {
70 files: [ 64 files: ['**/__tests__/*.{ts,tsx}', '**/*.{spec,test}.{ts,tsx}'],
71 '**/__tests__/*.{ts,tsx}',
72 '**/*.{spec,test}.{ts,tsx}',
73 ],
74 rules: { 65 rules: {
75 // If a non-null assertion fails in a test, the test will also fail anyways. 66 // If a non-null assertion fails in a test, the test will also fail anyways.
76 '@typescript-eslint/no-non-null-assertion': 'off', 67 '@typescript-eslint/no-non-null-assertion': 'off',
@@ -79,21 +70,14 @@ module.exports = {
79 }, 70 },
80 }, 71 },
81 { 72 {
82 files: [ 73 files: ['**/*.js'],
83 '**/*.js',
84 ],
85 rules: { 74 rules: {
86 // ESM requires extensions for imports. 75 // ESM requires extensions for imports.
87 'import/extensions': [ 76 'import/extensions': ['error', 'ignorePackages'],
88 'error',
89 'ignorePackages',
90 ],
91 }, 77 },
92 }, 78 },
93 { 79 {
94 files: [ 80 files: ['**/*.cjs'],
95 '**/*.cjs',
96 ],
97 parserOptions: { 81 parserOptions: {
98 sourceType: 'script', 82 sourceType: 'script',
99 }, 83 },
@@ -102,10 +86,10 @@ module.exports = {
102 files: [ 86 files: [
103 '.electron-builder.config.cjs', 87 '.electron-builder.config.cjs',
104 'config/**/*.{cjs,js}', 88 'config/**/*.{cjs,js}',
105 'jest.config.js', 89 '*.config.{cjs,js}',
106 'scripts/**/*.js', 90 'scripts/**/*.js',
107 'packages/*/.eslintrc.cjs', 91 'packages/*/.eslintrc.cjs',
108 'packages/*/*.config.js', 92 'packages/*/*.config.{cjs,js}',
109 ], 93 ],
110 env: { 94 env: {
111 // Config files are never run in a browser (even in frontend projects). 95 // Config files are never run in a browser (even in frontend projects).
@@ -126,9 +110,7 @@ module.exports = {
126 }, 110 },
127 }, 111 },
128 { 112 {
129 files: [ 113 files: ['packages/*/*.config.{cjs,js}'],
130 'packages/*/*.config.js',
131 ],
132 rules: { 114 rules: {
133 // Allow relative imports of config files from the root package. 115 // Allow relative imports of config files from the root package.
134 'import/no-relative-packages': 'off', 116 'import/no-relative-packages': 'off',