Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/eslint-config-typescript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4da1a33b8b0a6264923eb072a8aa247ceee443cf
Choose a base ref
..
head repository: vuejs/eslint-config-typescript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 86db36e589eb1298b55706f9a0d32cbf8d3df98b
Choose a head ref
Showing with 31 additions and 5 deletions.
  1. +31 −5 README.md
36 changes: 31 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -101,16 +101,42 @@ export default [
]
```

### Linting with Type Information

Some `typescript-eslint` rules utilizes type information to provide deeper insights into your code.
But type-checking is a much slower process than linting with only syntax information.
It is not always easy to set up the type-checking environment for ESLint without severe performance penalties.

So we don't recommend you to configure individual type-aware rules and the corresponding language options all by yourself.
Instead, you can start by extending from the `recommendedTypeChecked` configuration and then turn on/off the rules you need.

```js
// eslint.config.mjs
import pluginVue from "eslint-plugin-vue";
import vueTsEslintConfig from "@vue/eslint-config-typescript";

export default [
...pluginVue.configs["flat/essential"],
...vueTsEslintConfig({ extends: ['recommendedTypeChecked'] }),
{
files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.vue'],
rules: {
// Turn off the recommended rules that you don't need.
'@typescript-eslint/no-redundant-type-constituents': 'off',

// Turn on other rules that you need.
'@typescript-eslint/require-array-sort-compare': 'error'
}
]
```
## Further Reading
TODO
- [All the extendable configurations from `typescript-eslint`](https://typescript-eslint.io/users/configs).
- [All the available rules from `typescript-eslint`](https://typescript-eslint.io/rules/).
### With Other Community Configs
Work-In-Progress.
~~If you are following the [`standard`](https://standardjs.com/) or [`airbnb`](https://github.com/airbnb/javascript/) style guides, don't manually extend from this package. Please use `@vue/eslint-config-standard-with-typescript` or `@vue/eslint-config-airbnb-with-typescript` instead.~~

## Migrating from `.eslintrc.cjs`

TODO