Skip to content
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

chore: Enable eslint rule no-unnecessary-type-assertion #15260

Merged
merged 5 commits into from Dec 13, 2022

Conversation

liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Dec 8, 2022

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

I like this rule.

Comment on lines -483 to +486
children.push(
this.jsxParseSpreadChild(node as Undone<N.JSXSpreadChild>),
);
children.push(this.jsxParseSpreadChild(node));
} else {
children.push(
this.jsxParseExpressionContainer(
node as Undone<N.JSXExpressionContainer>,
tc.j_expr,
),
this.jsxParseExpressionContainer(node, tc.j_expr),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only here they might not be very good, but just two are fine.

@babel-bot
Copy link
Collaborator

babel-bot commented Dec 8, 2022

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53629/

.eslintignore Outdated
@@ -32,3 +32,6 @@ test/runtime-integration/*/output.js
test/runtime-integration/*/output-absolute.js

Makefile.js

# TODO: Enable this
packages/babel-parser/typings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we disable this rule for these files? So other rules are still active for them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried a few things, unfortunately without success, or requiring extensive modifications to the config file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh by the way, the error was not caused by this new rule, but that I added the project option and tslint warned us that it was not included by tsconfig.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. After I add them to the tsconfig.json, both eslint and tsc are happy. So I don't think we have to exclude them, especially when packages/babel-parser/typings/babel-parser.source.d.ts is a source file.

@ehoogeveen-medweb
Copy link
Contributor

FWIW, this rule may end up as a typescript cli flag: microsoft/TypeScript#51527

@nicolo-ribaudo nicolo-ribaudo merged commit 362451b into babel:main Dec 13, 2022
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Mar 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants