Add custom lint rule to ensure import paths end with .d.ts
extension
#1168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an auto-fixable solution for Add lint rule to prevent
.js
/.ts
extensions in import statements #1152, improving DX as mentioned in this comment.import-path-rule.mov
Updates
xo
because there are some bugs in the existing version.Enables the
allowJS
flag intsconfig.json
to ensure thexo.config.js
file is checked. This shouldn't be a problem because we havenoEmit
enabled, so it shouldn't matter if.js
files are part of the program. Also, this doesn't check all.js
files for errors, only those that have the@ts-check
directive.This is kinda better than the
no-restricted-imports
rule, because that restricts certain extensions, whereas this enforces the desired one.And interestingly, it also catches some existing errors that weren't caught earlier. And these errors are not because of any of our recent changes, these were there since the very beginning.
type-fest/source/pick-deep.d.ts
Lines 4 to 5 in d71242a
type-fest/test-d/internal/is-number-like.ts
Line 2 in d71242a