From e33db0bfffc7cfc3f2df5e78d9db59542da25908 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 27 Dec 2024 14:04:41 +0800 Subject: [PATCH] refactor!: rename `defineConfig` to `defineConfigWithVueTs`; `configs` to `vueTsConfigs` --- README.md | 28 +++++++++++------------ examples/allow-js/eslint.config.js | 8 +++---- examples/minimal/eslint.config.js | 8 +++---- examples/type-checked/eslint.config.js | 6 ++--- examples/with-cypress/eslint.config.js | 6 ++--- examples/with-jsx-in-vue/eslint.config.js | 10 ++++---- examples/with-jsx/eslint.config.js | 6 ++--- examples/with-nightwatch/eslint.config.js | 6 ++--- examples/with-playwright/eslint.config.js | 6 ++--- examples/with-prettier/eslint.config.js | 6 ++--- examples/with-tsx-in-vue/eslint.config.js | 10 ++++---- examples/with-tsx/eslint.config.js | 6 ++--- examples/with-vitest/eslint.config.js | 6 ++--- src/configs.ts | 4 ++-- src/createConfig.ts | 11 +++++---- src/index.ts | 10 ++++++-- src/utilities.ts | 4 ++-- 17 files changed, 75 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 63cf9160..e190d76e 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: -- `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`). +- `defineConfigWithVueTs`, a utility function whose type signature is the same as the [`config` function from `typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint#config), but will modify the given config to work with Vue.js + TypeScript. +- `vueTsConfigs`, 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({ scriptLangs, rootDir })`. More info below. ### Minimal Setup @@ -39,13 +39,13 @@ This package exports: // eslint.config.mjs import pluginVue from 'eslint-plugin-vue' import { - defineConfig, - configs, + defineConfigWithVueTs, + vueTsConfigs, } from '@vue/eslint-config-typescript' -export default defineConfig( +export default defineConfigWithVueTs( pluginVue.configs['flat/essential'], - configs.recommended, + vueTsConfigs.recommended, ) ``` @@ -59,9 +59,9 @@ All the `