From 5d61ea00337208fa3f0f03198b512a69a8f19675 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 27 Dec 2024 02:02:38 +0800 Subject: [PATCH] refactor: use `scriptLangs` instead of `supportedScriptLangs` for more succint config --- README.md | 22 +++++++++++----------- examples/allow-js/eslint.config.js | 7 +------ examples/with-jsx-in-vue/eslint.config.js | 9 +-------- examples/with-tsx-in-vue/eslint.config.js | 7 +------ src/createConfig.ts | 18 +++++++++++++++--- src/internals.ts | 11 +++++------ src/utilities.ts | 15 +++++---------- 7 files changed, 39 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 7b0c2cf..63cf916 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ 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`). -- a Vue-specific config factory: `configureVueProject({ supportedScriptLangs, rootDir })`. More info below. +- a Vue-specific config factory: `configureVueProject({ scriptLangs, rootDir })`. More info below. ### Minimal Setup @@ -66,27 +66,27 @@ import { configureVueProject({ // Optional: specify the script langs in `.vue` files - // Defaults to `{ ts: true, js: false, tsx: false, jsx: false }` - supportedScriptLangs: { - ts: true, + // Defaults to `['ts']`. + scriptLangs: [ + 'ts', // [!DISCOURAGED] - // Set to `true` to allow plain `