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
fix(eslint-plugin): [no-unnec-type-assert] handle JSX attributes #1002
Conversation
This comment has been minimized.
This comment has been minimized.
# Conflicts: # .gitignore
this should be fixed when #1424 gets merged
return <div key={props.id!} />; | ||
}; | ||
`, | ||
filename: path.join(rootDir, 'react.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.
filename for now has to be absolute when used with watch program (project)
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.
do we want to put this in the RuleTester
?
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.
no it should not be there, it should work correctly with relative paths
see #1439
packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts
Outdated
Show resolved
Hide resolved
@bradzacher i picked up this PR as it looked that you abandoned it (3 months ago last change), i pushed merge + all conflicts are resolved and cleanup up code a little (most of changes was outdated and already supported on master) i left some comments ^Up to show what i changed |
note: all changes related to #1061 are already present on master |
Thanks, this was on my todo list. I had some commits locally, but never got around to finishing fixing it up. |
Codecov Report
@@ Coverage Diff @@
## master #1002 +/- ##
==========================================
- Coverage 94.48% 94.45% -0.03%
==========================================
Files 142 142
Lines 6079 6083 +4
Branches 1727 1728 +1
==========================================
+ Hits 5744 5746 +2
- Misses 182 183 +1
- Partials 153 154 +1
|
Fixes #982
Fixes #1061
I never added proper handling for JSX attributes in the rule - this fixes that.
This also fixes a few things with testing TSX files