Skip to content
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

Make no-extraneous-deps lint only dependencies that can be resolved #943

Merged

Commits on Oct 12, 2017

  1. [patch] make no-extraneous-dependencies include only paths that can b…

    …e resolved,
    
    as only resolved paths can be reliably tested if they live in a `node_modules` folder.
    
    Up until now, this rule assumed, that every package that lives in a `node_modules` folder
    or *cannot be resolved* is an external package.
    This happens because of [that line](https://github.com/benmosher/eslint-plugin-import/blob/master/src/core/importType.js#L32).
    
    If project uses aliasing, or transforms imports, this assumption is wrong,
    as they may not be resolvable by import plugin, but also, they should not be defined in package.json.
    
    Changing `isExternalPath` will make any ordering lints unstable
    (order may change depending if you ran `npm install` or not).
    
    Using `import/ignore` setting does not make sense too, as it's used to ignore imports unknown to the plugin,
    like .css files. But still, you may import a css file from a dependency, and this rule should check that.
    panrafal authored and ljharb committed Oct 12, 2017
    Configuration menu
    Copy the full SHA
    ae37318 View commit details
    Browse the repository at this point in the history