Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add basic config for new ESLint v9 flat configs #2522

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions docs/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,49 @@ export default [

See [the rule list](../rules/index.md) to get the `configs` & `rules` that this plugin provides.

#### Configurations with `typescript-esLint` & Prettier (`eslint.config.js`)

```bash
npm install --save-dev eslint eslint-config-prettier eslint-plugin-vue globals typescript-eslint
```

```ts
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import globals from 'globals';
import pluginVue from 'eslint-plugin-vue';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['*.d.ts', '**/coverage', '**/dist'],
},
{
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/recommended'],
],
plugins: {
'@typescript-eslint': tseslint.plugin,
},
files: ['**/*.{ts,vue}'],
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
globals: globals.browser,
parserOptions: {
parser: tseslint.parser,
},
},
rules: {
// your rules
},
},
eslintConfigPrettier
);
```

#### Bundle Configurations (`eslint.config.js`)

This plugin provides some predefined configs.
Expand Down