-
-
Notifications
You must be signed in to change notification settings - Fork 615
node-resolve: simplify builtins and remove customResolveOptions
#656
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
Merged
shellscape
merged 23 commits into
rollup:master
from
tjenkinson:node-resolve-simplify-builtins
Nov 30, 2020
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
dc2deca
refactor handling builtins
tjenkinson 74f76ec
Merge branch 'master' of https://github.com/rollup/plugins into node-…
tjenkinson b19fb3e
remove duplicate code block
tjenkinson 15302c6
do not warn when using a builtin when no local version
tjenkinson 44d0625
add not about warnings to readme
tjenkinson 8158663
update node-resolve, use `includeCoreModules`, and simplify
tjenkinson 83cacfb
remove console log
tjenkinson 56e3e0b
remove deprecated `only` option
tjenkinson 313d9f0
remove `only` from types
tjenkinson 3cfdf68
update types test
tjenkinson a7b1603
lint index.d.ts
tjenkinson 5aa675e
disable spaced-comment rule because it's breaking on .d.ts files
tjenkinson 8b3d895
mention rollup `preserveSymlinks` option in readme
tjenkinson 97a4dc1
moduleDirectory => moduleDirectories
tjenkinson 3033e93
put filter in config object directly
tjenkinson 3c8cec4
add missing options to types.ts
tjenkinson 12eca25
add deprecation warnings/errors
tjenkinson 486150e
handle deprecations in separate file
tjenkinson 89778dd
Merge remote-tracking branch 'upstream/master' into node-resolve-simp…
tjenkinson 8d39f74
move catch closer to error
tjenkinson e4eb3e2
revert commonjs changes
tjenkinson 2684129
remove old comment
tjenkinson 2ec4668
Merge branch 'master' into node-resolve-simplify-builtins
shellscape File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,8 +40,8 @@ export default { | |
| plugins: [ | ||
| dynamicImportVars({ | ||
| // options | ||
| }) | ||
| ] | ||
| }), | ||
| ], | ||
| }; | ||
| ``` | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| export default function handleDeprecatedOptions(opts) { | ||
| const warnings = []; | ||
|
|
||
| if (opts.customResolveOptions) { | ||
| const { customResolveOptions } = opts; | ||
| if (customResolveOptions.moduleDirectory) { | ||
| // eslint-disable-next-line no-param-reassign | ||
| opts.moduleDirectories = Array.isArray(customResolveOptions.moduleDirectory) | ||
| ? customResolveOptions.moduleDirectory | ||
| : [customResolveOptions.moduleDirectory]; | ||
|
|
||
| warnings.push( | ||
| 'node-resolve: The `customResolveOptions.moduleDirectory` option has been deprecated. Use `moduleDirectories`, which must be an array.' | ||
| ); | ||
| } | ||
|
|
||
| if (customResolveOptions.preserveSymlinks) { | ||
| throw new Error( | ||
| 'node-resolve: `customResolveOptions.preserveSymlinks` is no longer an option. We now always use the rollup `preserveSymlinks` option.' | ||
| ); | ||
| } | ||
|
|
||
| [ | ||
| 'basedir', | ||
| 'package', | ||
| 'extensions', | ||
| 'includeCoreModules', | ||
| 'readFile', | ||
| 'isFile', | ||
| 'isDirectory', | ||
| 'realpath', | ||
| 'packageFilter', | ||
| 'pathFilter', | ||
| 'paths', | ||
| 'packageIterator' | ||
| ].forEach((resolveOption) => { | ||
| if (customResolveOptions[resolveOption]) { | ||
| throw new Error( | ||
| `node-resolve: \`customResolveOptions.${resolveOption}\` is no longer an option. If you need this, please open an issue.` | ||
| ); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| return { warnings }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
Is it really necessary to mess with global linting rules? If there is really a good reason to ignore it at some point, rather use a
// eslint-disable-next-line spaced-comment.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.
There seems to be a bug with this rule and '.d.ts' files. I tried a lot of things to make it work, including
in the file but it seems to ignore it :/
Whenever it tries to 'fix' the lint errors it ends up inserting random spaces everywhere and then still fails for a different reason.
Uh oh!
There was an error while loading. Please reload this page.
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.
If it only affects
d.tsfiles, then I would recommend adding it as anoverride: