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

feat: replace@vue/eslint-config-prettier with eslint-config-prettier #6791

Merged
merged 2 commits into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/migrations/migrate-from-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ The [`transpileDependencies` option](../config/#transpiledependencies) now accep

* `eslint-loader` is replaced by [eslint-webpack-plugin](https://github.com/webpack-contrib/eslint-webpack-plugin), dropping support for ESLint <= 6.
* New projects are now generated with `eslint-plugin-vue` v7, see its [release notes](https://github.com/vuejs/eslint-plugin-vue/releases/tag/v7.0.0) for breaking changes.
* `@vue/eslint-config-prettier` is deprecated. See <https://github.com/vuejs/eslint-config-prettier> for the migration guide.

### PWA Plugin

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1",
"@vue/eslint-config-airbnb": "^5.3.0",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-standard": "^6.1.0",
"@vue/eslint-config-typescript": "^7.0.0",
"@vuepress/plugin-pwa": "^1.8.1",
Expand All @@ -45,10 +44,11 @@
"chromedriver": "^94.0.0",
"debug": "^4.1.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-graphql": "^4.0.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.6.0",
"geckodriver": "^2.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ test('prettier', async () => {
expect(pkg.eslintConfig.extends).toEqual([
'plugin:vue/essential',
'eslint:recommended',
'@vue/prettier'
'plugin:prettier/recommended'
])
expect(pkg.devDependencies).toHaveProperty('@vue/eslint-config-prettier')
expect(pkg.devDependencies).toHaveProperty('eslint-config-prettier')
expect(pkg.devDependencies).toHaveProperty('eslint-plugin-prettier')
})

test('babel', async () => {
Expand Down Expand Up @@ -127,10 +128,10 @@ test('typescript', async () => {
'plugin:vue/essential',
'eslint:recommended',
'@vue/typescript/recommended',
'@vue/prettier',
'@vue/prettier/@typescript-eslint'
'plugin:prettier/recommended'
])
expect(pkg.devDependencies).toHaveProperty('@vue/eslint-config-prettier')
expect(pkg.devDependencies).toHaveProperty('eslint-config-prettier')
expect(pkg.devDependencies).toHaveProperty('eslint-plugin-prettier')
expect(pkg.devDependencies).toHaveProperty('@vue/eslint-config-typescript')
})

Expand Down
6 changes: 3 additions & 3 deletions packages/@vue/cli-plugin-eslint/eslintDeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const DEPS_MAP = {
'eslint-plugin-import': '^2.20.2'
},
prettier: {
'@vue/eslint-config-prettier': '^6.0.0',
'eslint-plugin-prettier': '^3.3.1',
prettier: '^2.2.1'
'eslint-config-prettier': '^8.3.0',
'eslint-plugin-prettier': '^4.0.0',
prettier: '^2.4.1'
},
standard: {
'@vue/eslint-config-standard': '^6.1.0',
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-eslint/eslintOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports.config = (api, preset, rootOptions = {}) => {
} else if (preset === 'standard') {
config.extends.push('@vue/standard')
} else if (preset === 'prettier') {
config.extends.push(...['eslint:recommended', '@vue/prettier'])
config.extends.push(...['eslint:recommended', 'plugin:prettier/recommended'])
} else {
// default
config.extends.push('eslint:recommended')
Expand All @@ -34,7 +34,7 @@ exports.config = (api, preset, rootOptions = {}) => {
// but that is not the case for prettier, as there are conflicting rules
if (preset === 'prettier') {
config.extends.pop()
config.extends.push(...['@vue/typescript/recommended', '@vue/prettier', '@vue/prettier/@typescript-eslint'])
config.extends.push(...['@vue/typescript/recommended', 'plugin:prettier/recommended'])
} else {
config.extends.push('@vue/typescript/recommended')
}
Expand Down
3 changes: 2 additions & 1 deletion packages/@vue/cli-plugin-eslint/migrator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = async (api) => {
api.exitLog(`ESLint upgraded from v${localESLintMajor}. to v7\n`)

// TODO:
// transform `@vue/prettier` to `eslint:recommended` + `@vue/prettier`
// transform `@vue/prettier` to `eslint:recommended` + `plugin:prettier/recommended`
// remove `@vue/prettier/@typescript-eslint`
// transform `@vue/typescript` to `@vue/typescript/recommended` and also fix prettier compatibility for it
}
30 changes: 8 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4017,13 +4017,6 @@
eslint-import-resolver-webpack "^0.13.0"
eslint-plugin-import "^2.21.2"

"@vue/eslint-config-prettier@^6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@vue/eslint-config-prettier/-/eslint-config-prettier-6.0.0.tgz#ad5912b308f4ae468458e02a2b05db0b9d246700"
integrity sha512-wFQmv45c3ige5EA+ngijq40YpVcIkAy0Lihupnsnd1Dao5CBbPyfCzqtejFLZX1EwH/kCJdpz3t6s+5wd3+KxQ==
dependencies:
eslint-config-prettier "^6.0.0"

"@vue/eslint-config-standard@^6.1.0":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@vue/eslint-config-standard/-/eslint-config-standard-6.1.0.tgz#b362ba67c86caa4e7b44481c2303c9dccc2dc037"
Expand Down Expand Up @@ -9617,12 +9610,10 @@ eslint-config-airbnb-base@^14.0.0:
object.assign "^4.1.2"
object.entries "^1.1.2"

eslint-config-prettier@^6.0.0:
version "6.15.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9"
integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==
dependencies:
get-stdin "^6.0.0"
eslint-config-prettier@^8.3.0:
version "8.3.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a"
integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==

eslint-config-standard@^16.0.3:
version "16.0.3"
Expand Down Expand Up @@ -9728,10 +9719,10 @@ eslint-plugin-node@^11.1.0:
resolve "^1.10.1"
semver "^6.1.0"

eslint-plugin-prettier@^3.3.1:
version "3.4.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5"
integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==
eslint-plugin-prettier@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0"
integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==
dependencies:
prettier-linter-helpers "^1.0.0"

Expand Down Expand Up @@ -11017,11 +11008,6 @@ get-proxy@^2.0.0:
dependencies:
npm-conf "^1.1.0"

get-stdin@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==

get-stream@3.0.0, get-stream@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
Expand Down