From 9bebfe88cc5edae320c53a16478ba1b509213855 Mon Sep 17 00:00:00 2001 From: Josh Adam Date: Sun, 26 Jun 2022 21:10:37 -0500 Subject: [PATCH 1/3] Updated eslint prettier config so they work better together --- src/main/webapp/.eslintrc.js | 2 +- src/main/webapp/package.json | 1 + src/main/webapp/yarn.lock | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/.eslintrc.js b/src/main/webapp/.eslintrc.js index d8a2cb29c17..36e0a852d64 100644 --- a/src/main/webapp/.eslintrc.js +++ b/src/main/webapp/.eslintrc.js @@ -15,7 +15,7 @@ module.exports = { "plugin:react-hooks/recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", - "prettier", + "plugin:prettier/recommended", ], parserOptions: { ecmaFeatures: { diff --git a/src/main/webapp/package.json b/src/main/webapp/package.json index bdd8040035b..1796829dd33 100644 --- a/src/main/webapp/package.json +++ b/src/main/webapp/package.json @@ -108,6 +108,7 @@ "eslint": "^8.13.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-jsx-a11y": "^6.5.1", + "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-react": "^7.29.4", "eslint-plugin-react-hooks": "^4.4.0", "expose-loader": "^3.1.0", diff --git a/src/main/webapp/yarn.lock b/src/main/webapp/yarn.lock index bb481cd8801..2bda9a47e22 100644 --- a/src/main/webapp/yarn.lock +++ b/src/main/webapp/yarn.lock @@ -6343,6 +6343,21 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-prettier@npm:^4.0.0": + version: 4.0.0 + resolution: "eslint-plugin-prettier@npm:4.0.0" + dependencies: + prettier-linter-helpers: ^1.0.0 + peerDependencies: + eslint: ">=7.28.0" + prettier: ">=2.0.0" + peerDependenciesMeta: + eslint-config-prettier: + optional: true + checksum: 03d69177a3c21fa2229c7e427ce604429f0b20ab7f411e2e824912f572a207c7f5a41fd1f0a95b9b8afe121e291c1b1f1dc1d44c7aad4b0837487f9c19f5210d + languageName: node + linkType: hard + "eslint-plugin-react-hooks@npm:^4.4.0": version: 4.4.0 resolution: "eslint-plugin-react-hooks@npm:4.4.0" @@ -6620,6 +6635,13 @@ __metadata: languageName: node linkType: hard +"fast-diff@npm:^1.1.2": + version: 1.2.0 + resolution: "fast-diff@npm:1.2.0" + checksum: 1b5306eaa9e826564d9e5ffcd6ebd881eb5f770b3f977fcbf38f05c824e42172b53c79920e8429c54eb742ce15a0caf268b0fdd5b38f6de52234c4a8368131ae + languageName: node + linkType: hard + "fast-glob@npm:^3.2.9": version: 3.2.11 resolution: "fast-glob@npm:3.2.11" @@ -7541,6 +7563,7 @@ __metadata: eslint: ^8.13.0 eslint-config-prettier: ^8.5.0 eslint-plugin-jsx-a11y: ^6.5.1 + eslint-plugin-prettier: ^4.0.0 eslint-plugin-react: ^7.29.4 eslint-plugin-react-hooks: ^4.4.0 expose-loader: ^3.1.0 @@ -11440,6 +11463,15 @@ __metadata: languageName: node linkType: hard +"prettier-linter-helpers@npm:^1.0.0": + version: 1.0.0 + resolution: "prettier-linter-helpers@npm:1.0.0" + dependencies: + fast-diff: ^1.1.2 + checksum: 00ce8011cf6430158d27f9c92cfea0a7699405633f7f1d4a45f07e21bf78e99895911cbcdc3853db3a824201a7c745bd49bfea8abd5fb9883e765a90f74f8392 + languageName: node + linkType: hard + "prettier@npm:^2.6.2": version: 2.6.2 resolution: "prettier@npm:2.6.2" From 6f168ce12df5d0c5b27f7e6c89f3f0d6aefcf9f2 Mon Sep 17 00:00:00 2001 From: Josh Adam Date: Sun, 26 Jun 2022 21:13:29 -0500 Subject: [PATCH 2/3] Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30150a29c43..ee5d187acdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * [Developer/UI]: Removed `styled-components` from page header and replaced with CSS variables. See [PR 1284](https://github.com/phac-nml/irida/pull/1284) * [Developer/UI]: Updated eslint rule to check for object and array destructuring. See [PR 1322](https://github.com/phac-nml/irida/pull/1322) * [UI]: Fixed user routes for admin panel. See [PR 1323](https://github.com/phac-nml/irida/pull/1323) +* [Developer/UI]: Added `eslint-prettier-pluggin`. See [PR 1328](https://github.com/phac-nml/irida/pull/1328) ## [22.05.4] - 2022/06/16 * [UI]: Fixed bug preventing filter samples by file to fail on invalid url. See [PR 1318](https://github.com/phac-nml/irida/pull/1318) From 8881ddff800b2603258092030e0bbd6107835ede Mon Sep 17 00:00:00 2001 From: Josh Adam Date: Mon, 27 Jun 2022 09:54:43 -0500 Subject: [PATCH 3/3] Updated eslint for cr warning --- src/main/webapp/.eslintrc.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/webapp/.eslintrc.js b/src/main/webapp/.eslintrc.js index 36e0a852d64..bd380cf9cc2 100644 --- a/src/main/webapp/.eslintrc.js +++ b/src/main/webapp/.eslintrc.js @@ -42,5 +42,11 @@ module.exports = { enforceForRenamedProperties: false, }, ], + "prettier/prettier": [ + "error", + { + endOfLine: "auto", + }, + ], }, };