Skip to content

Commit f2118a0

Browse files
committed
chore: wtf eslint
1 parent 1c9b805 commit f2118a0

File tree

2 files changed

+40
-33
lines changed

2 files changed

+40
-33
lines changed

.eslintrc.cjs

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,19 @@ module.exports = {
112112
'@typescript-eslint/prefer-enum-initializers': 0,
113113
'@typescript-eslint/no-namespace': 0,
114114
'import/dynamic-import-chunkname': 0,
115+
'@stylistic/indent': 0,
116+
117+
'@stylistic/max-len': [0, { code: 100, ignoreComments: true }],
118+
'@stylistic/comma-dangle': [0, "always"],
119+
'prettier/prettier': [
120+
'error',
121+
{
122+
"printWidth": 100,
123+
"trailingComma": "all",
124+
"singleQuote": true,
125+
"tabWidth":2
126+
},
127+
],
115128

116129
'unused-imports/no-unused-imports-ts': 2,
117130
'@typescript-eslint/no-unused-vars': 2,
@@ -144,33 +157,36 @@ module.exports = {
144157
},
145158
],
146159
},
147-
},
148-
// JS client rules
149-
{
150-
files: ['clients/algoliasearch-client-javascript/packages/**/*.ts'],
151160

152-
parserOptions: {
153-
tsconfigRootDir: __dirname,
154-
project: './clients/algoliasearch-client-javascript/tsconfig.json',
155-
},
161+
overrides: [
162+
// JS client rules
163+
{
164+
files: ['clients/algoliasearch-client-javascript/packages/**/*.ts'],
156165

157-
rules: {
158-
// For a wider browser support (IE>=11), we forbid those two
159-
'no-restricted-syntax': [
160-
'error',
161-
{
162-
selector: "LogicalExpression[operator='??']",
163-
message:
164-
'For wider browser support, nullish coalescing operator is not allowed.',
166+
parserOptions: {
167+
tsconfigRootDir: __dirname,
168+
project: './clients/algoliasearch-client-javascript/tsconfig.json',
165169
},
166-
{
167-
selector: 'ChainExpression',
168-
message:
169-
'For wider browser support, optional chaining is not allowed.',
170+
171+
rules: {
172+
// For a wider browser support (IE>=11), we forbid those two
173+
'no-restricted-syntax': [
174+
'error',
175+
{
176+
selector: "LogicalExpression[operator='??']",
177+
message:
178+
'For wider browser support, nullish coalescing operator is not allowed.',
179+
},
180+
{
181+
selector: 'ChainExpression',
182+
message:
183+
'For wider browser support, optional chaining is not allowed.',
184+
},
185+
],
186+
'@typescript-eslint/prefer-optional-chain': 0,
170187
},
171-
],
172-
'@typescript-eslint/prefer-optional-chain': 0,
173-
},
188+
},
189+
]
174190
},
175191
{
176192
files: ['*.json'],

scripts/.eslintrc.cjs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
ignorePatterns: ['*.test.ts', '**.yml', 'tsconfig.json'],
33

4-
parser: '@typescript-eslint/parser',
4+
extends: "../.eslintrc.cjs",
55

66
parserOptions: {
77
ecmaVersion: 'latest',
@@ -22,15 +22,6 @@ module.exports = {
2222
},
2323

2424
rules: {
25-
'@stylistic/max-len': [0, { code: 100, ignoreComments: true }],
26-
'prettier/prettier': [
27-
'error',
28-
{
29-
singleQuote: true,
30-
printWidth: 100,
31-
trailingComma: 'all',
32-
},
33-
],
3425
'import/extensions': [
3526
2,
3627
'ignorePackages',

0 commit comments

Comments
 (0)