-
Notifications
You must be signed in to change notification settings - Fork 45
Silence some wrong unsafe-member-access errors #88
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
Conversation
Fixes sveltejs#87 .. but not all possible cases, see README.
@@ -209,14 +226,10 @@ const ts_import_transformer = (context) => { | |||
// 5. parse the source to get the AST | |||
// 6. return AST of step 5, warnings and vars of step 2 | |||
function compile_code(text, compiler, processor_options) { |
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 refactored the code for readability, functionality stayed the same.
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.
As the reporter of #87, I thought I'd take a look. To my untrained eye, the fix looks like it should work, and the additional test sample should cover it.
Just a couple of comments...
I can see this change works by effectively splicing the script blocks into the code being analysed, thereby ensuring all declarations are present as they were originally written. I haven't looked in too much detail at how this plugin works, but is there a chance that with this change, if there is an ESLint warning in (say) the module context block, then it will be double-reported due to the module context being spliced into other blocks? |
It will not (and the test confirms that) because eslint warnings/errors on unmapped code will be ignored. |
Well I'm happy then, but presumably my approval isn't very useful in terms of getting this merged... |
Fixes #87
.. but not all possible cases, see README.