1 Star 0 Fork 0

RHQYZ/x.naive-ui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
eslint.config.js 3.29 KB
一键复制 编辑 原始数据 按行查看 历史
RHQYZ 提交于 2025-02-05 19:04 +08:00 . build: use eslint-plugin-import
import eslintVuePrettierConfig from '@vue/eslint-config-prettier';
import eslintVueStandardConfig from '@vue/eslint-config-standard';
import { defineConfigWithVueTs, vueTsConfigs as eslintVueTsConfigs } from '@vue/eslint-config-typescript';
import { flatConfigs as eslintImportConfigs } from 'eslint-plugin-import';
import eslintVuePlugin from 'eslint-plugin-vue';
/**
* @type {import("eslint").Linter.Config[]}
*/
export default [
{
ignores: ['/dist/**', '/es/**', '/lib/**', '**/*.vuecode']
},
...eslintVueStandardConfig,
...eslintVuePlugin.configs['flat/essential'],
...defineConfigWithVueTs(eslintVueTsConfigs.recommended),
eslintVuePrettierConfig,
eslintImportConfigs.recommended,
{
name: 'my-eslint-config/overrides',
rules: {
'indent': ['error', 2, { SwitchCase: 1 }],
'linebreak-style': ['warn', 'windows'],
'max-len': ['warn', 160],
'no-console': 'off',
'no-extra-boolean-cast': 'off',
'prettier/prettier': ['warn', { trailingComma: 'none' }],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
varsIgnorePattern: '^__',
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
]
}
},
{
name: 'my-eslint-config/import-sort',
rules: {
'import/named': 'off',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': 'off',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling'], 'index'],
pathGroups: [
{
pattern: 'vue*',
group: 'external',
position: 'before'
},
{
pattern: 'vue/**',
group: 'external',
position: 'before'
},
{
pattern: 'vue-*',
group: 'external',
position: 'before'
},
{
pattern: 'vue-*/**',
group: 'external',
position: 'before'
},
{
pattern: '@vue*/**',
group: 'external',
position: 'before'
},
{
pattern: '~/**',
group: 'external',
position: 'after'
},
{
pattern: '@/**',
group: 'internal',
position: 'before'
}
],
pathGroupsExcludedImportTypes: ['builtin'],
alphabetize: {
order: 'asc',
caseInsensitive: true
}
}
],
'sort-imports': [
'error',
{
ignoreDeclarationSort: true
}
]
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
}
}
}
];
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/fudiwei/x.naive-ui.git
git@gitee.com:fudiwei/x.naive-ui.git
fudiwei
x.naive-ui
x.naive-ui
main

搜索帮助