From cd6adbaddeb2bfd22f12bdb1d13f7d59877dc6f0 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Tue, 6 Feb 2024 16:16:22 -0800 Subject: [PATCH] Upgrade prettier and eslint compatibility libraries to latest (#7478) * chore: upgrade prettier and eslint libraries to latest - upgrade prettier - upgrade eslint - upgrade eslint-plugin-prettier - upgrade eslint-config-prettier * chore: run lint:fix * chore: add `prettier-eslint` devDependency - The `prettier-eslint` vscode plugin sinc v6.0.0 no longer provides this package so we must install it as a devDependency so that autoformat works. * chore: add recommended extensions file for vscode users * Update extensions.json * Revert "Update extensions.json" This reverts commit 942f341a75abf68842a0d6e3a1d5092bc9f00c51. --------- Co-authored-by: John Hill --- .vscode/extensions.json | 14 +++++++++++++ package.json | 9 +++++---- .../src/DeviceMatchersSpec.js | 20 +++++++++---------- 3 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..24ebdbe6fb --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,14 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "Vue.volar", + "Vue.vscode-typescript-vue-plugin", + "dbaeumer.vscode-eslint", + "rvest.vs-code-prettier-eslint" + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": ["octref.vetur"] +} diff --git a/package.json b/package.json index 51c1c02e74..062d7a9865 100644 --- a/package.json +++ b/package.json @@ -28,12 +28,12 @@ "d3-axis": "3.0.0", "d3-scale": "4.0.2", "d3-selection": "3.0.0", - "eslint": "8.54.0", - "eslint-config-prettier": "9.0.0", + "eslint": "8.56.0", + "eslint-config-prettier": "9.1.0", "eslint-plugin-compat": "4.2.0", "eslint-plugin-no-unsanitized": "4.0.2", "eslint-plugin-playwright": "0.12.0", - "eslint-plugin-prettier": "4.2.1", + "eslint-plugin-prettier": "5.1.3", "eslint-plugin-simple-import-sort": "10.0.0", "eslint-plugin-unicorn": "49.0.0", "eslint-plugin-vue": "9.18.1", @@ -67,7 +67,8 @@ "painterro": "1.2.87", "plotly.js-basic-dist-min": "2.20.0", "plotly.js-gl2d-dist-min": "2.20.0", - "prettier": "2.8.7", + "prettier": "3.2.5", + "prettier-eslint": "16.3.0", "printj": "1.3.1", "resolve-url-loader": "5.0.0", "sanitize-html": "2.11.0", diff --git a/src/plugins/DeviceClassifier/src/DeviceMatchersSpec.js b/src/plugins/DeviceClassifier/src/DeviceMatchersSpec.js index 00c3e722d4..3cd676ac66 100644 --- a/src/plugins/DeviceClassifier/src/DeviceMatchersSpec.js +++ b/src/plugins/DeviceClassifier/src/DeviceMatchersSpec.js @@ -46,14 +46,14 @@ describe('DeviceMatchers', function () { return 'is' + deviceType[0].toUpperCase() + deviceType.slice(1); } - ['mobile', 'phone', 'tablet', 'landscape', 'portrait', 'landscape', 'touch'].forEach(function ( - deviceType - ) { - it('detects when a device is a ' + deviceType + ' device', function () { - mockAgent[method(deviceType)].and.returnValue(true); - expect(DeviceMatchers[deviceType](mockAgent)).toBe(true); - mockAgent[method(deviceType)].and.returnValue(false); - expect(DeviceMatchers[deviceType](mockAgent)).toBe(false); - }); - }); + ['mobile', 'phone', 'tablet', 'landscape', 'portrait', 'landscape', 'touch'].forEach( + function (deviceType) { + it('detects when a device is a ' + deviceType + ' device', function () { + mockAgent[method(deviceType)].and.returnValue(true); + expect(DeviceMatchers[deviceType](mockAgent)).toBe(true); + mockAgent[method(deviceType)].and.returnValue(false); + expect(DeviceMatchers[deviceType](mockAgent)).toBe(false); + }); + } + ); });