- Issue created by @smustgrave
- First commit to issue fork.
- 🇬🇧United Kingdom jonathan1055
Just made some changes to get things started. Problem is I can't run eslint locally. So there will be plenty of things still wrong with this, plus I've only tackled the easy bits first.
- Merge request !26Issue #3338336: Javascript coding standards (uninstall, permissions, update status) → (Merged) created by jonathan1055
- Status changed to Needs review
over 2 years ago 6:24pm 1 February 2023 - 🇬🇧United Kingdom jonathan1055
First run took the coding standards for these three files down to 49 (27 fewer than branch)
- 🇬🇧United Kingdom jonathan1055
Second run - 31 messages (41 fewer than branch)
- 🇬🇧United Kingdom jonathan1055
Two files clean. Just three messages remaining in
64 for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array. (no-restricted-syntax) 67 for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array. (no-restricted-syntax) 67 The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype. (guard-for-in)
- 🇺🇸United States smustgrave
Can convert them or just to silence the errors. Dealers choice.
- last update
about 2 years ago 4 pass - last update
over 1 year ago 4 pass - 🇬🇧United Kingdom jonathan1055
I'm going to pick this up again and see what the current state is. From the branch pipeline eslint we have
js/jquery.winnow.js js/module_filter.js js/module_filter.modules_uninstall.js js/module_filter.permissions.js js/module_filter.update_status.js 200 problems (197 errors, 3 warnings)
In the MR26 we have the same set of five files but the log says
149 problems (149 errors, 0 warnings)
Most of these are prettier formatting warnings, which will be good to fix, but we need to separate them out on a separate issue. So I'm going to set them to be ignored in this MR, to see what is left over.
- last update
over 1 year ago 4 pass - 🇬🇧United Kingdom jonathan1055
That removed all but 1 of the warnings. We now get just
/builds/issue/module_filter-3338336/web/modules/custom/module_filter-3338336/js/jquery.winnow.js 54:36 error Unnecessary escape character: \: no-useless-escape ✖ 1 problem (1 error, 0 warnings)
So this is a new warning, because jquery.winnow.js was clean back in May when you fixed 📌 Javascript coding standards (winnow.js and module_filter.js) Fixed . But we can fix that here.
We also do get the three remaining warning I listed in #8 above. Did your recent work alter/remove some the rules?
- last update
over 1 year ago 4 pass - last update
over 1 year ago 4 pass - 🇬🇧United Kingdom jonathan1055
That fixed it. The pipeline with *.js in .prettierignore runs green for eslint. So this file can be put back (so .js are not ignored) and then this MR can be merged.
I will open a separate issue to look at the prettier warnings. It would be nice to have the branch test passing green.
- Status changed to RTBC
over 1 year ago 11:31am 1 December 2023 - 🇬🇧United Kingdom jonathan1055
This is RTBC
The follow-up is 📌 Fix prettier formating warnings in javascript files Active
-
smustgrave →
committed 0e023524 on 4.x authored by
jonathan1055 →
Issue #3338336: Javascript coding standards (uninstall, permissions,...
-
smustgrave →
committed 0e023524 on 4.x authored by
jonathan1055 →
- Status changed to Fixed
over 1 year ago 3:31pm 1 December 2023 - 🇬🇧United Kingdom jonathan1055
and thanks for merging.
📌 Fix prettier formating warnings in javascript files Active will now be easier to work on, too.
Automatically closed - issue fixed for 2 weeks with no activity.