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
chore: Enable eslint rule no-unnecessary-type-assertion
#15260
Conversation
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), |
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.
Only here they might not be very good, but just two are fine.
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 |
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.
Can we disable this rule for these files? So other rules are still active for them.
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.
I've tried a few things, unfortunately without success, or requiring extensive modifications to the config file.
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.
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.
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.
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.
FWIW, this rule may end up as a typescript cli flag: microsoft/TypeScript#51527 |
Fixes #1, Fixes #2
I like this rule.