feat: 更新 ESLint 配置,支持更多语言,调整 npm 镜像源
This commit is contained in:
1
.npmrc
1
.npmrc
@ -7,6 +7,7 @@ registry=https://nexus.oo1.dev/repository/npm/
|
||||
# https://pnpm.io/zh/npmrc#node-mirrorltreleasedir
|
||||
use-node-version=22.13.0
|
||||
node-mirror:release=https://npmmirror.com/mirrors/node/ # pnpm config set node-mirror:release=https://npmmirror.com/mirrors/node/
|
||||
node-mirror:release=https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/
|
||||
node-mirror:rc=https://npmmirror.com/mirrors/node-rc/
|
||||
node-mirror:nightly=https://npmmirror.com/mirrors/node-nightly/
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { includeIgnoreFile } from '@eslint/compat';
|
||||
import pluginVitest from '@vitest/eslint-plugin';
|
||||
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
|
||||
import vueTsEslintConfig from '@vue/eslint-config-typescript';
|
||||
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript';
|
||||
import oxlint from 'eslint-plugin-oxlint';
|
||||
import perfectionist from 'eslint-plugin-perfectionist';
|
||||
import pluginVue from 'eslint-plugin-vue';
|
||||
@ -12,10 +12,12 @@ const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const gitignorePath = path.resolve(__dirname, '.gitignore');
|
||||
|
||||
/**
|
||||
* @type import('eslint').Linter.Config[]
|
||||
*/
|
||||
export default [
|
||||
// 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
|
||||
|
||||
export default defineConfigWithVueTs(
|
||||
includeIgnoreFile(gitignorePath), // oxlint . --fix -D correctness --ignore-path .gitignore
|
||||
{
|
||||
name: 'app/files-to-lint',
|
||||
@ -27,14 +29,18 @@ export default [
|
||||
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
|
||||
},
|
||||
|
||||
...pluginVue.configs['flat/essential'],
|
||||
...vueTsEslintConfig({ supportedScriptLangs: { ts: true, tsx: true, js: true, jsx: true } }),
|
||||
pluginVue.configs['flat/essential'],
|
||||
vueTsConfigs.recommended,
|
||||
|
||||
{
|
||||
...pluginVitest.configs.recommended,
|
||||
files: ['src/**/__tests__/*'],
|
||||
},
|
||||
|
||||
// {
|
||||
// ...pluginCypress.configs.recommended,
|
||||
// files: ['cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}', 'cypress/support/**/*.{js,ts,jsx,tsx}'],
|
||||
// },
|
||||
oxlint.configs['flat/recommended'],
|
||||
skipFormatting,
|
||||
|
||||
@ -62,4 +68,4 @@ export default [
|
||||
'perfectionist/sort-imports': ['error'],
|
||||
},
|
||||
},
|
||||
];
|
||||
);
|
@ -6,6 +6,7 @@
|
||||
"cypress.config.*",
|
||||
"nightwatch.conf.*",
|
||||
"playwright.config.*",
|
||||
"eslint.config.*",
|
||||
"fake/**/*"
|
||||
],
|
||||
"compilerOptions": {
|
||||
|
Reference in New Issue
Block a user