Skip to content

Commit 94ec05d

Browse files
committed
feat(eslint-config): no-sparse-arrays off & adjust no-empty
1 parent 6fdb759 commit 94ec05d

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

packages/eslint-config/src/index.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ function factory({ ignores = [] }: FactoryOptions = {}) {
7070
ecmaVersion: 'latest',
7171
sourceType: 'module',
7272
globals: globals.browser,
73-
// parser: vueParser,
7473
parserOptions: {
7574
parser: tseslint.parser,
7675
ecmaVersion: 'latest',
@@ -92,17 +91,16 @@ function factory({ ignores = [] }: FactoryOptions = {}) {
9291
}
9392
},
9493
rules: {
95-
'no-console':
96-
process.env.NODE_ENV === 'production'
97-
? [
98-
'error',
94+
'no-console': [
95+
process.env.NODE_ENV === 'production' ? 'error' : 'warn',
9996
{
100-
allow: ['warn', 'error']
97+
allow: ['info', 'warn', 'error']
10198
}
102-
]
103-
: 'off',
104-
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
99+
],
100+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
105101
'no-return-assign': 'off',
102+
'no-sparse-arrays': 'off',
103+
'no-empty': ['error', { allowEmptyCatch: true }],
106104

107105
'import/no-mutable-exports': 'error',
108106
'import/order': [
@@ -220,6 +218,7 @@ function factory({ ignores = [] }: FactoryOptions = {}) {
220218
allowTaggedTemplates: true,
221219
}
222220
],
221+
'@typescript-eslint/no-empty-object-type': 'off',
223222

224223
'vue/eqeqeq': 'error',
225224
'vue/object-curly-spacing': ['error', 'always'],
@@ -271,7 +270,7 @@ function factory({ ignores = [] }: FactoryOptions = {}) {
271270
},
272271
},
273272
{
274-
files: ['**/*.{jsx,tsx}'],
273+
files: ['**/*.{jsx,tsx,vue}'],
275274
plugins: {
276275
react: reactPlugin,
277276
},
@@ -306,6 +305,15 @@ function factory({ ignores = [] }: FactoryOptions = {}) {
306305
'react/no-children-prop': 'off'
307306
},
308307
},
308+
{
309+
files: ['**/*.vue'],
310+
rules: {
311+
'no-unused-vars': 'off',
312+
'no-undef': 'off',
313+
'@typescript-eslint/no-unused-vars': 'off',
314+
'@typescript-eslint/consistent-type-imports': 'off'
315+
}
316+
},
309317
...jsoncPlugin.configs['flat/recommended-with-jsonc'],
310318
{
311319
files: ['**/*.{json,jsonc}'],

0 commit comments

Comments
 (0)