From f36a93bf4f7899db968a67c7c26b594caf9b18d9 Mon Sep 17 00:00:00 2001 From: Danil Shapilov Date: Fri, 8 Mar 2024 04:52:16 +0500 Subject: [PATCH] fix: prittier & eslint conflicting duo (cherry picked from commit 7d187993c2f39c7a2c377d69706601861a57a308) --- .eslintrc.js | 2 +- package.json | 5 ++- prettier.config.js | 96 +++++++++++++++++++++++----------------------- yarn.lock | 74 +++++++++++++++++++++++++++++------ 4 files changed, 114 insertions(+), 63 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 98f1fdf3c..35dd68914 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,7 +9,7 @@ module.exports = { parser: '@babel/eslint-parser', requireConfigFile: false, }, - extends: ['plugin:vue/essential', 'eslint:recommended'], + extends: ['plugin:vue/essential', 'eslint:recommended', 'plugin:prettier/recommended'], plugins: ['prettier'], rules: { 'linebreak-style': ['error', 'unix'], diff --git a/package.json b/package.json index 1f5de724e..e475c7dd9 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,8 @@ "core-js": "^3.35.0", "css-loader": "^6.9.0", "eslint": "^8.56.0", - "eslint-plugin-prettier": "^4.2.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-vue": "^9.20.1", "husky": "^8.0.3", "laravel-mix": "^6.0.49", @@ -89,7 +90,7 @@ "laravel-mix-sri": "^1.0.7", "laravel-mix-workbox": "^0.1.4", "postcss": "^8.4.31", - "prettier": "2.8.8", + "prettier": "3.2.5", "resolve-url-loader": "^5.0.0", "sass": "^1.70.0", "sass-loader": "^13.3.3", diff --git a/prettier.config.js b/prettier.config.js index e842ef860..d03da63a1 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -1,50 +1,50 @@ module.exports = { - printWidth: 120, - tabWidth: 4, - useTabs: false, - semi: true, - singleQuote: true, - trailingComma: 'all', - bracketSpacing: true, - arrowParens: 'avoid', - endOfLine: 'lf', - vueIndentScriptAndStyle: true, - overrides: [ - { - files: '*.js', - options: { - parser: 'babel', - }, - }, - { - files: '*.ts', - options: { - parser: 'typescript', - }, - }, - { - files: '*.md', - options: { - parser: 'markdown', - }, - }, - { - files: '*.json', - options: { - parser: 'json', - }, - }, - { - files: '.prettierrc', - options: { - parser: 'json', - }, - }, - { - files: '.stylelintrc', - options: { - parser: 'json', - }, - }, - ], + printWidth: 120, + tabWidth: 4, + useTabs: false, + semi: true, + singleQuote: true, + trailingComma: 'all', + bracketSpacing: true, + arrowParens: 'avoid', + endOfLine: 'lf', + vueIndentScriptAndStyle: true, + overrides: [ + { + files: '*.js', + options: { + parser: 'babel', + }, + }, + { + files: '*.ts', + options: { + parser: 'typescript', + }, + }, + { + files: '*.md', + options: { + parser: 'markdown', + }, + }, + { + files: '*.json', + options: { + parser: 'json', + }, + }, + { + files: '.prettierrc', + options: { + parser: 'json', + }, + }, + { + files: '.stylelintrc', + options: { + parser: 'json', + }, + }, + ], }; diff --git a/yarn.lock b/yarn.lock index 5794413e1..f3ea7dc3e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1337,7 +1337,8 @@ __metadata: css-loader: ^6.9.0 dotenv: ^16.4.2 eslint: ^8.56.0 - eslint-plugin-prettier: ^4.2.1 + eslint-config-prettier: ^9.1.0 + eslint-plugin-prettier: ^5.1.3 eslint-plugin-vue: ^9.20.1 fabric: ^5.3.0 husky: ^8.0.3 @@ -1358,7 +1359,7 @@ __metadata: moment-timezone: ^0.5.45 path-browserify: ^1.0.1 postcss: ^8.4.31 - prettier: 2.8.8 + prettier: 3.2.5 pusher-js: ^8.4.0-rc2 resolve-url-loader: ^5.0.0 sass: ^1.70.0 @@ -1914,6 +1915,13 @@ __metadata: languageName: node linkType: hard +"@pkgr/core@npm:^0.1.0": + version: 0.1.1 + resolution: "@pkgr/core@npm:0.1.1" + checksum: 6f25fd2e3008f259c77207ac9915b02f1628420403b2630c92a07ff963129238c9262afc9e84344c7a23b5cc1f3965e2cd17e3798219f5fd78a63d144d3cceba + languageName: node + linkType: hard + "@polka/url@npm:^1.0.0-next.20": version: 1.0.0-next.21 resolution: "@polka/url@npm:1.0.0-next.21" @@ -5025,18 +5033,34 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-prettier@npm:^4.2.1": - version: 4.2.1 - resolution: "eslint-plugin-prettier@npm:4.2.1" +"eslint-config-prettier@npm:^9.1.0": + version: 9.1.0 + resolution: "eslint-config-prettier@npm:9.1.0" + peerDependencies: + eslint: ">=7.0.0" + bin: + eslint-config-prettier: bin/cli.js + checksum: 9229b768c879f500ee54ca05925f31b0c0bafff3d9f5521f98ff05127356de78c81deb9365c86a5ec4efa990cb72b74df8612ae15965b14136044c73e1f6a907 + languageName: node + linkType: hard + +"eslint-plugin-prettier@npm:^5.1.3": + version: 5.1.3 + resolution: "eslint-plugin-prettier@npm:5.1.3" dependencies: prettier-linter-helpers: ^1.0.0 + synckit: ^0.8.6 peerDependencies: - eslint: ">=7.28.0" - prettier: ">=2.0.0" + "@types/eslint": ">=8.0.0" + eslint: ">=8.0.0" + eslint-config-prettier: "*" + prettier: ">=3.0.0" peerDependenciesMeta: + "@types/eslint": + optional: true eslint-config-prettier: optional: true - checksum: b9e839d2334ad8ec7a5589c5cb0f219bded260839a857d7a486997f9870e95106aa59b8756ff3f37202085ebab658de382b0267cae44c3a7f0eb0bcc03a4f6d6 + checksum: eb2a7d46a1887e1b93788ee8f8eb81e0b6b2a6f5a66a62bc6f375b033fc4e7ca16448da99380be800042786e76cf5c0df9c87a51a2c9b960ed47acbd7c0b9381 languageName: node linkType: hard @@ -5338,9 +5362,9 @@ __metadata: linkType: hard "fast-diff@npm:^1.1.2": - version: 1.2.0 - resolution: "fast-diff@npm:1.2.0" - checksum: 1b5306eaa9e826564d9e5ffcd6ebd881eb5f770b3f977fcbf38f05c824e42172b53c79920e8429c54eb742ce15a0caf268b0fdd5b38f6de52234c4a8368131ae + version: 1.3.0 + resolution: "fast-diff@npm:1.3.0" + checksum: d22d371b994fdc8cce9ff510d7b8dc4da70ac327bcba20df607dd5b9cae9f908f4d1028f5fe467650f058d1e7270235ae0b8230809a262b4df587a3b3aa216c3 languageName: node linkType: hard @@ -9058,7 +9082,16 @@ __metadata: languageName: node linkType: hard -"prettier@npm:2.8.8, prettier@npm:^1.18.2 || ^2.0.0": +"prettier@npm:3.2.5": + version: 3.2.5 + resolution: "prettier@npm:3.2.5" + bin: + prettier: bin/prettier.cjs + checksum: 2ee4e1417572372afb7a13bb446b34f20f1bf1747db77cf6ccaf57a9be005f2f15c40f903d41a6b79eec3f57fff14d32a20fb6dee1f126da48908926fe43c311 + languageName: node + linkType: hard + +"prettier@npm:^1.18.2 || ^2.0.0": version: 2.8.8 resolution: "prettier@npm:2.8.8" bin: @@ -10486,6 +10519,16 @@ __metadata: languageName: node linkType: hard +"synckit@npm:^0.8.6": + version: 0.8.8 + resolution: "synckit@npm:0.8.8" + dependencies: + "@pkgr/core": ^0.1.0 + tslib: ^2.6.2 + checksum: 9ed5d33abb785f5f24e2531efd53b2782ca77abf7912f734d170134552b99001915531be5a50297aa45c5701b5c9041e8762e6cd7a38e41e2461c1e7fccdedf8 + languageName: node + linkType: hard + "tapable@npm:^2.1.1, tapable@npm:^2.2.0": version: 2.2.1 resolution: "tapable@npm:2.2.1" @@ -10730,6 +10773,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:^2.6.2": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad + languageName: node + linkType: hard + "tty-browserify@npm:0.0.0": version: 0.0.0 resolution: "tty-browserify@npm:0.0.0"