-
Notifications
You must be signed in to change notification settings - Fork 207
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
Remove detection of files via import resolution, use static glob and npmignore #788
Conversation
This PR still uses the same module resolution code to check errors, but that actually nets the same bugs that we are seeing with
This fails because module resolution doesn't see I'm going to update the PR to instead not use module resolution, as everything we need can actually be done directly on the paths. |
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.
Some comments, although I still need to review the new eslint-plugin changes.
Latest run caught some very fun stuff:
|
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 have to run to the dentist but I'm all done reviewing except for reading the new test infrastructure and assertions.
packages/eslint-plugin/test/fixtures/types/no-bad-reference/v0.1/index.d.ts
Show resolved
Hide resolved
packages/eslint-plugin/test/fixtures/types/no-bad-reference/v11/index.d.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin/test/fixtures/types/no-relative-references/v1/index.d.ts
Show resolved
Hide resolved
packages/eslint-plugin/test/fixtures/types/no-self-import/index.d.ts
Outdated
Show resolved
Hide resolved
}, | ||
], | ||
filename: "types/no-declare-current-package/index.d.ts", | ||
errors: [{ messageId: "noDeclareCurrentPackage" }], |
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 missing data
, which made the tests easier to read in no-bad-reference. Is it possible to get data
here too?
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, I just didn't add it since I copied the original test. Will fix.
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.
Done; that caught the fact that the lint rule forgot a quote.
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.
Finished up looking at tests.
Fixes #769
Files are now determined statically by extension only, ignoring versioned subdirs.
For one-off
npm pack
in the DT repo, an.npmignore
is now required. For react, this looks like:As outlined in #769, this is the "least bad" solution as far as I can tell, other than to just allow any file in random
npm pack
s and ignore the subdirs.This required a bunch of lint changes, including moving the relative import check to a lint rule, which required a bunch of other changes.
This is still a WIP with a bunch of TODOs, but it's good enough to start looking at.
TODO