Automated Testing: Enforce .tsx for all new React files#80123
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 7.69 MB |
There was a problem hiding this comment.
This file scares the hell out of me. I had set myself as the code owner for tools/* to keep an eye on it, but this file results in my inbox being slammed with emails because this file seems to be changed more often 😄
There was a problem hiding this comment.
This is definitely a stress-test of the suppressions feature, given how this touches so many files. But as far as I can understand, it's the entire purpose of the feature, and is designed to support exactly the kind of large-scale "we want this rule but have lots of existing issues" cases like this one. I would definitely encourage adding an exclusion pattern for that code-ownership of yours 😅
I've also got a lot of other ideas for things we could do here that would likely be similar in scale, like converting our "strict" config (which is the same idea as suppressions is solving) and widening dependency-group never rule to apply everywhere (🌶️ ).
|
Flaky tests detected in a2334a5. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/29114692474
|
|
What do you think about scheduling the release of this PR for 7.1 Beta1 or later? Final development for Beta1 is currently in full swing, and merging this PR now would force them to switch to TypeScript. Forcing a conversion to TypeScript as an additional task might place a burden on them. |
What?
Updates ESLint rules to allow enforce
react/jsx-filename-extensionconsistently and limit extensions to only allow.tsxfiles. Suppresses existing issues through bulk suppressions feature.Why?
Following these premises that we agree in principle that we want to work toward:
This rule provides partial coverage covering React/JSX files, which is better than nothing. It stops the addition of new files (example).
How?
tools/eslint/config.mjsnpm run lint:js -- --suppress-allto register existing issues intools/eslint/suppressions.jsonTesting Instructions
npm run lint:jspasses.For bonus points, try adding a new
.jsor.jsxfile containing JSX syntax and verify thatnpm run lint:jsfails.Use of AI Tools
No AI was used.