first commit
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
es2022: true,
|
||||
},
|
||||
parser: 'vue-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint'],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:vue/vue3-recommended',
|
||||
'prettier',
|
||||
'./.eslintrc-auto-import.json',
|
||||
],
|
||||
rules: {
|
||||
// Vue
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'vue/component-api-style': ['error', ['script-setup']],
|
||||
'vue/attributes-order': 'warn',
|
||||
'vue/no-v-html': 'warn',
|
||||
'vue/block-lang': [
|
||||
'error',
|
||||
{ script: { lang: 'ts' }, style: { lang: 'scss', allowNoLang: true } },
|
||||
],
|
||||
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
|
||||
|
||||
// TypeScript
|
||||
'@typescript-eslint/no-explicit-any': 'error',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
||||
],
|
||||
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
|
||||
|
||||
// 通用
|
||||
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
||||
'no-debugger': 'error',
|
||||
eqeqeq: ['error', 'smart'],
|
||||
'prefer-const': 'error',
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['mock/**/*.ts', 'vite.config.ts', '.eslintrc.cjs', '.prettierrc.cjs'],
|
||||
env: { node: true, browser: false },
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user