import-js/eslint-plugin-import

`import/no-unresolved` ignores require statements with backticks

Open

#1575 aperta il 19 dic 2019

Vedi su GitHub
 (0 commenti) (1 reazione) (0 assegnatari)JavaScript (1540 fork)batch import
bughelp wanted

Metriche repository

Star
 (4946 star)
Metriche merge PR
 (Merge medio 138g 22h) (3 PR mergiate in 30 g)

Descrizione

First of all, thanks for this plugin! It's great!

We're using the backtick option with the quotes rule in our codebase. About a week ago, we realized that our linter wasn't catching bad imports. After scratching our heads for a bit, we realized that import/no-unresolved doesn't check require statements that use backticks.

// index.js
// Assume a, b, and c do not exist

// Does not result in a linting error
const sweetPotato = require(`a`);

// Shows linting error
const biscuit = require("b");

// Shows linting error
import babyYoda from "c";

Guida contributor