chore: eslint.config.ts
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { includeIgnoreFile } from '@eslint/compat';
|
||||
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
|
||||
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript';
|
||||
import pluginImport from 'eslint-plugin-import-x';
|
||||
import oxlint from 'eslint-plugin-oxlint';
|
||||
import perfectionist from 'eslint-plugin-perfectionist';
|
||||
import pluginVue from 'eslint-plugin-vue';
|
||||
@ -11,8 +12,11 @@ const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const gitignorePath = path.resolve(__dirname, '.gitignore');
|
||||
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
||||
import { configureVueProject } from '@vue/eslint-config-typescript';
|
||||
|
||||
configureVueProject({ scriptLangs: ['ts', 'tsx', 'js', 'jsx'] });
|
||||
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
|
||||
|
||||
@ -43,18 +47,11 @@ export default defineConfigWithVueTs(
|
||||
oxlint.configs['flat/recommended'],
|
||||
skipFormatting,
|
||||
|
||||
importPluginConfig(),
|
||||
{
|
||||
rules: {
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
// 'vue/block-lang': [
|
||||
// 'error',
|
||||
// {
|
||||
// script: {
|
||||
// allowNoLang: true,
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
'vue/block-order': [
|
||||
'error',
|
||||
{
|
||||
@ -67,7 +64,6 @@ export default defineConfigWithVueTs(
|
||||
order: ['defineOptions', 'defineProps', 'defineEmits', 'defineSlots'],
|
||||
},
|
||||
],
|
||||
'import/newline-after-import': 'error',
|
||||
},
|
||||
},
|
||||
|
||||
@ -81,3 +77,24 @@ export default defineConfigWithVueTs(
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
function importPluginConfig(): Linter.Config[] {
|
||||
return [
|
||||
{
|
||||
plugins: {
|
||||
// @ts-expect-error - This is a dynamic import
|
||||
import: pluginImport,
|
||||
},
|
||||
rules: {
|
||||
// 'import/first': 'error',
|
||||
'import/newline-after-import': 'error',
|
||||
// 'import/no-duplicates': 'error',
|
||||
// 'import/no-mutable-exports': 'error',
|
||||
// 'import/no-named-default': 'error',
|
||||
// 'import/no-self-import': 'error',
|
||||
// 'import/no-unresolved': 'off',
|
||||
// 'import/no-webpack-loader-syntax': 'error',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user