Bump eslint-plugin-import to avoid vulnerability in dependency
This commit is contained in:
parent
10695e6a20
commit
ed9506bbaf
1660 changed files with 67726 additions and 27926 deletions
36
node_modules/eslint-import-resolver-node/index.js
generated
vendored
36
node_modules/eslint-import-resolver-node/index.js
generated
vendored
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const resolve = require('resolve');
|
||||
const isCoreModule = require('is-core-module');
|
||||
const path = require('path');
|
||||
|
||||
const log = require('debug')('eslint-plugin-import:resolver:node');
|
||||
|
|
@ -11,13 +12,14 @@ exports.resolve = function (source, file, config) {
|
|||
log('Resolving:', source, 'from:', file);
|
||||
let resolvedPath;
|
||||
|
||||
if (resolve.isCore(source)) {
|
||||
if (isCoreModule(source)) {
|
||||
log('resolved to core');
|
||||
return { found: true, path: null };
|
||||
}
|
||||
|
||||
try {
|
||||
resolvedPath = resolve.sync(source, opts(file, config));
|
||||
const cachedFilter = function (pkg, dir) { return packageFilter(pkg, dir, config); };
|
||||
resolvedPath = resolve.sync(source, opts(file, config, cachedFilter));
|
||||
log('Resolved to:', resolvedPath);
|
||||
return { found: true, path: resolvedPath };
|
||||
} catch (err) {
|
||||
|
|
@ -26,7 +28,7 @@ exports.resolve = function (source, file, config) {
|
|||
}
|
||||
};
|
||||
|
||||
function opts(file, config) {
|
||||
function opts(file, config, packageFilter) {
|
||||
return Object.assign({
|
||||
// more closely matches Node (#333)
|
||||
// plus 'mjs' for native modules! (#939)
|
||||
|
|
@ -36,16 +38,32 @@ function opts(file, config) {
|
|||
{
|
||||
// path.resolve will handle paths relative to CWD
|
||||
basedir: path.dirname(path.resolve(file)),
|
||||
packageFilter: packageFilter,
|
||||
|
||||
packageFilter,
|
||||
});
|
||||
}
|
||||
|
||||
function packageFilter(pkg) {
|
||||
function identity(x) { return x; }
|
||||
|
||||
function packageFilter(pkg, dir, config) {
|
||||
let found = false;
|
||||
const file = path.join(dir, 'dummy.js');
|
||||
if (pkg.module) {
|
||||
pkg.main = pkg.module;
|
||||
} else if (pkg['jsnext:main']) {
|
||||
pkg.main = pkg['jsnext:main'];
|
||||
try {
|
||||
resolve.sync(String(pkg.module).replace(/^(?:\.\/)?/, './'), opts(file, config, identity));
|
||||
pkg.main = pkg.module;
|
||||
found = true;
|
||||
} catch (err) {
|
||||
log('resolve threw error trying to find pkg.module:', err);
|
||||
}
|
||||
}
|
||||
if (!found && pkg['jsnext:main']) {
|
||||
try {
|
||||
resolve.sync(String(pkg['jsnext:main']).replace(/^(?:\.\/)?/, './'), opts(file, config, identity));
|
||||
pkg.main = pkg['jsnext:main'];
|
||||
found = true;
|
||||
} catch (err) {
|
||||
log('resolve threw error trying to find pkg[\'jsnext:main\']:', err);
|
||||
}
|
||||
}
|
||||
return pkg;
|
||||
}
|
||||
|
|
|
|||
9
node_modules/eslint-import-resolver-node/package.json
generated
vendored
9
node_modules/eslint-import-resolver-node/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "eslint-import-resolver-node",
|
||||
"version": "0.3.5",
|
||||
"version": "0.3.7",
|
||||
"description": "Node default behavior import resolution plugin for eslint-plugin-import.",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
|
|
@ -9,8 +9,7 @@
|
|||
"scripts": {
|
||||
"prepublishOnly": "cp ../../{LICENSE,.npmrc} ./",
|
||||
"tests-only": "nyc mocha",
|
||||
"test": "npm run tests-only",
|
||||
"coveralls": "nyc report --reporter lcovonly && cd ../.. && coveralls < ./resolvers/node/coverage/lcov.info"
|
||||
"test": "npm run tests-only"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
@ -31,11 +30,11 @@
|
|||
"homepage": "https://github.com/import-js/eslint-plugin-import",
|
||||
"dependencies": {
|
||||
"debug": "^3.2.7",
|
||||
"resolve": "^1.20.0"
|
||||
"is-core-module": "^2.11.0",
|
||||
"resolve": "^1.22.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^3.5.0",
|
||||
"coveralls": "^3.1.0",
|
||||
"mocha": "^3.5.3",
|
||||
"nyc": "^11.9.0"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue