37 lines
917 B
JavaScript
37 lines
917 B
JavaScript
module.exports = {
|
|
env: {
|
|
browser: true,
|
|
es2021: true,
|
|
node: true
|
|
},
|
|
extends: [
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:vue/vue3-essential',
|
|
'plugin:prettier/recommended' // 后续兼容prettier
|
|
],
|
|
overrides: [
|
|
{
|
|
env: {
|
|
node: true
|
|
},
|
|
files: ['.eslintrc.{js,cjs}'],
|
|
parserOptions: {
|
|
sourceType: 'script'
|
|
}
|
|
}
|
|
],
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
parser: '@typescript-eslint/parser',
|
|
sourceType: 'module'
|
|
},
|
|
plugins: ['@typescript-eslint', 'vue'],
|
|
rules: {
|
|
// Switch语句 https://zh-hans.eslint.org/docs/latest/rules/indent#switchcase
|
|
indent: ['error', 2, { SwitchCase: 1 }],
|
|
'linebreak-style': ['error', 'windows'],
|
|
quotes: ['error', 'single'],
|
|
semi: ['error', 'never']
|
|
}
|
|
} |