diff --git a/.npmrc b/.npmrc index 011df7f..42372c2 100644 --- a/.npmrc +++ b/.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/ diff --git a/eslint.config.js b/eslint.config.ts similarity index 68% rename from eslint.config.js rename to eslint.config.ts index 5afe7aa..593ff97 100644 --- a/eslint.config.js +++ b/eslint.config.ts @@ -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'], }, }, -]; +); diff --git a/tsconfig.node.json b/tsconfig.node.json index d800a9f..ac0d7e7 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -6,6 +6,7 @@ "cypress.config.*", "nightwatch.conf.*", "playwright.config.*", + "eslint.config.*", "fake/**/*" ], "compilerOptions": {