Description
Victor Grousset/tuxayo
2024-10-11 02:39:57 UTC
Created attachment 172682 [details] [review] Bug 38149: Make ESLint config compatible with version 9 Test plan 1. Apply patch 2. Start KTD (to check that stuff is installed automatically) 3. Run this: ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 4. You should see errors from prettier in addition to others QA notes: 1. Run this: yarn why eslint; yarn why prettier; yarn why eslint-config-prettier; yarn why eslint-plugin-prettier 2. See that the version are the latest from NPM website 3. See that they are in devDependencies Created attachment 172683 [details] [review] Bug 38149: Add ESLint & prettier to package.json And upgrade eslint-plugin-prettier This is the 2nd time I'm really messing with node stuff so I don't know what I'm doing.🙃 Don't trust anything you see! The process was throwing things at the wall and see what stuck. 🫠I don't know if there aren't too much changes in lock files. I did `yarn add prettier eslint --dev` And `yarn upgrade eslint-plugin-prettier` (I think) so package.json still has the old version but the lock has the latest so it's fine. But I don't know if package.json should still be manually updated. ---- Some things I did to double check stuff: Before applying the test plan, deleting the node_modules directory. To avoid keep manually installed stuff and wrongly thinking things worked. .eslintrc.json + ], + "prettier/prettier": [ + "error" Sabotaged one and then the other of these lines and see that it errors to confirm it's not dead config. "extends": [ "eslint:recommended", - "prettier" + "eslint-config-prettier" + ], + "plugins": [ + "eslint-plugin-prettier" Same here. ------- Next steps after this: 1. Migrate to the flat config file to avoid having that ugly ESLINT_USE_FLAT_CONFIG='false' 2. Add the necessary stuff to be able to use ESLint on .vue and .ts files. 3. Open a ticket in QA tools (try to implement, at least partially) about having the same check with ESLint as we have with perltidy. (comparing number of messy line before and after the patches) 4. ???? 5. PROFIT!!! (Finally JS8 will be fully and easily checkable!!!!! :D) yarn.lock changes should be in a separate patch. Created attachment 173010 [details] [review] Bug 38149: Make ESLint config compatible with version 9 Test plan 1. Apply patch 2. Start KTD (to check that stuff is installed automatically) 3. Run this: ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 4. You should see errors from prettier in addition to others QA notes: 1. Run this: yarn why eslint; yarn why prettier; yarn why eslint-config-prettier; yarn why eslint-plugin-prettier 2. See that the version are the latest from NPM website 3. See that they are in devDependencies Created attachment 173011 [details] [review] Bug 38149: Add ESLint & prettier to package.json And upgrade eslint-plugin-prettier Created attachment 173012 [details] [review] Bug 38149: [DO NOT PUSH] yarn.lock changes (In reply to Jonathan Druart from comment #4) > yarn.lock changes should be in a separate patch. Indeed, thanks Created attachment 174426 [details] [review] Bug 38149: Make ESLint config compatible with version 9 Test plan 1. Apply patch 2. Start KTD (to check that stuff is installed automatically) 3. Run this: ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 4. You should see errors from prettier in addition to others QA notes: 1. Run this: yarn why eslint; yarn why prettier; yarn why eslint-config-prettier; yarn why eslint-plugin-prettier 2. See that the version are the latest from NPM website 3. See that they are in devDependencies Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174427 [details] [review] Bug 38149: Add ESLint & prettier to package.json And upgrade eslint-plugin-prettier Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174428 [details] [review] Bug 38149: [DO NOT PUSH] yarn.lock changes Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174852 [details] [review] Bug 38149: Make ESLint config compatible with version 9 Test plan 1. Apply patch 2. Start KTD (to check that stuff is installed automatically) 3. Run this: ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 4. You should see errors from prettier in addition to others QA notes: 1. Run this: yarn why eslint; yarn why prettier; yarn why eslint-config-prettier; yarn why eslint-plugin-prettier 2. See that the version are the latest from NPM website 3. See that they are in devDependencies Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174853 [details] [review] Bug 38149: Add ESLint & prettier to package.json And upgrade eslint-plugin-prettier Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 174854 [details] [review] Bug 38149: [DO NOT PUSH] yarn.lock changes Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Rebased. Created attachment 175424 [details] [review] Bug 38149: Make ESLint config compatible with version 9 Test plan 1. Apply patch 2. Start KTD (to check that stuff is installed automatically) 3. Run this: ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 4. You should see errors from prettier in addition to others QA notes: 1. Run this: yarn why eslint; yarn why prettier; yarn why eslint-config-prettier; yarn why eslint-plugin-prettier 2. See that the version are the latest from NPM website 3. See that they are in devDependencies Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 175425 [details] [review] Bug 38149: Add ESLint & prettier to package.json And upgrade eslint-plugin-prettier Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 175426 [details] [review] Bug 38149: [DO NOT PUSH] yarn.lock changes Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Updated prettier from 3.3.3 to 3.4.2 Created attachment 176193 [details] [review] Bug 38149: Make ESLint config compatible with version 9 Test plan 1. Apply patch 2. Start KTD (to check that stuff is installed automatically) 3. Run this: ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 4. You should see errors from prettier in addition to others QA notes: 1. Run this: yarn why eslint; yarn why prettier; yarn why eslint-config-prettier; yarn why eslint-plugin-prettier 2. See that the version are the latest from NPM website 3. See that they are in devDependencies Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 176194 [details] [review] Bug 38149: Add ESLint & prettier to package.json And upgrade eslint-plugin-prettier Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> It looks like this (or 38167) make the tidy tests fail. I need help to resolve this, so holding back on push. Test Summary Report ------------------- xt/js_tidy.t (Wstat: 256 (exited 1) Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 xt/vue_tidy.t (Wstat: 256 (exited 1) Tests: 2 Failed: 1) Failed test: 1 Non-zero exit status: 1 Maybe this should wait for bug 38664, I am doing the upgrade of prettier with the needed fixes already. As well as moving the prettier config to .prettierrc.js Maybe join the force there? Note: We are here upgrading prettier from 2.7.1 to 3.4.2. Created attachment 176587 [details] [review] Bug 38149: Adjust tidy of some vue and js files after prettier upgrade Fix xt/js_tidy.t and xt/vue_tidy.t Created attachment 176634 [details] [review] Bug 38149: Make ESLint config compatible with version 9 Test plan 1. Apply patch 2. Start KTD (to check that stuff is installed automatically) 3. Run this: ESLINT_USE_FLAT_CONFIG='false' eslint koha-tmpl/intranet-tmpl/prog/js/ajax.js 4. You should see errors from prettier in addition to others QA notes: 1. Run this: yarn why eslint; yarn why prettier; yarn why eslint-config-prettier; yarn why eslint-plugin-prettier 2. See that the version are the latest from NPM website 3. See that they are in devDependencies Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 176635 [details] [review] Bug 38149: Add ESLint & prettier to package.json And upgrade eslint-plugin-prettier Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 176636 [details] [review] Bug 38149: Adjust tidy of some vue and js files after prettier upgrade Fix xt/js_tidy.t and xt/vue_tidy.t Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Good to go, I will adjust 38664 on top of this. Pushed for 25.05! Well done everyone, thank you! |