-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
48 lines (48 loc) · 1.71 KB
/
.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* @Description: eslint配置
* @Author: Xiongjie.Xue([email protected])
* @Date: 2022-01-18 13:55:50
* @LastEditors: Xiongjie.Xue([email protected])
* @LastEditTime: 2024-01-02 11:30:19
*/
module.exports = {
parser: 'vue-eslint-parser',
parserOptions: {
parser: {
ts: '@typescript-eslint/parser', // eslint解析器,用于解析ts
js: 'espree',
'<template>': 'espree'
},
ecmaVersion: 'latest', // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
tsx: true, // Allows for the parsing of JSX
jsx: true
}
},
extends: [
// 'plugin:vue/base',
'plugin:vue/vue3-recommended', // vue-eslint-parser
'plugin:@typescript-eslint/recommended', // //定义文件继承的子规范 from the @typescript-eslint/eslint-plugin
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended' // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
// plugins: ['@typescript-eslint'], // 定义了该eslint文件所依赖的插件
env: {
browser: true,
node: true
},
globals: {
defineProps: 'readonly',
defineEmits: 'readonly',
defineExpose: 'readonly',
withDefaults: 'readonly'
},
rules: {
'vue/script-setup-uses-vars': 'error',
'vue/multi-word-component-names': 'off',
'vue/prefer-import-from-vue': 'warn',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'warn'
}
};