-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(ESLint) Enforce filename extensions for jsx #2101
Conversation
- JSX content must use .jsx or .tsx here - Files that don't contain JSX can't use those two extensions
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset (largest 100 files by percent change)
View detailed bundle breakdownAdded
Removed
Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
@@ -282,9 +287,6 @@ module.exports = { | |||
}, | |||
], | |||
settings: { | |||
'import/parsers': { | |||
'@typescript-eslint/parser': ['.ts', '.tsx'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is included already with the import/typescript extends: https://github.com/import-js/eslint-plugin-import/blob/main/config/typescript.js
@@ -39,6 +39,7 @@ module.exports = { | |||
'react-app', | |||
'plugin:react/recommended', | |||
'plugin:@typescript-eslint/recommended', | |||
'plugin:import/typescript', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this adds tsx and jsx to the resolved imports so their filenames don't need to be specified in imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing
In preparation for considering moving to vite, which requires JSX content to be in one of these file extensions.
Currently this MR is also removing the x from files that don't contain JSX, (and enforcing that via eslint as well), but that is optional and not required for moving to vite. (Just seemed logical to me).
The eslint file contains the only content changes, everything else is just extension renames.
Split out of #2084