From 27caf5f72bdedab7ce3163b04e7312114635e945 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 26 Dec 2024 02:07:58 +0800 Subject: [PATCH] docs: initial idea of a more intuitive config --- README.md | 54 +++++++++++++----------------------------------------- 1 file changed, 13 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index ac2de351..ea4d97b2 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,11 @@ Please also make sure that you have `typescript` and `eslint` installed. Because of the complexity of this config, it is exported as a factory function that takes an options object and returns an ESLint configuration object. -This package exports 2 utility functions: +This package exports: -- `defineConfig`, as a re-export of the [`config` function from `typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint#config). -- `createConfig`, used for creating an ESLint configuration array that extends from the [`typescript-eslint` shared configs](https://typescript-eslint.io/users/configs). +- a utility function: `defineConfig`, as a re-export of 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`). +- a Vue-specific config factory: `configureVueProject({ supportedScriptLangs, rootDir })`. More info below. ### Minimal Setup @@ -39,12 +40,12 @@ This package exports 2 utility functions: import pluginVue from 'eslint-plugin-vue' import { defineConfig, - createConfig as vueTsEslintConfig, + recommended, } from '@vue/eslint-config-typescript' export default defineConfig( pluginVue.configs['flat/essential'], - vueTsEslintConfig(), + recommended, ) ``` @@ -59,26 +60,14 @@ All the `