Fix unknown property issues in aboutwelcome/newtab code when upgrading eslint-plugin-react to 7.33.2
Categories
(Firefox :: Messaging System, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: standard8, Assigned: aminomancer)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
When upgrading eslint-plugin-react to 7.33.2, there are various errors generated: (Note: there are also errors for devtools, that I'll raise in a separate bug).
browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx
106:7 error Unknown property 'flow' found react/no-unknown-property (eslint)
188:11 error Unknown property 'alignment' found react/no-unknown-property (eslint)
345:9 error Unknown property 'button-size' found react/no-unknown-property (eslint)
496:9 error Unknown property 'layout' found react/no-unknown-property (eslint)
497:9 error Unknown property 'pos' found react/no-unknown-property (eslint)
509:11 error Unknown property 'hide-secondary-section' found react/no-unknown-property (eslint)
browser/components/newtab/content-src/components/CustomizeMenu/ContentSection/ContentSection.jsx
129:19 error Unknown property 'preference' found react/no-unknown-property (eslint)
165:23 error Unknown property 'preference' found react/no-unknown-property (eslint)
166:23 error Unknown property 'eventSource' found react/no-unknown-property (eslint)
207:27 error Unknown property 'preference' found react/no-unknown-property (eslint)
208:27 error Unknown property 'eventSource' found react/no-unknown-property (eslint)
226:27 error Unknown property 'preference' found react/no-unknown-property (eslint)
227:27 error Unknown property 'eventSource' found react/no-unknown-property (eslint)
browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSDismiss/DSDismiss.jsx
47:11 error Unknown property 'onHover' found react/no-unknown-property (eslint)
Please can someone take a look at fixing this? I am starting to investigate upgrading to ESLint v9, and want to make sure we have all the plugins up to date as there may be plugin changes needed as well.
To test the upgrade locally:
- Update
package.json
to seteslint-plugin-react
to"7.33.2"
- Run
rm -r node_modules package-lock.json && ./mach npm install
to regenerate the node modules installation. - Run ESLint as normal, e.g.
./mach eslint .
or./mach eslint browser/components/
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Comment 1•5 months ago
|
||
Thanks for filing, upgrading to 9 sounds great. I guess this rule was broken in old eslint versions. At first glance:
- I do want the custom props for MultiStageProtonScreen. We could just flip the rule to
off
, but maybe it's better to just add exclusions."react/no-unknown-property": ["error", { ignore: ["flow", "alignment", "button-size", "layout", "pos", "hide-secondary-section"] }]
- But the one in DSDismiss looks like an accidental duplicate of onMouseEnter, and safe to remove.
- The ContentSection props are read, but they could be changed to
data-preference
anddata-event-source
, which the eslint rule should accept without issue.
Reporter | ||
Comment 2•5 months ago
|
||
(In reply to Shane Hughes [:aminomancer] from comment #1)
Thanks for filing, upgrading to 9 sounds great. I guess this rule was broken in old eslint versions.
Just to clarify, it is upgrading the plugin that is raising the errors, we haven't updated ESLint yet (begin able to upgrade the plugin should make it easier to upgrade ESLint).
I'll leave you to decide on what's best for the code :)
Comment 3•5 months ago
|
||
Seems like at least the about welcome stuff is probably messaging system.
Shane, do you have cycles to take this?
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Comment 5•5 months ago
|
||
Pushed by shughes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/372a10fa73b5 Fix react/no-unknown-property violations in newtab. r=Standard8
Comment 7•5 months ago
|
||
bugherder |
Description
•