tools: update ESLint to 5.12.0
Update ESLint to 5.12.0. PR-URL: https://github.com/nodejs/node/pull/25347 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This commit is contained in:
parent
076d8b9f9d
commit
ec5884a94f
4
tools/node_modules/eslint/lib/config/config-file.js
generated
vendored
4
tools/node_modules/eslint/lib/config/config-file.js
generated
vendored
@ -18,7 +18,7 @@ const fs = require("fs"),
|
||||
pathIsInside = require("path-is-inside"),
|
||||
stripComments = require("strip-json-comments"),
|
||||
stringify = require("json-stable-stringify-without-jsonify"),
|
||||
requireUncached = require("require-uncached");
|
||||
importFresh = require("import-fresh");
|
||||
|
||||
const debug = require("debug")("eslint:config-file");
|
||||
|
||||
@ -156,7 +156,7 @@ function loadLegacyConfigFile(filePath) {
|
||||
function loadJSConfigFile(filePath) {
|
||||
debug(`Loading JS config file: ${filePath}`);
|
||||
try {
|
||||
return requireUncached(filePath);
|
||||
return importFresh(filePath);
|
||||
} catch (e) {
|
||||
debug(`Error reading JavaScript file: ${filePath}`);
|
||||
e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
|
||||
|
4
tools/node_modules/eslint/lib/rules/block-spacing.js
generated
vendored
4
tools/node_modules/eslint/lib/rules/block-spacing.js
generated
vendored
@ -29,8 +29,8 @@ module.exports = {
|
||||
],
|
||||
|
||||
messages: {
|
||||
missing: "Requires a space {{location}} '{{token}}'",
|
||||
extra: "Unexpected space(s) {{location}} '{{token}}'"
|
||||
missing: "Requires a space {{location}} '{{token}}'.",
|
||||
extra: "Unexpected space(s) {{location}} '{{token}}'."
|
||||
}
|
||||
},
|
||||
|
||||
|
4
tools/node_modules/eslint/lib/rules/capitalized-comments.js
generated
vendored
4
tools/node_modules/eslint/lib/rules/capitalized-comments.js
generated
vendored
@ -137,8 +137,8 @@ module.exports = {
|
||||
],
|
||||
|
||||
messages: {
|
||||
unexpectedLowercaseComment: "Comments should not begin with a lowercase character",
|
||||
unexpectedUppercaseComment: "Comments should not begin with an uppercase character"
|
||||
unexpectedLowercaseComment: "Comments should not begin with a lowercase character.",
|
||||
unexpectedUppercaseComment: "Comments should not begin with an uppercase character."
|
||||
}
|
||||
},
|
||||
|
||||
|
8
tools/node_modules/eslint/lib/rules/func-name-matching.js
generated
vendored
8
tools/node_modules/eslint/lib/rules/func-name-matching.js
generated
vendored
@ -92,10 +92,10 @@ module.exports = {
|
||||
},
|
||||
|
||||
messages: {
|
||||
matchProperty: "Function name `{{funcName}}` should match property name `{{name}}`",
|
||||
matchVariable: "Function name `{{funcName}}` should match variable name `{{name}}`",
|
||||
notMatchProperty: "Function name `{{funcName}}` should not match property name `{{name}}`",
|
||||
notMatchVariable: "Function name `{{funcName}}` should not match variable name `{{name}}`"
|
||||
matchProperty: "Function name `{{funcName}}` should match property name `{{name}}`.",
|
||||
matchVariable: "Function name `{{funcName}}` should match variable name `{{name}}`.",
|
||||
notMatchProperty: "Function name `{{funcName}}` should not match property name `{{name}}`.",
|
||||
notMatchVariable: "Function name `{{funcName}}` should not match variable name `{{name}}`."
|
||||
}
|
||||
},
|
||||
|
||||
|
2
tools/node_modules/eslint/lib/rules/max-classes-per-file.js
generated
vendored
2
tools/node_modules/eslint/lib/rules/max-classes-per-file.js
generated
vendored
@ -32,7 +32,7 @@ module.exports = {
|
||||
],
|
||||
|
||||
messages: {
|
||||
maximumExceeded: "Number of classes per file must not exceed {{ max }}"
|
||||
maximumExceeded: "Number of classes per file must not exceed {{ max }}."
|
||||
}
|
||||
},
|
||||
create(context) {
|
||||
|
8
tools/node_modules/eslint/lib/rules/no-param-reassign.js
generated
vendored
8
tools/node_modules/eslint/lib/rules/no-param-reassign.js
generated
vendored
@ -107,6 +107,14 @@ module.exports = {
|
||||
|
||||
break;
|
||||
|
||||
// EXCLUDES: e.g. (foo ? a : b).c = bar;
|
||||
case "ConditionalExpression":
|
||||
if (parent.test === node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// no default
|
||||
}
|
||||
|
||||
|
4
tools/node_modules/eslint/lib/rules/prefer-object-spread.js
generated
vendored
4
tools/node_modules/eslint/lib/rules/prefer-object-spread.js
generated
vendored
@ -226,8 +226,8 @@ module.exports = {
|
||||
fixable: "code",
|
||||
|
||||
messages: {
|
||||
useSpreadMessage: "Use an object spread instead of `Object.assign` eg: `{ ...foo }`",
|
||||
useLiteralMessage: "Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`"
|
||||
useSpreadMessage: "Use an object spread instead of `Object.assign` eg: `{ ...foo }`.",
|
||||
useLiteralMessage: "Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`."
|
||||
}
|
||||
},
|
||||
|
||||
|
78
tools/node_modules/eslint/lib/rules/sort-imports.js
generated
vendored
78
tools/node_modules/eslint/lib/rules/sort-imports.js
generated
vendored
@ -36,6 +36,9 @@ module.exports = {
|
||||
minItems: 4,
|
||||
maxItems: 4
|
||||
},
|
||||
ignoreDeclarationSort: {
|
||||
type: "boolean"
|
||||
},
|
||||
ignoreMemberSort: {
|
||||
type: "boolean"
|
||||
}
|
||||
@ -51,6 +54,7 @@ module.exports = {
|
||||
|
||||
const configuration = context.options[0] || {},
|
||||
ignoreCase = configuration.ignoreCase || false,
|
||||
ignoreDeclarationSort = configuration.ignoreDeclarationSort || false,
|
||||
ignoreMemberSort = configuration.ignoreMemberSort || false,
|
||||
memberSyntaxSortOrder = configuration.memberSyntaxSortOrder || ["none", "all", "multiple", "single"],
|
||||
sourceCode = context.getSourceCode();
|
||||
@ -105,44 +109,48 @@ module.exports = {
|
||||
|
||||
return {
|
||||
ImportDeclaration(node) {
|
||||
if (previousDeclaration) {
|
||||
const currentMemberSyntaxGroupIndex = getMemberParameterGroupIndex(node),
|
||||
previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration);
|
||||
let currentLocalMemberName = getFirstLocalMemberName(node),
|
||||
previousLocalMemberName = getFirstLocalMemberName(previousDeclaration);
|
||||
if (!ignoreDeclarationSort) {
|
||||
if (previousDeclaration) {
|
||||
const currentMemberSyntaxGroupIndex = getMemberParameterGroupIndex(node),
|
||||
previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration);
|
||||
let currentLocalMemberName = getFirstLocalMemberName(node),
|
||||
previousLocalMemberName = getFirstLocalMemberName(previousDeclaration);
|
||||
|
||||
if (ignoreCase) {
|
||||
previousLocalMemberName = previousLocalMemberName && previousLocalMemberName.toLowerCase();
|
||||
currentLocalMemberName = currentLocalMemberName && currentLocalMemberName.toLowerCase();
|
||||
}
|
||||
|
||||
/*
|
||||
* When the current declaration uses a different member syntax,
|
||||
* then check if the ordering is correct.
|
||||
* Otherwise, make a default string compare (like rule sort-vars to be consistent) of the first used local member name.
|
||||
*/
|
||||
if (currentMemberSyntaxGroupIndex !== previousMemberSyntaxGroupIndex) {
|
||||
if (currentMemberSyntaxGroupIndex < previousMemberSyntaxGroupIndex) {
|
||||
context.report({
|
||||
node,
|
||||
message: "Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax.",
|
||||
data: {
|
||||
syntaxA: memberSyntaxSortOrder[currentMemberSyntaxGroupIndex],
|
||||
syntaxB: memberSyntaxSortOrder[previousMemberSyntaxGroupIndex]
|
||||
}
|
||||
});
|
||||
if (ignoreCase) {
|
||||
previousLocalMemberName = previousLocalMemberName && previousLocalMemberName.toLowerCase();
|
||||
currentLocalMemberName = currentLocalMemberName && currentLocalMemberName.toLowerCase();
|
||||
}
|
||||
} else {
|
||||
if (previousLocalMemberName &&
|
||||
currentLocalMemberName &&
|
||||
currentLocalMemberName < previousLocalMemberName
|
||||
) {
|
||||
context.report({
|
||||
node,
|
||||
message: "Imports should be sorted alphabetically."
|
||||
});
|
||||
|
||||
/*
|
||||
* When the current declaration uses a different member syntax,
|
||||
* then check if the ordering is correct.
|
||||
* Otherwise, make a default string compare (like rule sort-vars to be consistent) of the first used local member name.
|
||||
*/
|
||||
if (currentMemberSyntaxGroupIndex !== previousMemberSyntaxGroupIndex) {
|
||||
if (currentMemberSyntaxGroupIndex < previousMemberSyntaxGroupIndex) {
|
||||
context.report({
|
||||
node,
|
||||
message: "Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax.",
|
||||
data: {
|
||||
syntaxA: memberSyntaxSortOrder[currentMemberSyntaxGroupIndex],
|
||||
syntaxB: memberSyntaxSortOrder[previousMemberSyntaxGroupIndex]
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (previousLocalMemberName &&
|
||||
currentLocalMemberName &&
|
||||
currentLocalMemberName < previousLocalMemberName
|
||||
) {
|
||||
context.report({
|
||||
node,
|
||||
message: "Imports should be sorted alphabetically."
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
previousDeclaration = node;
|
||||
}
|
||||
|
||||
if (!ignoreMemberSort) {
|
||||
@ -191,8 +199,6 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
previousDeclaration = node;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
3
tools/node_modules/eslint/node_modules/acorn/dist/acorn.d.ts
generated
vendored
3
tools/node_modules/eslint/node_modules/acorn/dist/acorn.d.ts
generated
vendored
@ -19,6 +19,7 @@ declare namespace acorn {
|
||||
allowReserved?: boolean
|
||||
allowReturnOutsideFunction?: boolean
|
||||
allowImportExportEverywhere?: boolean
|
||||
allowAwaitOutsideFunction?: boolean
|
||||
allowHashBang?: boolean
|
||||
locations?: boolean
|
||||
onToken?: ((token: Token) => any) | Token[]
|
||||
@ -42,7 +43,7 @@ declare namespace acorn {
|
||||
getToken(): Token
|
||||
[Symbol.iterator](): Iterator<Token>
|
||||
}
|
||||
static extend(...plugins: (typeof Parser)[]): typeof Parser
|
||||
static extend(...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser
|
||||
}
|
||||
|
||||
interface Position { line: number; column: number; offset: number }
|
||||
|
9
tools/node_modules/eslint/node_modules/acorn/dist/acorn.js
generated
vendored
9
tools/node_modules/eslint/node_modules/acorn/dist/acorn.js
generated
vendored
@ -325,7 +325,7 @@ var defaultOptions = {
|
||||
sourceType: "script",
|
||||
// `onInsertedSemicolon` can be a callback that will be called
|
||||
// when a semicolon is automatically inserted. It will be passed
|
||||
// th position of the comma as an offset, and if `locations` is
|
||||
// the position of the comma as an offset, and if `locations` is
|
||||
// enabled, it is given the location as a `{line, column}` object
|
||||
// as second argument.
|
||||
onInsertedSemicolon: null,
|
||||
@ -755,7 +755,8 @@ pp$1.isLet = function() {
|
||||
skipWhiteSpace.lastIndex = this.pos;
|
||||
var skip = skipWhiteSpace.exec(this.input);
|
||||
var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
|
||||
if (nextCh === 91 || nextCh === 123) { return true } // '{' and '['
|
||||
if (nextCh === 123 && !lineBreak.test(this.input.slice(this.end, next)) // '{'
|
||||
|| nextCh === 91) { return true } // '['
|
||||
if (isIdentifierStart(nextCh, true)) {
|
||||
var pos = next + 1;
|
||||
while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; }
|
||||
@ -1645,7 +1646,7 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
|
||||
break
|
||||
|
||||
case "ParenthesizedExpression":
|
||||
this.toAssignable(node.expression, isBinding);
|
||||
this.toAssignable(node.expression, isBinding, refDestructuringErrors);
|
||||
break
|
||||
|
||||
case "MemberExpression":
|
||||
@ -5275,7 +5276,7 @@ pp$8.readWord = function() {
|
||||
//
|
||||
// [walk]: util/walk.js
|
||||
|
||||
var version = "6.0.4";
|
||||
var version = "6.0.5";
|
||||
|
||||
// The main exported interface (under `self.acorn` when in the
|
||||
// browser) is a `parse` function that takes a code string and
|
||||
|
2
tools/node_modules/eslint/node_modules/acorn/dist/acorn.js.map
generated
vendored
2
tools/node_modules/eslint/node_modules/acorn/dist/acorn.js.map
generated
vendored
File diff suppressed because one or more lines are too long
9
tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs
generated
vendored
9
tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs
generated
vendored
@ -319,7 +319,7 @@ var defaultOptions = {
|
||||
sourceType: "script",
|
||||
// `onInsertedSemicolon` can be a callback that will be called
|
||||
// when a semicolon is automatically inserted. It will be passed
|
||||
// th position of the comma as an offset, and if `locations` is
|
||||
// the position of the comma as an offset, and if `locations` is
|
||||
// enabled, it is given the location as a `{line, column}` object
|
||||
// as second argument.
|
||||
onInsertedSemicolon: null,
|
||||
@ -749,7 +749,8 @@ pp$1.isLet = function() {
|
||||
skipWhiteSpace.lastIndex = this.pos;
|
||||
var skip = skipWhiteSpace.exec(this.input);
|
||||
var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
|
||||
if (nextCh === 91 || nextCh === 123) { return true } // '{' and '['
|
||||
if (nextCh === 123 && !lineBreak.test(this.input.slice(this.end, next)) // '{'
|
||||
|| nextCh === 91) { return true } // '['
|
||||
if (isIdentifierStart(nextCh, true)) {
|
||||
var pos = next + 1;
|
||||
while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; }
|
||||
@ -1639,7 +1640,7 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
|
||||
break
|
||||
|
||||
case "ParenthesizedExpression":
|
||||
this.toAssignable(node.expression, isBinding);
|
||||
this.toAssignable(node.expression, isBinding, refDestructuringErrors);
|
||||
break
|
||||
|
||||
case "MemberExpression":
|
||||
@ -5269,7 +5270,7 @@ pp$8.readWord = function() {
|
||||
//
|
||||
// [walk]: util/walk.js
|
||||
|
||||
var version = "6.0.4";
|
||||
var version = "6.0.5";
|
||||
|
||||
// The main exported interface (under `self.acorn` when in the
|
||||
// browser) is a `parse` function that takes a code string and
|
||||
|
2
tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs.map
generated
vendored
2
tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs.map
generated
vendored
File diff suppressed because one or more lines are too long
2
tools/node_modules/eslint/node_modules/acorn/package.json
generated
vendored
2
tools/node_modules/eslint/node_modules/acorn/package.json
generated
vendored
@ -39,5 +39,5 @@
|
||||
"scripts": {
|
||||
"prepare": "cd ..; npm run build:main && npm run build:bin"
|
||||
},
|
||||
"version": "6.0.4"
|
||||
"version": "6.0.5"
|
||||
}
|
6
tools/node_modules/eslint/node_modules/caller-path/index.js
generated
vendored
6
tools/node_modules/eslint/node_modules/caller-path/index.js
generated
vendored
@ -1,6 +0,0 @@
|
||||
'use strict';
|
||||
var callsites = require('callsites');
|
||||
|
||||
module.exports = function () {
|
||||
return callsites()[2].getFileName();
|
||||
};
|
36
tools/node_modules/eslint/node_modules/caller-path/readme.md
generated
vendored
36
tools/node_modules/eslint/node_modules/caller-path/readme.md
generated
vendored
@ -1,36 +0,0 @@
|
||||
# caller-path [](https://travis-ci.org/sindresorhus/caller-path)
|
||||
|
||||
> Get the path of the caller module
|
||||
|
||||
You can't use [`module.parent`](http://nodejs.org/api/modules.html#modules_module_parent) as modules are cached and it will return the first caller module, not necessarily the current one.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save caller-path
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
var callerPath = require('caller-path');
|
||||
|
||||
module.exports = function () {
|
||||
console.log(callerPath());
|
||||
//=> /Users/sindresorhus/dev/unicorn/bar.js
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
// bar.js
|
||||
var foo = require('./foo');
|
||||
foo();
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
73
tools/node_modules/eslint/node_modules/callsites/index.d.ts
generated
vendored
Normal file
73
tools/node_modules/eslint/node_modules/callsites/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
export interface CallSite {
|
||||
/**
|
||||
* Returns the value of `this`.
|
||||
*/
|
||||
getThis(): unknown | undefined;
|
||||
|
||||
/**
|
||||
* Returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property.
|
||||
*/
|
||||
getTypeName(): string | null;
|
||||
|
||||
/**
|
||||
* Returns the current function.
|
||||
*/
|
||||
getFunction(): Function | undefined;
|
||||
|
||||
/**
|
||||
* Returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context.
|
||||
*/
|
||||
getFunctionName(): string | null;
|
||||
|
||||
/**
|
||||
* Returns the name of the property of `this` or one of its prototypes that holds the current function.
|
||||
*/
|
||||
getMethodName(): string | undefined;
|
||||
|
||||
/**
|
||||
* Returns the name of the script if this function was defined in a script.
|
||||
*/
|
||||
getFileName(): string | null;
|
||||
|
||||
/**
|
||||
* Returns the current line number if this function was defined in a script.
|
||||
*/
|
||||
getLineNumber(): number | null;
|
||||
|
||||
/**
|
||||
* Returns the current column number if this function was defined in a script.
|
||||
*/
|
||||
getColumnNumber(): number | null;
|
||||
|
||||
/**
|
||||
* Returns a string representing the location where `eval` was called if this function was created using a call to `eval`.
|
||||
*/
|
||||
getEvalOrigin(): string | undefined;
|
||||
|
||||
/**
|
||||
* Returns `true` if this is a top-level invocation, that is, if it's a global object.
|
||||
*/
|
||||
isToplevel(): boolean;
|
||||
|
||||
/**
|
||||
* Returns `true` if this call takes place in code defined by a call to `eval`.
|
||||
*/
|
||||
isEval(): boolean;
|
||||
|
||||
/**
|
||||
* Returns `true` if this call is in native V8 code.
|
||||
*/
|
||||
isNative(): boolean;
|
||||
|
||||
/**
|
||||
* Returns `true` if this is a constructor call.
|
||||
*/
|
||||
isConstructor(): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get callsites from the V8 stack trace API.
|
||||
*
|
||||
* @returns An array of `CallSite` objects.
|
||||
*/
|
||||
export default function callsites(): CallSite[];
|
14
tools/node_modules/eslint/node_modules/callsites/index.js
generated
vendored
14
tools/node_modules/eslint/node_modules/callsites/index.js
generated
vendored
@ -1,8 +1,12 @@
|
||||
'use strict';
|
||||
module.exports = function () {
|
||||
var _ = Error.prepareStackTrace;
|
||||
Error.prepareStackTrace = function (_, stack) { return stack };
|
||||
var stack = new Error().stack.slice(1);
|
||||
Error.prepareStackTrace = _;
|
||||
|
||||
const callsites = () => {
|
||||
const _prepareStackTrace = Error.prepareStackTrace;
|
||||
Error.prepareStackTrace = (_, stack) => stack;
|
||||
const stack = new Error().stack.slice(1);
|
||||
Error.prepareStackTrace = _prepareStackTrace;
|
||||
return stack;
|
||||
};
|
||||
|
||||
module.exports = callsites;
|
||||
module.exports.default = callsites;
|
||||
|
9
tools/node_modules/eslint/node_modules/callsites/license
generated
vendored
Normal file
9
tools/node_modules/eslint/node_modules/callsites/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
tools/node_modules/eslint/node_modules/callsites/package.json
generated
vendored
21
tools/node_modules/eslint/node_modules/callsites/package.json
generated
vendored
@ -2,7 +2,7 @@
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/callsites/issues"
|
||||
@ -11,20 +11,23 @@
|
||||
"deprecated": false,
|
||||
"description": "Get callsites from the V8 stack trace API",
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
"ava": "^0.25.0",
|
||||
"tsd-check": "^0.2.1",
|
||||
"xo": "^0.23.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/callsites#readme",
|
||||
"keywords": [
|
||||
"callsites",
|
||||
"callsite",
|
||||
"v8",
|
||||
"stacktrace",
|
||||
"v8",
|
||||
"callsite",
|
||||
"callsites",
|
||||
"stack",
|
||||
"trace",
|
||||
"function",
|
||||
@ -39,7 +42,7 @@
|
||||
"url": "git+https://github.com/sindresorhus/callsites.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
"test": "xo && ava && tsd-check"
|
||||
},
|
||||
"version": "0.2.0"
|
||||
"version": "3.0.0"
|
||||
}
|
33
tools/node_modules/eslint/node_modules/callsites/readme.md
generated
vendored
33
tools/node_modules/eslint/node_modules/callsites/readme.md
generated
vendored
@ -1,47 +1,48 @@
|
||||
# callsites [](https://travis-ci.org/sindresorhus/callsites)
|
||||
|
||||
> Get callsites from the [V8 stack trace API](https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi)
|
||||
> Get callsites from the [V8 stack trace API](https://v8.dev/docs/stack-trace-api)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save callsites
|
||||
```
|
||||
$ npm install callsites
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var callsites = require('callsites');
|
||||
const callsites = require('callsites');
|
||||
|
||||
function unicorn() {
|
||||
console.log(callsites()[0].getFileName());
|
||||
//=> /Users/sindresorhus/dev/callsites/test.js
|
||||
//=> '/Users/sindresorhus/dev/callsites/test.js'
|
||||
}
|
||||
|
||||
unicorn();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Returns an array of callsite objects with the following methods:
|
||||
|
||||
- `getThis`: returns the value of this
|
||||
- `getTypeName`: returns the type of this as a string. This is the name of the function stored in the constructor field of this, if available, otherwise the object's [[Class]] internal property.
|
||||
- `getFunction`: returns the current function
|
||||
- `getFunctionName`: returns the name of the current function, typically its name property. If a name property is not available an attempt will be made to try to infer a name from the function's context.
|
||||
- `getMethodName`: returns the name of the property of this or one of its prototypes that holds the current function
|
||||
- `getFileName`: if this function was defined in a script returns the name of the script
|
||||
- `getLineNumber`: if this function was defined in a script returns the current line number
|
||||
- `getThis`: returns the value of `this`.
|
||||
- `getTypeName`: returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property.
|
||||
- `getFunction`: returns the current function.
|
||||
- `getFunctionName`: returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context.
|
||||
- `getMethodName`: returns the name of the property of `this` or one of its prototypes that holds the current function.
|
||||
- `getFileName`: if this function was defined in a script returns the name of the script.
|
||||
- `getLineNumber`: if this function was defined in a script returns the current line number.
|
||||
- `getColumnNumber`: if this function was defined in a script returns the current column number
|
||||
- `getEvalOrigin`: if this function was created using a call to eval returns a CallSite object representing the location where eval was called
|
||||
- `isToplevel`: is this a toplevel invocation, that is, is this the global object?
|
||||
- `isEval`: does this call take place in code defined by a call to eval?
|
||||
- `getEvalOrigin`: if this function was created using a call to `eval` returns a string representing the location where `eval` was called.
|
||||
- `isToplevel`: is this a top-level invocation, that is, is this the global object?
|
||||
- `isEval`: does this call take place in code defined by a call to `eval`?
|
||||
- `isNative`: is this call in native V8 code?
|
||||
- `isConstructor`: is this a constructor call?
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
|
@ -1,18 +1,18 @@
|
||||
'use strict';
|
||||
var path = require('path');
|
||||
var resolveFrom = require('resolve-from');
|
||||
var callerPath = require('caller-path');
|
||||
const path = require('path');
|
||||
const resolveFrom = require('resolve-from');
|
||||
const parentModule = require('parent-module');
|
||||
|
||||
module.exports = function (moduleId) {
|
||||
module.exports = moduleId => {
|
||||
if (typeof moduleId !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
var filePath = resolveFrom(path.dirname(callerPath()), moduleId);
|
||||
const filePath = resolveFrom(path.dirname(parentModule(__filename)), moduleId);
|
||||
|
||||
// delete itself from module parent
|
||||
// Delete itself from module parent
|
||||
if (require.cache[filePath] && require.cache[filePath].parent) {
|
||||
var i = require.cache[filePath].parent.children.length;
|
||||
let i = require.cache[filePath].parent.children.length;
|
||||
|
||||
while (i--) {
|
||||
if (require.cache[filePath].parent.children[i].id === filePath) {
|
||||
@ -21,9 +21,9 @@ module.exports = function (moduleId) {
|
||||
}
|
||||
}
|
||||
|
||||
// delete module from cache
|
||||
// Delete module from cache
|
||||
delete require.cache[filePath];
|
||||
|
||||
// return fresh module
|
||||
// Return fresh module
|
||||
return require(filePath);
|
||||
};
|
9
tools/node_modules/eslint/node_modules/import-fresh/license
generated
vendored
Normal file
9
tools/node_modules/eslint/node_modules/import-fresh/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -5,27 +5,27 @@
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/require-uncached/issues"
|
||||
"url": "https://github.com/sindresorhus/import-fresh/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"caller-path": "^0.1.0",
|
||||
"resolve-from": "^1.0.0"
|
||||
"parent-module": "^1.0.0",
|
||||
"resolve-from": "^4.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Require a module bypassing the cache",
|
||||
"description": "Import a module while bypassing the cache",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"heapdump": "^0.3.7",
|
||||
"xo": "^0.16.0"
|
||||
"ava": "^1.0.1",
|
||||
"heapdump": "^0.3.12",
|
||||
"xo": "^0.23.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/require-uncached#readme",
|
||||
"homepage": "https://github.com/sindresorhus/import-fresh#readme",
|
||||
"keywords": [
|
||||
"require",
|
||||
"cache",
|
||||
@ -36,19 +36,14 @@
|
||||
"bypass"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "require-uncached",
|
||||
"name": "import-fresh",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/require-uncached.git"
|
||||
"url": "git+https://github.com/sindresorhus/import-fresh.git"
|
||||
},
|
||||
"scripts": {
|
||||
"heapdump": "node heapdump.js",
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.0.3",
|
||||
"xo": {
|
||||
"rules": {
|
||||
"import/no-dynamic-require": "off"
|
||||
}
|
||||
}
|
||||
"version": "3.0.0"
|
||||
}
|
50
tools/node_modules/eslint/node_modules/import-fresh/readme.md
generated
vendored
Normal file
50
tools/node_modules/eslint/node_modules/import-fresh/readme.md
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
# import-fresh [](https://travis-ci.org/sindresorhus/import-fresh)
|
||||
|
||||
> Import a module while bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching)
|
||||
|
||||
Useful for testing purposes when you need to freshly import a module.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install import-fresh
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
let i = 0;
|
||||
module.exports = () => ++i;
|
||||
```
|
||||
|
||||
```js
|
||||
const importFresh = require('import-fresh');
|
||||
|
||||
require('./foo')();
|
||||
//=> 1
|
||||
|
||||
require('./foo')();
|
||||
//=> 2
|
||||
|
||||
importFresh('./foo')();
|
||||
//=> 1
|
||||
|
||||
importFresh('./foo')();
|
||||
//=> 1
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [clear-module](https://github.com/sindresorhus/clear-module) - Clear a module from the import cache
|
||||
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
|
||||
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
33
tools/node_modules/eslint/node_modules/parent-module/index.js
generated
vendored
Normal file
33
tools/node_modules/eslint/node_modules/parent-module/index.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
const callsites = require('callsites');
|
||||
|
||||
module.exports = filepath => {
|
||||
const stacks = callsites();
|
||||
|
||||
if (!filepath) {
|
||||
return stacks[2].getFileName();
|
||||
}
|
||||
|
||||
let seenVal = false;
|
||||
|
||||
// Skip the first stack as it's this function
|
||||
stacks.shift();
|
||||
|
||||
for (const stack of stacks) {
|
||||
const parentFilepath = stack.getFileName();
|
||||
|
||||
if (parentFilepath === filepath) {
|
||||
seenVal = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip native modules
|
||||
if (parentFilepath === 'module.js') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (seenVal && parentFilepath !== filepath) {
|
||||
return parentFilepath;
|
||||
}
|
||||
}
|
||||
};
|
9
tools/node_modules/eslint/node_modules/parent-module/license
generated
vendored
Normal file
9
tools/node_modules/eslint/node_modules/parent-module/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -2,33 +2,38 @@
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/caller-path/issues"
|
||||
"url": "https://github.com/sindresorhus/parent-module/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"callsites": "^0.2.0"
|
||||
"callsites": "^3.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Get the path of the caller module",
|
||||
"description": "Get the path of the parent module",
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
"ava": "^1.0.1",
|
||||
"execa": "^1.0.0",
|
||||
"xo": "^0.23.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/caller-path#readme",
|
||||
"homepage": "https://github.com/sindresorhus/parent-module#readme",
|
||||
"keywords": [
|
||||
"parent",
|
||||
"module",
|
||||
"package",
|
||||
"pkg",
|
||||
"caller",
|
||||
"calling",
|
||||
"module",
|
||||
"path",
|
||||
"parent",
|
||||
"callsites",
|
||||
"callsite",
|
||||
"stacktrace",
|
||||
@ -38,13 +43,13 @@
|
||||
"file"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "caller-path",
|
||||
"name": "parent-module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/caller-path.git"
|
||||
"url": "git+https://github.com/sindresorhus/parent-module.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "0.1.0"
|
||||
"version": "1.0.0"
|
||||
}
|
66
tools/node_modules/eslint/node_modules/parent-module/readme.md
generated
vendored
Normal file
66
tools/node_modules/eslint/node_modules/parent-module/readme.md
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
# parent-module [](https://travis-ci.org/sindresorhus/parent-module)
|
||||
|
||||
> Get the path of the parent module
|
||||
|
||||
Node.js exposes `module.parent`, but it only gives you the first cached parent, which is not necessarily the actual parent.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save parent-module
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// bar.js
|
||||
const parentModule = require('parent-module');
|
||||
|
||||
module.exports = () => {
|
||||
console.log(parentModule());
|
||||
//=> '/Users/sindresorhus/dev/unicorn/foo.js'
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
const bar = require('./bar');
|
||||
bar();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### parentModule([filepath])
|
||||
|
||||
By default, it will return the path of the immediate parent.
|
||||
|
||||
#### filepath
|
||||
|
||||
Type: `string`<br>
|
||||
Default: [`__filename`](https://nodejs.org/api/globals.html#globals_filename)
|
||||
|
||||
Filepath of the module of which to get the parent path.
|
||||
|
||||
Useful if you want it to work [multiple module levels down](https://github.com/sindresorhus/parent-module/tree/master/fixtures/filepath).
|
||||
|
||||
|
||||
## Tip
|
||||
|
||||
Combine it with [`read-pkg-up`](https://github.com/sindresorhus/read-pkg-up) to read the package.json of the parent module.
|
||||
|
||||
```js
|
||||
const path = require('path');
|
||||
const readPkgUp = require('read-pkg-up');
|
||||
const parentModule = require('parent-module');
|
||||
|
||||
console.log(readPkgUp.sync({cwd: path.dirname(parentModule())}).pkg);
|
||||
//=> {name: 'chalk', version: '1.0.0', ...}
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
21
tools/node_modules/eslint/node_modules/require-uncached/license
generated
vendored
21
tools/node_modules/eslint/node_modules/require-uncached/license
generated
vendored
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
47
tools/node_modules/eslint/node_modules/require-uncached/readme.md
generated
vendored
47
tools/node_modules/eslint/node_modules/require-uncached/readme.md
generated
vendored
@ -1,47 +0,0 @@
|
||||
# require-uncached [](https://travis-ci.org/sindresorhus/require-uncached)
|
||||
|
||||
> Require a module bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching)
|
||||
|
||||
Useful for testing purposes when you need to freshly require a module.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save require-uncached
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
let i = 0;
|
||||
module.exports = () => ++i;
|
||||
```
|
||||
|
||||
```js
|
||||
const requireUncached = require('require-uncached');
|
||||
|
||||
require('./foo')();
|
||||
//=> 1
|
||||
|
||||
require('./foo')();
|
||||
//=> 2
|
||||
|
||||
requireUncached('./foo')();
|
||||
//=> 1
|
||||
|
||||
requireUncached('./foo')();
|
||||
//=> 1
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [clear-require](https://github.com/sindresorhus/clear-require) - Clear a module from the require cache
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
44
tools/node_modules/eslint/node_modules/resolve-from/index.js
generated
vendored
44
tools/node_modules/eslint/node_modules/resolve-from/index.js
generated
vendored
@ -1,19 +1,47 @@
|
||||
'use strict';
|
||||
var path = require('path');
|
||||
var Module = require('module');
|
||||
const path = require('path');
|
||||
const Module = require('module');
|
||||
const fs = require('fs');
|
||||
|
||||
module.exports = function (fromDir, moduleId) {
|
||||
if (typeof fromDir !== 'string' || typeof moduleId !== 'string') {
|
||||
throw new TypeError('Expected `fromDir` and `moduleId` to be a string');
|
||||
const resolveFrom = (fromDir, moduleId, silent) => {
|
||||
if (typeof fromDir !== 'string') {
|
||||
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``);
|
||||
}
|
||||
|
||||
fromDir = path.resolve(fromDir);
|
||||
if (typeof moduleId !== 'string') {
|
||||
throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
|
||||
}
|
||||
|
||||
var fromFile = path.join(fromDir, 'noop.js');
|
||||
try {
|
||||
fromDir = fs.realpathSync(fromDir);
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
fromDir = path.resolve(fromDir);
|
||||
} else if (silent) {
|
||||
return null;
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
return Module._resolveFilename(moduleId, {
|
||||
const fromFile = path.join(fromDir, 'noop.js');
|
||||
|
||||
const resolveFileName = () => Module._resolveFilename(moduleId, {
|
||||
id: fromFile,
|
||||
filename: fromFile,
|
||||
paths: Module._nodeModulePaths(fromDir)
|
||||
});
|
||||
|
||||
if (silent) {
|
||||
try {
|
||||
return resolveFileName();
|
||||
} catch (err) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return resolveFileName();
|
||||
};
|
||||
|
||||
module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId);
|
||||
module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true);
|
||||
|
20
tools/node_modules/eslint/node_modules/resolve-from/license
generated
vendored
20
tools/node_modules/eslint/node_modules/resolve-from/license
generated
vendored
@ -1,21 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
8
tools/node_modules/eslint/node_modules/resolve-from/package.json
generated
vendored
8
tools/node_modules/eslint/node_modules/resolve-from/package.json
generated
vendored
@ -9,13 +9,13 @@
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Resolve the path of a module like require.resolve() but from a given path",
|
||||
"description": "Resolve the path of a module like `require.resolve()` but from a given path",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
@ -28,7 +28,7 @@
|
||||
"module",
|
||||
"from",
|
||||
"like",
|
||||
"path"
|
||||
"import"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "resolve-from",
|
||||
@ -39,5 +39,5 @@
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.0.1"
|
||||
"version": "4.0.0"
|
||||
}
|
28
tools/node_modules/eslint/node_modules/resolve-from/readme.md
generated
vendored
28
tools/node_modules/eslint/node_modules/resolve-from/readme.md
generated
vendored
@ -1,12 +1,12 @@
|
||||
# resolve-from [](https://travis-ci.org/sindresorhus/resolve-from)
|
||||
|
||||
> Resolve the path of a module like [`require.resolve()`](http://nodejs.org/api/globals.html#globals_require_resolve) but from a given path
|
||||
> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save resolve-from
|
||||
$ npm install resolve-from
|
||||
```
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ $ npm install --save resolve-from
|
||||
```js
|
||||
const resolveFrom = require('resolve-from');
|
||||
|
||||
// there's a file at `./foo/bar.js`
|
||||
// There is a file at `./foo/bar.js`
|
||||
|
||||
resolveFrom('foo', './bar');
|
||||
//=> '/Users/sindresorhus/dev/test/foo/bar.js'
|
||||
@ -26,11 +26,17 @@ resolveFrom('foo', './bar');
|
||||
|
||||
### resolveFrom(fromDir, moduleId)
|
||||
|
||||
Like `require()`, throws when the module can't be found.
|
||||
|
||||
### resolveFrom.silent(fromDir, moduleId)
|
||||
|
||||
Returns `null` instead of throwing when the module can't be found.
|
||||
|
||||
#### fromDir
|
||||
|
||||
Type: `string`
|
||||
|
||||
The directory to resolve from.
|
||||
Directory to resolve from.
|
||||
|
||||
#### moduleId
|
||||
|
||||
@ -41,7 +47,7 @@ What you would use in `require()`.
|
||||
|
||||
## Tip
|
||||
|
||||
Create a partial using a bound function if you want to require from the same `fromDir` multiple times:
|
||||
Create a partial using a bound function if you want to resolve from the same `fromDir` multiple times:
|
||||
|
||||
```js
|
||||
const resolveFromFoo = resolveFrom.bind(null, 'foo');
|
||||
@ -51,6 +57,16 @@ resolveFromFoo('./baz');
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory
|
||||
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
|
||||
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
|
||||
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily
|
||||
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
|
9
tools/node_modules/eslint/node_modules/rimraf/package.json
generated
vendored
9
tools/node_modules/eslint/node_modules/rimraf/package.json
generated
vendored
@ -12,13 +12,13 @@
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"glob": "^7.0.5"
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A deep deletion module for node (like `rm -rf`)",
|
||||
"devDependencies": {
|
||||
"mkdirp": "^0.5.1",
|
||||
"tap": "^10.1.2"
|
||||
"tap": "^12.1.1"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
@ -35,7 +35,10 @@
|
||||
"url": "git://github.com/isaacs/rimraf.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "git push origin --all; git push origin --tags",
|
||||
"postversion": "npm publish",
|
||||
"preversion": "npm test",
|
||||
"test": "tap test/*.js"
|
||||
},
|
||||
"version": "2.6.2"
|
||||
"version": "2.6.3"
|
||||
}
|
10
tools/node_modules/eslint/package.json
generated
vendored
10
tools/node_modules/eslint/package.json
generated
vendored
@ -29,6 +29,7 @@
|
||||
"glob": "^7.1.2",
|
||||
"globals": "^11.7.0",
|
||||
"ignore": "^4.0.6",
|
||||
"import-fresh": "^3.0.0",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"inquirer": "^6.1.0",
|
||||
"js-yaml": "^3.12.0",
|
||||
@ -43,7 +44,6 @@
|
||||
"pluralize": "^7.0.0",
|
||||
"progress": "^2.0.0",
|
||||
"regexpp": "^2.0.1",
|
||||
"require-uncached": "^1.0.3",
|
||||
"semver": "^5.5.1",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"strip-json-comments": "^2.0.1",
|
||||
@ -65,7 +65,7 @@
|
||||
"coveralls": "^3.0.1",
|
||||
"dateformat": "^3.0.3",
|
||||
"ejs": "^2.6.1",
|
||||
"eslint-plugin-eslint-plugin": "^1.4.1",
|
||||
"eslint-plugin-eslint-plugin": "^2.0.1",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-rulesdir": "^0.1.0",
|
||||
"eslint-release": "^1.2.0",
|
||||
@ -76,17 +76,17 @@
|
||||
"jsdoc": "^3.5.5",
|
||||
"karma": "^3.0.0",
|
||||
"karma-babel-preprocessor": "^7.0.0",
|
||||
"karma-chrome-launcher": "^2.2.0",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"karma-mocha-reporter": "^2.2.3",
|
||||
"karma-phantomjs-launcher": "^1.0.4",
|
||||
"leche": "^2.2.3",
|
||||
"load-perf": "^0.2.0",
|
||||
"markdownlint": "^0.11.0",
|
||||
"mocha": "^5.0.5",
|
||||
"mock-fs": "^4.6.0",
|
||||
"npm-license": "^0.3.3",
|
||||
"phantomjs-prebuilt": "^2.1.16",
|
||||
"proxyquire": "^2.0.1",
|
||||
"puppeteer": "^1.9.0",
|
||||
"shelljs": "^0.8.2",
|
||||
"sinon": "^3.3.0",
|
||||
"temp": "^0.8.3",
|
||||
@ -134,5 +134,5 @@
|
||||
"publish-release": "node Makefile.js publishRelease",
|
||||
"test": "node Makefile.js test"
|
||||
},
|
||||
"version": "5.11.1"
|
||||
"version": "5.12.0"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user