From 3755a4cdb27eec421e644665e42b77c1ad28bcda Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 27 Dec 2024 00:36:26 +0800 Subject: [PATCH] feat: implement the new configuration format and pass all existing tests --- README.md | 21 ++-- package.json | 1 + pnpm-lock.yaml | 73 ++++++++++++- src/configs.ts | 44 ++++++++ src/createConfig.ts | 41 ++++++++ src/groupVueFiles.ts | 36 +++++++ src/index.ts | 238 ++----------------------------------------- src/internals.ts | 166 ++++++++++++++++++++++++++++++ src/shim.d.ts | 3 - src/utilities.ts | 189 ++++++++++++++++++++++++++++++++++ tsconfig.json | 2 +- 11 files changed, 568 insertions(+), 246 deletions(-) create mode 100644 src/configs.ts create mode 100644 src/createConfig.ts create mode 100644 src/groupVueFiles.ts create mode 100644 src/internals.ts delete mode 100644 src/shim.d.ts create mode 100644 src/utilities.ts diff --git a/README.md b/README.md index 631435e7..d7adb741 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ Because of the complexity of this config, it is exported as a factory function t This package exports: -- a utility function: `defineConfig`, whose type signature is the same as the [`config` function from `typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint#config). -- all the [shared configruations from `typescript-eslint`](https://typescript-eslint.io/users/configs), available as named exports (in camelCase, e.g. `recommendedTypeChecked`). +- `defineConfig`, a utility function whose type signature is the same as the [`config` function from `typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint#config). +- `configs`, contains all the [shared configruations from `typescript-eslint`](https://typescript-eslint.io/users/configs) (in camelCase, e.g. `configs.recommendedTypeChecked`). - a Vue-specific config factory: `configureVueProject({ supportedScriptLangs, rootDir })`. More info below. ### Minimal Setup @@ -40,12 +40,12 @@ This package exports: import pluginVue from 'eslint-plugin-vue' import { defineConfig, - recommended, + configs, } from '@vue/eslint-config-typescript' export default defineConfig( pluginVue.configs['flat/essential'], - recommended, + configs.recommended, ) ``` @@ -60,13 +60,18 @@ All the `