Bump eslint-plugin-import to avoid vulnerability in dependency

This commit is contained in:
Henry Mercer 2023-01-18 20:26:59 +00:00
parent 10695e6a20
commit ed9506bbaf
1660 changed files with 67726 additions and 27926 deletions

View file

@ -1,12 +1,16 @@
# import/no-unresolved
💼 This rule is enabled in the following configs: ❗ `errors`, ☑️ `recommended`.
<!-- end auto-generated rule header -->
Ensures an imported module can be resolved to a module on the local filesystem,
as defined by standard Node `require.resolve` behavior.
See [settings](../../README.md#settings) for customization options for the resolution (i.e.
additional filetypes, `NODE_PATH`, etc.)
This rule can also optionally report on unresolved modules in CommonJS `require('./foo')` calls and AMD `require(['./foo'], function (foo){...})` and `define(['./foo'], function (foo){...})`.
This rule can also optionally report on unresolved modules in CommonJS `require('./foo')` calls and AMD `require(['./foo'], function (foo) {...})` and `define(['./foo'], function (foo) {...})`.
To enable this, send `{ commonjs: true/false, amd: true/false }` as a rule option.
Both are disabled by default.
@ -60,7 +64,7 @@ This rule has its own ignore list, separate from [`import/ignore`]. This is beca
To suppress errors from files that may not be properly resolved by your [resolver settings](../../README.md#resolver-plugins), you may add an `ignore` key with an array of `RegExp` pattern strings:
```js
/*eslint import/no-unresolved: [2, { ignore: ['\.img$'] }]*/
/*eslint import/no-unresolved: [2, { ignore: ['\\.img$'] }]*/
import { x } from './mod' // may be reported, if not resolved to a module
@ -76,14 +80,29 @@ By default, this rule will report paths whose case do not match the underlying f
const { default: x } = require('./foo') // reported if './foo' is actually './Foo' and caseSensitive: true
```
#### `caseSensitiveStrict`
The `caseSensitive` option does not detect case for the current working directory. The `caseSensitiveStrict` option allows checking `cwd` in resolved path. By default, the option is disabled.
```js
/*eslint import/no-unresolved: [2, { caseSensitiveStrict: true }]*/
// Absolute paths
import Foo from `/Users/fOo/bar/file.js` // reported, /Users/foo/bar/file.js
import Foo from `d:/fOo/bar/file.js` // reported, d:/foo/bar/file.js
// Relative paths, cwd is Users/foo/
import Foo from `./../fOo/bar/file.js` // reported
```
## When Not To Use It
If you're using a module bundler other than Node or Webpack, you may end up with
a lot of false positive reports of missing dependencies.
If you're using a module bundler other than Node or Webpack, you may end up with a lot of false positive reports of missing dependencies.
## Further Reading
- [Resolver plugins](../../README.md#resolver-plugins)
- [Resolver plugins](../../README.md#resolvers)
- [Node resolver](https://npmjs.com/package/eslint-import-resolver-node) (default)
- [Webpack resolver](https://npmjs.com/package/eslint-import-resolver-webpack)
- [`import/ignore`] global setting