Enable the unicorn/prefer-class-fields ESLint plugin rule#20657
Enable the unicorn/prefer-class-fields ESLint plugin rule#20657timvandermeij merged 1 commit intomozilla:masterfrom
unicorn/prefer-class-fields ESLint plugin rule#20657Conversation
This leads to slightly shorter code[1] when initializing classes, and in some cases we can even remove the constructors, which shouldn't hurt; see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-class-fields.md It's probably possible to also change a lot of these class fields to private ones[2], however it's often difficult to tell at a glance if that's safe hence this patch only does this for the `PDFRenderingQueue`. --- [1] This reduces the size of the `gulp mozcentral` output by 999 bytes, for a mostly mechanical code change. [2] That sort of re-factoring should generally be done separately, on a class-by-class basis, to reduce the risk of regressions.
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/ca09a331ec4e049/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/ca09a331ec4e049/output.txt Total script time: 1.00 mins Published |
|
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/7be9664833babe2/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/2ab35c3488c7244/output.txt |
timvandermeij
left a comment
There was a problem hiding this comment.
r=me, with passing tests. Thanks!
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/2ab35c3488c7244/output.txt Total script time: 42.15 mins
Image differences available at: http://54.241.84.105:8877/2ab35c3488c7244/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/7be9664833babe2/output.txt Total script time: 82.45 mins
Image differences available at: http://54.193.163.58:8877/7be9664833babe2/reftest-analyzer.html#web=eq.log |
This leads to slightly shorter code when initializing classes, and it reduces the size of the `gulp mozcentral` output by 894 bytes for a mostly mechanical code change. Unfortunately it seems that the `unicorn/prefer-class-fields` ESLint plugin, see PR mozilla#20657, isn't able to find/fix these cases.
This leads to slightly shorter code when initializing classes, and it reduces the size of the `gulp mozcentral` output by 894 bytes for a mostly mechanical code change. Unfortunately it seems that the `unicorn/prefer-class-fields` ESLint plugin, see PR mozilla#20657, isn't able to find/fix these cases.
This leads to slightly shorter code[1] when initializing classes, and in some cases we can even remove the constructors, which shouldn't hurt; see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-class-fields.md
It's probably possible to also change a lot of these class fields to private ones[2], however it's often difficult to tell at a glance if that's safe hence this patch only does this for the
PDFRenderingQueue.[1] This reduces the size of the
gulp mozcentraloutput by 999 bytes, for a mostly mechanical code change.[2] That sort of re-factoring should generally be done separately, on a class-by-class basis, to reduce the risk of regressions.