feat: 前端组件准备
This commit is contained in:
+52
-2
@@ -1,6 +1,56 @@
|
||||
// @ts-check
|
||||
import tsParser from '@typescript-eslint/parser'
|
||||
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
||||
import vueParser from 'vue-eslint-parser'
|
||||
import withNuxt from './.nuxt/eslint.config.mjs'
|
||||
|
||||
export default withNuxt(
|
||||
// Your custom configs here
|
||||
)
|
||||
// .ts/.tsx 文件直接使用 TypeScript parser
|
||||
{
|
||||
files: ['**/*.ts', '**/*.tsx'],
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// .vue 文件:顶层用 vue-eslint-parser,<script> 块内用 ts parser
|
||||
{
|
||||
files: ['**/*.vue'],
|
||||
languageOptions: {
|
||||
parser: vueParser,
|
||||
parserOptions: {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// import 自动排序
|
||||
{
|
||||
plugins: {
|
||||
'simple-import-sort': simpleImportSort,
|
||||
},
|
||||
rules: {
|
||||
'simple-import-sort/imports': 'error',
|
||||
'simple-import-sort/exports': 'error',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
files: ['**/type.ts', '**/types.ts', '**/*.d.ts'],
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
},
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user