代码拉取完成,页面将自动刷新
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginVue from 'eslint-plugin-vue'
export default tseslint.config(
{ ignores: ['**/node_modules', '**/dist'] },
eslint.configs.recommended,
tseslint.configs.base,
...pluginVue.configs['flat/recommended'],
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
},
{
rules: {
'no-debugger': 'error',
'no-console': ['error', { allow: ['warn', 'error', 'info', 'clear'] }],
'no-unused-vars': 'off',
'no-undef': 'off',
'prefer-const': 'error',
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'no-duplicate-imports': 'error',
// This rule enforces the preference for using '@ts-expect-error' comments in TypeScript
// code to indicate intentional type errors, improving code clarity and maintainability.
'@typescript-eslint/prefer-ts-expect-error': 'error',
// Enforce the use of 'import type' for importing types
'@typescript-eslint/consistent-type-imports': [
'error',
{
fixStyle: 'inline-type-imports',
disallowTypeAnnotations: false,
},
],
// Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers
'@typescript-eslint/no-import-type-side-effects': 'error',
'vue/max-attributes-per-line': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/multi-word-component-names': 'off',
'vue/html-self-closing': [
'error',
{
html: { component: 'always', normal: 'always', void: 'any' },
math: 'always',
svg: 'always',
},
],
},
},
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。