|
1 |
| -# Deprecated |
2 |
| - |
3 |
| -Please [use `eslint-plugin-prettier` directly](https://github.com/prettier/eslint-plugin-prettier#recommended-configuration). |
4 |
| - |
5 |
| -To migrate from `@vue/eslint-config-prettier`: |
6 |
| -1. `npm add -D eslint-config-prettier eslint-plugin-prettier` |
7 |
| -2. `npm remove @vue/eslint-config-prettier` |
8 |
| -3. Change `@vue/prettier` to `plugin:prettier/recommended` in your ESLint configuration |
9 |
| -4. If there's `@vue/prettier/@typescript-eslint` in the existing configuration, remove it. |
10 |
| - |
11 | 1 | # @vue/eslint-config-prettier
|
12 | 2 |
|
13 |
| -> eslint-config-prettier for Vue CLI |
| 3 | +> eslint-config-prettier for Vue |
14 | 4 |
|
15 |
| -This config is specifically designed to be used by Vue CLI setups |
| 5 | +This config is specifically designed to be used by `@vue/cli` & `create-vue` setups |
16 | 6 | and is not meant for outside use (it can be used but some adaptations
|
17 | 7 | on the user side might be needed - for details see the config file).
|
18 | 8 |
|
19 | 9 | A part of its design is that this config may implicitly depend on
|
20 |
| -other parts of Vue CLI setups, such as `eslint-plugin-vue` being |
21 |
| -extended in the same resulting config. |
| 10 | +other parts of `@vue/cli`/`create-vue` setups. |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +In order to work around [a known limitation in ESLint](https://github.com/eslint/eslint/issues/3458), we recommend you to use this package alongside `@rushstack/eslint-patch`, so that you don't have to install too many dependencies: |
| 15 | + |
| 16 | +```sh |
| 17 | +npm add --dev @vue/eslint-config-prettier @rushstack/eslint-patch |
| 18 | +``` |
| 19 | + |
| 20 | +Please also make sure that you have `prettier` and `eslint` installed. |
| 21 | + |
| 22 | +## Usage |
| 23 | + |
| 24 | +Add `"@vue/eslint-config-prettier"` to the `"extends"` array in your `.eslintrc.cjs` file. Make sure to put it **last**, so it gets the chance to override other configs. |
| 25 | + |
| 26 | +```js |
| 27 | +require("@rushstack/eslint-patch/modern-module-resolution") |
| 28 | + |
| 29 | +module.exports = { |
| 30 | + extends: [ |
| 31 | + // ... other configs |
| 32 | + "@vue/eslint-config-prettier" |
| 33 | + ] |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +## Further Reading |
| 38 | + |
| 39 | +The default config is based on the recommended configuration of [`eslint-plugin-prettier`](https://github.com/prettier/eslint-plugin-prettier/#recommended-configuration), which also depends on [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier). Please refer to their corresponding documentations for more implementation details. |
0 commit comments