diff --git a/tools/node_modules/babel-eslint/node_modules/color-name/.eslintrc.json b/tools/node_modules/babel-eslint/node_modules/color-name/.eslintrc.json deleted file mode 100644 index c50c250446ee6d..00000000000000 --- a/tools/node_modules/babel-eslint/node_modules/color-name/.eslintrc.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "env": { - "browser": true, - "node": true, - "commonjs": true, - "es6": true - }, - "extends": "eslint:recommended", - "rules": { - "strict": 2, - "indent": 0, - "linebreak-style": 0, - "quotes": 0, - "semi": 0, - "no-cond-assign": 1, - "no-constant-condition": 1, - "no-duplicate-case": 1, - "no-empty": 1, - "no-ex-assign": 1, - "no-extra-boolean-cast": 1, - "no-extra-semi": 1, - "no-fallthrough": 1, - "no-func-assign": 1, - "no-global-assign": 1, - "no-implicit-globals": 2, - "no-inner-declarations": ["error", "functions"], - "no-irregular-whitespace": 2, - "no-loop-func": 1, - "no-multi-str": 1, - "no-mixed-spaces-and-tabs": 1, - "no-proto": 1, - "no-sequences": 1, - "no-throw-literal": 1, - "no-unmodified-loop-condition": 1, - "no-useless-call": 1, - "no-void": 1, - "no-with": 2, - "wrap-iife": 1, - "no-redeclare": 1, - "no-unused-vars": ["error", { "vars": "all", "args": "none" }], - "no-sparse-arrays": 1 - } -} diff --git a/tools/node_modules/eslint/lib/formatters/codeframe.js b/tools/node_modules/eslint/lib/formatters/codeframe.js index 0b97a0d8180331..a42872c5a1deb2 100644 --- a/tools/node_modules/eslint/lib/formatters/codeframe.js +++ b/tools/node_modules/eslint/lib/formatters/codeframe.js @@ -5,7 +5,7 @@ "use strict"; const chalk = require("chalk"); -const codeFrame = require("babel-code-frame"); +const { codeFrameColumns } = require("@babel/code-frame"); const path = require("path"); //------------------------------------------------------------------------------ @@ -63,7 +63,7 @@ function formatMessage(message, parentResult) { if (sourceCode) { result.push( - codeFrame(sourceCode, message.line, message.column, { highlightCode: false }) + codeFrameColumns(sourceCode, { start: { line: message.line, column: message.column } }, { highlightCode: false }) ); } diff --git a/tools/node_modules/eslint/lib/rules/camelcase.js b/tools/node_modules/eslint/lib/rules/camelcase.js index ec611662135cfd..3005963ab04c2d 100644 --- a/tools/node_modules/eslint/lib/rules/camelcase.js +++ b/tools/node_modules/eslint/lib/rules/camelcase.js @@ -145,7 +145,7 @@ module.exports = { const assignmentKeyEqualsValue = node.parent.key.name === node.parent.value.name; // prevent checking righthand side of destructured object - if (!assignmentKeyEqualsValue && node.parent.key === node) { + if (node.parent.key === node && node.parent.value !== node) { return; } diff --git a/tools/node_modules/eslint/lib/rules/for-direction.js b/tools/node_modules/eslint/lib/rules/for-direction.js index 817e2c111e9d7d..b93c4c2caa4b66 100644 --- a/tools/node_modules/eslint/lib/rules/for-direction.js +++ b/tools/node_modules/eslint/lib/rules/for-direction.js @@ -18,7 +18,10 @@ module.exports = { url: "https://eslint.org/docs/rules/for-direction" }, fixable: null, - schema: [] + schema: [], + messages: { + incorrectDirection: "The update clause in this loop moves the variable in the wrong direction." + } }, create(context) { @@ -31,7 +34,7 @@ module.exports = { function report(node) { context.report({ node, - message: "The update clause in this loop moves the variable in the wrong direction." + messageId: "incorrectDirection" }); } diff --git a/tools/node_modules/eslint/lib/rules/func-call-spacing.js b/tools/node_modules/eslint/lib/rules/func-call-spacing.js index 83142bae8ca920..9aae3e2517e05b 100644 --- a/tools/node_modules/eslint/lib/rules/func-call-spacing.js +++ b/tools/node_modules/eslint/lib/rules/func-call-spacing.js @@ -57,6 +57,10 @@ module.exports = { maxItems: 2 } ] + }, + messages: { + unexpected: "Unexpected newline between function name and paren.", + missing: "Missing space between function name and paren." } }, @@ -116,7 +120,7 @@ module.exports = { context.report({ node, loc: lastCalleeToken.loc.start, - message: "Unexpected space between function name and paren.", + messageId: "unexpected", fix(fixer) { /* @@ -134,7 +138,7 @@ module.exports = { context.report({ node, loc: lastCalleeToken.loc.start, - message: "Missing space between function name and paren.", + messageId: "missing", fix(fixer) { return fixer.insertTextBefore(parenToken, " "); } @@ -143,7 +147,7 @@ module.exports = { context.report({ node, loc: lastCalleeToken.loc.start, - message: "Unexpected newline between function name and paren.", + messageId: "unexpected", fix(fixer) { return fixer.replaceTextRange([prevToken.range[1], parenToken.range[0]], " "); } diff --git a/tools/node_modules/eslint/lib/rules/func-name-matching.js b/tools/node_modules/eslint/lib/rules/func-name-matching.js index d66f630fcce13e..89c07c3514c6b2 100644 --- a/tools/node_modules/eslint/lib/rules/func-name-matching.js +++ b/tools/node_modules/eslint/lib/rules/func-name-matching.js @@ -87,6 +87,12 @@ module.exports = { additionalItems: false, items: [optionsObject] }] + }, + 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}}`" } }, @@ -132,20 +138,20 @@ module.exports = { * @returns {void} */ function report(node, name, funcName, isProp) { - let message; + let messageId; if (nameMatches === "always" && isProp) { - message = "Function name `{{funcName}}` should match property name `{{name}}`"; + messageId = "matchProperty"; } else if (nameMatches === "always") { - message = "Function name `{{funcName}}` should match variable name `{{name}}`"; + messageId = "matchVariable"; } else if (isProp) { - message = "Function name `{{funcName}}` should not match property name `{{name}}`"; + messageId = "notMatchProperty"; } else { - message = "Function name `{{funcName}}` should not match variable name `{{name}}`"; + messageId = "notMatchVariable"; } context.report({ node, - message, + messageId, data: { name, funcName diff --git a/tools/node_modules/eslint/lib/rules/func-names.js b/tools/node_modules/eslint/lib/rules/func-names.js index 500b95a1c6fd95..a4f5d105d8923a 100644 --- a/tools/node_modules/eslint/lib/rules/func-names.js +++ b/tools/node_modules/eslint/lib/rules/func-names.js @@ -37,7 +37,11 @@ module.exports = { { enum: ["always", "as-needed", "never"] } - ] + ], + messages: { + unnamed: "Unexpected unnamed {{name}}.", + named: "Unexpected named {{name}}." + } }, create(context) { @@ -96,7 +100,7 @@ module.exports = { if (hasName) { context.report({ node, - message: "Unexpected named {{name}}.", + messageId: "named", data: { name } }); } @@ -104,7 +108,7 @@ module.exports = { if (!hasName && (asNeeded ? !hasInferredName(node) : !isObjectOrClassMethod(node))) { context.report({ node, - message: "Unexpected unnamed {{name}}.", + messageId: "unnamed", data: { name } }); } diff --git a/tools/node_modules/eslint/lib/rules/func-style.js b/tools/node_modules/eslint/lib/rules/func-style.js index ea6d74fb3a4998..ff48792d29af5d 100644 --- a/tools/node_modules/eslint/lib/rules/func-style.js +++ b/tools/node_modules/eslint/lib/rules/func-style.js @@ -30,7 +30,11 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + expression: "Expected a function expression.", + declaration: "Expected a function declaration." + } }, create(context) { @@ -45,7 +49,7 @@ module.exports = { stack.push(false); if (!enforceDeclarations && node.parent.type !== "ExportDefaultDeclaration") { - context.report({ node, message: "Expected a function expression." }); + context.report({ node, messageId: "expression" }); } }, "FunctionDeclaration:exit"() { @@ -56,7 +60,7 @@ module.exports = { stack.push(false); if (enforceDeclarations && node.parent.type === "VariableDeclarator") { - context.report({ node: node.parent, message: "Expected a function declaration." }); + context.report({ node: node.parent, messageId: "declaration" }); } }, "FunctionExpression:exit"() { @@ -79,7 +83,7 @@ module.exports = { const hasThisExpr = stack.pop(); if (enforceDeclarations && !hasThisExpr && node.parent.type === "VariableDeclarator") { - context.report({ node: node.parent, message: "Expected a function declaration." }); + context.report({ node: node.parent, messageId: "declaration" }); } }; } diff --git a/tools/node_modules/eslint/lib/rules/function-paren-newline.js b/tools/node_modules/eslint/lib/rules/function-paren-newline.js index c483e40da9d749..d78e88038e2030 100644 --- a/tools/node_modules/eslint/lib/rules/function-paren-newline.js +++ b/tools/node_modules/eslint/lib/rules/function-paren-newline.js @@ -41,7 +41,13 @@ module.exports = { } ] } - ] + ], + messages: { + expectedBefore: "Expected newline before ')'.", + expectedAfter: "Expected newline after '('.", + unexpectedBefore: "Unexpected newline before '('.", + unexpectedAfter: "Unexpected newline after ')'." + } }, create(context) { @@ -99,7 +105,7 @@ module.exports = { if (hasLeftNewline && !needsNewlines) { context.report({ node: leftParen, - message: "Unexpected newline after '('.", + messageId: "unexpectedAfter", fix(fixer) { return sourceCode.getText().slice(leftParen.range[1], tokenAfterLeftParen.range[0]).trim() @@ -111,7 +117,7 @@ module.exports = { } else if (!hasLeftNewline && needsNewlines) { context.report({ node: leftParen, - message: "Expected a newline after '('.", + messageId: "expectedAfter", fix: fixer => fixer.insertTextAfter(leftParen, "\n") }); } @@ -119,7 +125,7 @@ module.exports = { if (hasRightNewline && !needsNewlines) { context.report({ node: rightParen, - message: "Unexpected newline before ')'.", + messageId: "unexpectedBefore", fix(fixer) { return sourceCode.getText().slice(tokenBeforeRightParen.range[1], rightParen.range[0]).trim() @@ -131,7 +137,7 @@ module.exports = { } else if (!hasRightNewline && needsNewlines) { context.report({ node: rightParen, - message: "Expected a newline before ')'.", + messageId: "expectedBefore", fix: fixer => fixer.insertTextBefore(rightParen, "\n") }); } diff --git a/tools/node_modules/eslint/lib/rules/generator-star-spacing.js b/tools/node_modules/eslint/lib/rules/generator-star-spacing.js index 68f2863626a76c..97868dd3fa980e 100644 --- a/tools/node_modules/eslint/lib/rules/generator-star-spacing.js +++ b/tools/node_modules/eslint/lib/rules/generator-star-spacing.js @@ -55,7 +55,13 @@ module.exports = { } ] } - ] + ], + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } }, create(context) { @@ -119,6 +125,15 @@ module.exports = { ); } + /** + * capitalize a given string. + * @param {string} str the given string. + * @returns {string} the capitalized string. + */ + function capitalize(str) { + return str[0].toUpperCase() + str.slice(1); + } + /** * Checks the spacing between two tokens before or after the star token. * @@ -135,17 +150,11 @@ module.exports = { const after = leftToken.value === "*"; const spaceRequired = modes[kind][side]; const node = after ? leftToken : rightToken; - const type = spaceRequired ? "Missing" : "Unexpected"; - const message = "{{type}} space {{side}} *."; - const data = { - type, - side - }; + const messageId = `${spaceRequired ? "missing" : "unexpected"}${capitalize(side)}`; context.report({ node, - message, - data, + messageId, fix(fixer) { if (spaceRequired) { if (after) { diff --git a/tools/node_modules/eslint/lib/rules/getter-return.js b/tools/node_modules/eslint/lib/rules/getter-return.js index 8fd9f1599ce0cf..452ba49f595783 100644 --- a/tools/node_modules/eslint/lib/rules/getter-return.js +++ b/tools/node_modules/eslint/lib/rules/getter-return.js @@ -61,7 +61,11 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + expected: "Expected to return a value in {{name}}.", + expectedAlways: "Expected {{name}} to always return a value." + } }, create(context) { @@ -93,9 +97,7 @@ module.exports = { context.report({ node, loc: getId(node).loc.start, - message: funcInfo.hasReturn - ? "Expected {{name}} to always return a value." - : "Expected to return a value in {{name}}.", + messageId: funcInfo.hasReturn ? "expectedAlways" : "expected", data: { name: astUtils.getFunctionNameWithKind(funcInfo.node) } @@ -161,7 +163,7 @@ module.exports = { if (!options.allowImplicit && !node.argument) { context.report({ node, - message: "Expected to return a value in {{name}}.", + messageId: "expected", data: { name: astUtils.getFunctionNameWithKind(funcInfo.node) } diff --git a/tools/node_modules/eslint/lib/rules/max-params.js b/tools/node_modules/eslint/lib/rules/max-params.js index 902391b74ff791..4089e8ae899359 100644 --- a/tools/node_modules/eslint/lib/rules/max-params.js +++ b/tools/node_modules/eslint/lib/rules/max-params.js @@ -53,7 +53,7 @@ module.exports = { }, create(context) { - + const sourceCode = context.getSourceCode(); const option = context.options[0]; let numParams = 3; @@ -76,6 +76,7 @@ module.exports = { function checkFunction(node) { if (node.params.length > numParams) { context.report({ + loc: astUtils.getFunctionHeadLoc(node, sourceCode), node, message: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}.", data: { diff --git a/tools/node_modules/eslint/lib/rules/no-magic-numbers.js b/tools/node_modules/eslint/lib/rules/no-magic-numbers.js index 2826dbf493d75b..b70ca82675089d 100644 --- a/tools/node_modules/eslint/lib/rules/no-magic-numbers.js +++ b/tools/node_modules/eslint/lib/rules/no-magic-numbers.js @@ -39,7 +39,11 @@ module.exports = { } }, additionalProperties: false - }] + }], + messages: { + useConst: "Number constants declarations must use 'const'.", + noMagic: "No magic number: {{raw}}." + } }, create(context) { @@ -136,7 +140,7 @@ module.exports = { if (enforceConst && parent.parent.kind !== "const") { context.report({ node: fullNumberNode, - message: "Number constants declarations must use 'const'." + messageId: "useConst" }); } } else if ( @@ -145,7 +149,7 @@ module.exports = { ) { context.report({ node: fullNumberNode, - message: "No magic number: {{raw}}.", + messageId: "noMagic", data: { raw } diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/LICENSE b/tools/node_modules/eslint/node_modules/@babel/code-frame/LICENSE new file mode 100644 index 00000000000000..620366eb90071c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/code-frame/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-2018 Sebastian McKenzie + +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. diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/README.md b/tools/node_modules/eslint/node_modules/@babel/code-frame/README.md new file mode 100644 index 00000000000000..185f93d2471999 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/code-frame/README.md @@ -0,0 +1,19 @@ +# @babel/code-frame + +> Generate errors that contain a code frame that point to source locations. + +See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/code-frame +``` + +or using yarn: + +```sh +yarn add @babel/code-frame --dev +``` diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js new file mode 100644 index 00000000000000..1f64c6ce7b992d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js @@ -0,0 +1,173 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.codeFrameColumns = codeFrameColumns; +exports.default = _default; + +function _highlight() { + const data = _interopRequireWildcard(require("@babel/highlight")); + + _highlight = function () { + return data; + }; + + return data; +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +let deprecationWarningShown = false; + +function getDefs(chalk) { + return { + gutter: chalk.grey, + marker: chalk.red.bold, + message: chalk.red.bold + }; +} + +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; + +function getMarkerLines(loc, source, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); + + if (startLine === -1) { + start = 0; + } + + if (endLine === -1) { + end = source.length; + } + + const lineDiff = endLine - startLine; + const markerLines = {}; + + if (lineDiff) { + for (let i = 0; i <= lineDiff; i++) { + const lineNumber = i + startLine; + + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn]; + } else if (i === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + + return { + start, + end, + markerLines + }; +} + +function codeFrameColumns(rawLines, loc, opts = {}) { + const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight().shouldHighlight)(opts); + const chalk = (0, _highlight().getChalk)(opts); + const defs = getDefs(chalk); + + const maybeHighlight = (chalkFn, string) => { + return highlighted ? chalkFn(string) : string; + }; + + if (highlighted) rawLines = (0, _highlight().default)(rawLines, opts); + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + let frame = lines.slice(start, end).map((line, index) => { + const number = start + 1 + index; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} | `; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + + if (hasMarker) { + let markerLine = ""; + + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); + + if (lastMarkerLine && opts.message) { + markerLine += " " + maybeHighlight(defs.message, opts.message); + } + } + + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); + } else { + return ` ${maybeHighlight(defs.gutter, gutter)}${line}`; + } + }).join("\n"); + + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; + } + + if (highlighted) { + return chalk.reset(frame); + } else { + return frame; + } +} + +function _default(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location, opts); +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json b/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json new file mode 100644 index 00000000000000..f3b551dfa972de --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json @@ -0,0 +1,25 @@ +{ + "author": { + "name": "Sebastian McKenzie", + "email": "sebmck@gmail.com" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/highlight": "^7.0.0" + }, + "deprecated": false, + "description": "Generate errors that contain a code frame that point to source locations.", + "devDependencies": { + "chalk": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "homepage": "https://babeljs.io/", + "license": "MIT", + "main": "lib/index.js", + "name": "@babel/code-frame", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/babel-code-frame" + }, + "version": "7.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/LICENSE b/tools/node_modules/eslint/node_modules/@babel/highlight/LICENSE new file mode 100644 index 00000000000000..620366eb90071c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-2018 Sebastian McKenzie + +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. diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/README.md new file mode 100644 index 00000000000000..72dae6094590f3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/README.md @@ -0,0 +1,19 @@ +# @babel/highlight + +> Syntax highlight JavaScript strings for output in terminals. + +See our website [@babel/highlight](https://babeljs.io/docs/en/next/babel-highlight.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/highlight +``` + +or using yarn: + +```sh +yarn add @babel/highlight --dev +``` diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js new file mode 100644 index 00000000000000..6ac5b4a350b8e6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js @@ -0,0 +1,129 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.shouldHighlight = shouldHighlight; +exports.getChalk = getChalk; +exports.default = highlight; + +function _jsTokens() { + const data = _interopRequireWildcard(require("js-tokens")); + + _jsTokens = function () { + return data; + }; + + return data; +} + +function _esutils() { + const data = _interopRequireDefault(require("esutils")); + + _esutils = function () { + return data; + }; + + return data; +} + +function _chalk() { + const data = _interopRequireDefault(require("chalk")); + + _chalk = function () { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function getDefs(chalk) { + return { + keyword: chalk.cyan, + capitalized: chalk.yellow, + jsx_tag: chalk.yellow, + punctuator: chalk.yellow, + number: chalk.magenta, + string: chalk.green, + regex: chalk.magenta, + comment: chalk.grey, + invalid: chalk.white.bgRed.bold + }; +} + +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +const JSX_TAG = /^[a-z][\w-]*$/i; +const BRACKET = /^[()[\]{}]$/; + +function getTokenType(match) { + const [offset, text] = match.slice(-2); + const token = (0, _jsTokens().matchToToken)(match); + + if (token.type === "name") { + if (_esutils().default.keyword.isReservedWordES6(token.value)) { + return "keyword"; + } + + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " colorize(str)).join("\n"); + } else { + return args[0]; + } + }); +} + +function shouldHighlight(options) { + return _chalk().default.supportsColor || options.forceColor; +} + +function getChalk(options) { + let chalk = _chalk().default; + + if (options.forceColor) { + chalk = new (_chalk().default.constructor)({ + enabled: true, + level: 1 + }); + } + + return chalk; +} + +function highlight(code, options = {}) { + if (shouldHighlight(options)) { + const chalk = getChalk(options); + const defs = getDefs(chalk); + return highlightTokens(defs, code); + } else { + return code; + } +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/package.json new file mode 100644 index 00000000000000..ff84c66ec29732 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/highlight/package.json @@ -0,0 +1,26 @@ +{ + "author": { + "name": "suchipi", + "email": "me@suchipi.com" + }, + "bundleDependencies": false, + "dependencies": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "deprecated": false, + "description": "Syntax highlight JavaScript strings for output in terminals.", + "devDependencies": { + "strip-ansi": "^4.0.0" + }, + "homepage": "https://babeljs.io/", + "license": "MIT", + "main": "lib/index.js", + "name": "@babel/highlight", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/babel-highlight" + }, + "version": "7.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/acorn/bin/test262.whitelist b/tools/node_modules/eslint/node_modules/acorn/bin/test262.whitelist index b00d3404e31328..c8c6ce4a82774b 100644 --- a/tools/node_modules/eslint/node_modules/acorn/bin/test262.whitelist +++ b/tools/node_modules/eslint/node_modules/acorn/bin/test262.whitelist @@ -212,10 +212,6 @@ language/module-code/early-export-global.js (default) language/module-code/early-export-global.js (strict mode) language/module-code/early-export-unresolvable.js (default) language/module-code/early-export-unresolvable.js (strict mode) -language/module-code/parse-err-hoist-lex-fun.js (default) -language/module-code/parse-err-hoist-lex-fun.js (strict mode) -language/module-code/parse-err-hoist-lex-gen.js (default) -language/module-code/parse-err-hoist-lex-gen.js (strict mode) language/statements/async-function/early-errors-declaration-body-contains-super-call.js (default) language/statements/async-function/early-errors-declaration-body-contains-super-call.js (strict mode) language/statements/async-function/early-errors-declaration-body-contains-super-property.js (default) @@ -316,7 +312,6 @@ language/statements/if/labelled-fn-stmt-lone.js (default) language/statements/if/labelled-fn-stmt-second.js (default) language/statements/if/let-block-with-newline.js (default) language/statements/if/let-identifier-with-newline.js (default) -language/statements/labeled/decl-async-function.js (default) language/statements/labeled/let-block-with-newline.js (default) language/statements/labeled/let-identifier-with-newline.js (default) language/statements/let/syntax/identifier-let-disallowed-as-boundname.js (default) diff --git a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.es.js b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.es.js index 803febe09f86c8..46b8c61947df5d 100644 --- a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.es.js +++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.es.js @@ -869,7 +869,7 @@ pp$1.parseDoStatement = function(node) { pp$1.parseForStatement = function(node) { this.next(); - var awaitAt = (this.options.ecmaVersion >= 9 && this.inAsync && this.eatContextual("await")) ? this.lastTokStart : -1; + var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; this.labels.push(loopLabel); this.enterLexicalScope(); this.expect(types.parenL); @@ -1075,7 +1075,7 @@ pp$1.parseLabeledStatement = function(node, maybeName, expr) { node.body = this.parseStatement(true); if (node.body.type === "ClassDeclaration" || node.body.type === "VariableDeclaration" && node.body.kind !== "var" || - node.body.type === "FunctionDeclaration" && (this.strict || node.body.generator)) + node.body.type === "FunctionDeclaration" && (this.strict || node.body.generator || node.body.async)) { this.raiseRecoverable(node.body.start, "Invalid labeled declaration"); } this.labels.pop(); node.label = expr; @@ -1193,7 +1193,7 @@ pp$1.parseFunction = function(node, isStatement, allowExpressionBody, isAsync) { if (isStatement) { node.id = isStatement === "nullableID" && this.type !== types.name ? null : this.parseIdent(); if (node.id) { - this.checkLVal(node.id, "var"); + this.checkLVal(node.id, this.inModule && !this.inFunction ? "let" : "var"); } } @@ -5268,7 +5268,7 @@ pp$8.readWord = function() { // [dammit]: acorn_loose.js // [walk]: util/walk.js -var version = "5.7.1"; +var version = "5.7.2"; // The main exported interface (under `self.acorn` when in the // browser) is a `parse` function that takes a code string and diff --git a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js index 5ede36dd84242e..bab34a2e8d4a10 100644 --- a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js +++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js @@ -875,7 +875,7 @@ pp$1.parseDoStatement = function(node) { pp$1.parseForStatement = function(node) { this.next(); - var awaitAt = (this.options.ecmaVersion >= 9 && this.inAsync && this.eatContextual("await")) ? this.lastTokStart : -1; + var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; this.labels.push(loopLabel); this.enterLexicalScope(); this.expect(types.parenL); @@ -1081,7 +1081,7 @@ pp$1.parseLabeledStatement = function(node, maybeName, expr) { node.body = this.parseStatement(true); if (node.body.type === "ClassDeclaration" || node.body.type === "VariableDeclaration" && node.body.kind !== "var" || - node.body.type === "FunctionDeclaration" && (this.strict || node.body.generator)) + node.body.type === "FunctionDeclaration" && (this.strict || node.body.generator || node.body.async)) { this.raiseRecoverable(node.body.start, "Invalid labeled declaration"); } this.labels.pop(); node.label = expr; @@ -1199,7 +1199,7 @@ pp$1.parseFunction = function(node, isStatement, allowExpressionBody, isAsync) { if (isStatement) { node.id = isStatement === "nullableID" && this.type !== types.name ? null : this.parseIdent(); if (node.id) { - this.checkLVal(node.id, "var"); + this.checkLVal(node.id, this.inModule && !this.inFunction ? "let" : "var"); } } @@ -5274,7 +5274,7 @@ pp$8.readWord = function() { // [dammit]: acorn_loose.js // [walk]: util/walk.js -var version = "5.7.1"; +var version = "5.7.2"; // The main exported interface (under `self.acorn` when in the // browser) is a `parse` function that takes a code string and diff --git a/tools/node_modules/eslint/node_modules/acorn/package.json b/tools/node_modules/eslint/node_modules/acorn/package.json index 285e963c40756b..d3e07d86c6e8ce 100644 --- a/tools/node_modules/eslint/node_modules/acorn/package.json +++ b/tools/node_modules/eslint/node_modules/acorn/package.json @@ -267,6 +267,10 @@ "name": "Ingvar Stepanyan", "email": "me@rreverser.com", "url": "http://rreverser.com/" + }, + { + "name": "Adrian Heine", + "email": "http://adrianheine.de" } ], "module": "dist/acorn.es.js", @@ -287,5 +291,5 @@ "test": "node test/run.js && node test/lint.js", "test:test262": "node bin/run_test262.js" }, - "version": "5.7.1" + "version": "5.7.2" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/index.js b/tools/node_modules/eslint/node_modules/ansi-regex/index.js index b9574ed7e82013..c4aaecf5050639 100644 --- a/tools/node_modules/eslint/node_modules/ansi-regex/index.js +++ b/tools/node_modules/eslint/node_modules/ansi-regex/index.js @@ -1,4 +1,10 @@ 'use strict'; -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; + +module.exports = () => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, 'g'); }; diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/license b/tools/node_modules/eslint/node_modules/ansi-regex/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/tools/node_modules/eslint/node_modules/ansi-regex/license +++ b/tools/node_modules/eslint/node_modules/ansi-regex/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (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. diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/package.json b/tools/node_modules/eslint/node_modules/ansi-regex/package.json index c584a40cb264d1..d4df7d97af4f3f 100644 --- a/tools/node_modules/eslint/node_modules/ansi-regex/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-regex/package.json @@ -11,11 +11,11 @@ "deprecated": false, "description": "Regular expression for matching ANSI escape codes", "devDependencies": { - "ava": "0.17.0", - "xo": "0.16.0" + "ava": "*", + "xo": "*" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" }, "files": [ "index.js" @@ -49,37 +49,14 @@ "pattern" ], "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - }, - { - "name": "JD Ballard", - "email": "i.am.qix@gmail.com", - "url": "github.com/qix-" - } - ], "name": "ansi-regex", "repository": { "type": "git", "url": "git+https://github.com/chalk/ansi-regex.git" }, "scripts": { - "test": "xo && ava --verbose", + "test": "xo && ava", "view-supported": "node fixtures/view-codes.js" }, - "version": "2.1.1", - "xo": { - "rules": { - "guard-for-in": 0, - "no-loop-func": 0 - } - } + "version": "3.0.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/readme.md b/tools/node_modules/eslint/node_modules/ansi-regex/readme.md index 6a928edf0f6b08..22db1c34055556 100644 --- a/tools/node_modules/eslint/node_modules/ansi-regex/readme.md +++ b/tools/node_modules/eslint/node_modules/ansi-regex/readme.md @@ -1,12 +1,12 @@ # ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) -> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) ## Install ``` -$ npm install --save ansi-regex +$ npm install ansi-regex ``` @@ -15,25 +15,32 @@ $ npm install --save ansi-regex ```js const ansiRegex = require('ansi-regex'); -ansiRegex().test('\u001b[4mcake\u001b[0m'); +ansiRegex().test('\u001B[4mcake\u001B[0m'); //=> true ansiRegex().test('cake'); //=> false -'\u001b[4mcake\u001b[0m'.match(ansiRegex()); -//=> ['\u001b[4m', '\u001b[0m'] +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] ``` + ## FAQ ### Why do you test for codes not in the ECMA 48 standard? -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/ansi-styles/index.js index 78945278f78a72..90a871c4d78f6f 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/index.js +++ b/tools/node_modules/eslint/node_modules/ansi-styles/index.js @@ -1,10 +1,28 @@ 'use strict'; +const colorConvert = require('color-convert'); -function assembleStyles () { - var styles = { - modifiers: { +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { reset: [0, 0], - bold: [1, 22], // 21 isn't widely supported and 22 does the same thing + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], @@ -12,7 +30,7 @@ function assembleStyles () { hidden: [8, 28], strikethrough: [9, 29] }, - colors: { + color: { black: [30, 39], red: [31, 39], green: [32, 39], @@ -21,9 +39,18 @@ function assembleStyles () { magenta: [35, 39], cyan: [36, 39], white: [37, 39], - gray: [90, 39] + gray: [90, 39], + + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] }, - bgColors: { + bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], @@ -31,34 +58,107 @@ function assembleStyles () { bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], - bgWhite: [47, 49] + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] } }; - // fix humans - styles.colors.grey = styles.colors.gray; + // Fix humans + styles.color.grey = styles.color.gray; - Object.keys(styles).forEach(function (groupName) { - var group = styles[groupName]; + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; - Object.keys(group).forEach(function (styleName) { - var style = group[styleName]; + for (const styleName of Object.keys(group)) { + const style = group[styleName]; - styles[styleName] = group[styleName] = { - open: '\u001b[' + style[0] + 'm', - close: '\u001b[' + style[1] + 'm' + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` }; - }); + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } Object.defineProperty(styles, groupName, { value: group, enumerable: false }); - }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } return styles; } +// Make the export immutable Object.defineProperty(module, 'exports', { enumerable: true, get: assembleStyles diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/license b/tools/node_modules/eslint/node_modules/ansi-styles/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/license +++ b/tools/node_modules/eslint/node_modules/ansi-styles/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (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. diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/ansi-styles/package.json index 5d545b2cd6ed7e..5663ace24b4607 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/package.json +++ b/tools/node_modules/eslint/node_modules/ansi-styles/package.json @@ -4,17 +4,26 @@ "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, + "ava": { + "require": "babel-polyfill" + }, "bugs": { "url": "https://github.com/chalk/ansi-styles/issues" }, "bundleDependencies": false, + "dependencies": { + "color-convert": "^1.9.0" + }, "deprecated": false, "description": "ANSI escape codes for styling strings in the terminal", "devDependencies": { - "mocha": "*" + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" }, "files": [ "index.js" @@ -43,25 +52,14 @@ "text" ], "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - } - ], "name": "ansi-styles", "repository": { "type": "git", "url": "git+https://github.com/chalk/ansi-styles.git" }, "scripts": { - "test": "mocha" + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", + "test": "xo && ava" }, - "version": "2.2.1" + "version": "3.2.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/ansi-styles/readme.md b/tools/node_modules/eslint/node_modules/ansi-styles/readme.md index 3f933f6162e58e..3158e2df59ce66 100644 --- a/tools/node_modules/eslint/node_modules/ansi-styles/readme.md +++ b/tools/node_modules/eslint/node_modules/ansi-styles/readme.md @@ -4,24 +4,33 @@ You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. -![](screenshot.png) + ## Install ``` -$ npm install --save ansi-styles +$ npm install ansi-styles ``` ## Usage ```js -var ansi = require('ansi-styles'); +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); -console.log(ansi.green.open + 'Hello world!' + ansi.green.close); -``` +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); +``` ## API @@ -35,11 +44,11 @@ Each style has an `open` and `close` property. - `reset` - `bold` - `dim` -- `italic` *(not widely supported)* +- `italic` *(Not widely supported)* - `underline` - `inverse` - `hidden` -- `strikethrough` *(not widely supported)* +- `strikethrough` *(Not widely supported)* ### Colors @@ -51,7 +60,14 @@ Each style has an `open` and `close` property. - `magenta` - `cyan` - `white` -- `gray` +- `gray` ("bright black") +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` ### Background colors @@ -63,24 +79,69 @@ Each style has an `open` and `close` property. - `bgMagenta` - `bgCyan` - `bgWhite` +- `bgBlackBright` +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` ## Advanced usage -By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example -- `ansi.modifiers` -- `ansi.colors` -- `ansi.bgColors` +```js +console.log(style.color.green.open); +``` +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. ###### Example ```js -console.log(ansi.colors.green.open); +console.log(style.codes.get(36)); +//=> 39 ``` +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT diff --git a/tools/node_modules/eslint/node_modules/babel-code-frame/README.md b/tools/node_modules/eslint/node_modules/babel-code-frame/README.md deleted file mode 100644 index 7ef5368d314945..00000000000000 --- a/tools/node_modules/eslint/node_modules/babel-code-frame/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# babel-code-frame - -> Generate errors that contain a code frame that point to source locations. - -## Install - -```sh -npm install --save-dev babel-code-frame -``` - -## Usage - -```js -import codeFrame from 'babel-code-frame'; - -const rawLines = `class Foo { - constructor() -}`; -const lineNumber = 2; -const colNumber = 16; - -const result = codeFrame(rawLines, lineNumber, colNumber, { /* options */ }); - -console.log(result); -``` - -```sh - 1 | class Foo { -> 2 | constructor() - | ^ - 3 | } -``` - -If the column number is not known, you may pass `null` instead. - -## Options - -### `highlightCode` - -`boolean`, defaults to `false`. - -Toggles syntax highlighting the code as JavaScript for terminals. - -### `linesAbove` - -`number`, defaults to `2`. - -Adjust the number of lines to show above the error. - -### `linesBelow` - -`number`, defaults to `3`. - -Adjust the number of lines to show below the error. - -### `forceColor` - -`boolean`, defaults to `false`. - -Enable this to forcibly syntax highlight the code as JavaScript (for non-terminals); overrides `highlightCode`. diff --git a/tools/node_modules/eslint/node_modules/babel-code-frame/lib/index.js b/tools/node_modules/eslint/node_modules/babel-code-frame/lib/index.js deleted file mode 100644 index ff49b9082ccb43..00000000000000 --- a/tools/node_modules/eslint/node_modules/babel-code-frame/lib/index.js +++ /dev/null @@ -1,141 +0,0 @@ -"use strict"; - -exports.__esModule = true; - -exports.default = function (rawLines, lineNumber, colNumber) { - var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - colNumber = Math.max(colNumber, 0); - - var highlighted = opts.highlightCode && _chalk2.default.supportsColor || opts.forceColor; - var chalk = _chalk2.default; - if (opts.forceColor) { - chalk = new _chalk2.default.constructor({ enabled: true }); - } - var maybeHighlight = function maybeHighlight(chalkFn, string) { - return highlighted ? chalkFn(string) : string; - }; - var defs = getDefs(chalk); - if (highlighted) rawLines = highlight(defs, rawLines); - - var linesAbove = opts.linesAbove || 2; - var linesBelow = opts.linesBelow || 3; - - var lines = rawLines.split(NEWLINE); - var start = Math.max(lineNumber - (linesAbove + 1), 0); - var end = Math.min(lines.length, lineNumber + linesBelow); - - if (!lineNumber && !colNumber) { - start = 0; - end = lines.length; - } - - var numberMaxWidth = String(end).length; - - var frame = lines.slice(start, end).map(function (line, index) { - var number = start + 1 + index; - var paddedNumber = (" " + number).slice(-numberMaxWidth); - var gutter = " " + paddedNumber + " | "; - if (number === lineNumber) { - var markerLine = ""; - if (colNumber) { - var markerSpacing = line.slice(0, colNumber - 1).replace(/[^\t]/g, " "); - markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^")].join(""); - } - return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); - } else { - return " " + maybeHighlight(defs.gutter, gutter) + line; - } - }).join("\n"); - - if (highlighted) { - return chalk.reset(frame); - } else { - return frame; - } -}; - -var _jsTokens = require("js-tokens"); - -var _jsTokens2 = _interopRequireDefault(_jsTokens); - -var _esutils = require("esutils"); - -var _esutils2 = _interopRequireDefault(_esutils); - -var _chalk = require("chalk"); - -var _chalk2 = _interopRequireDefault(_chalk); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getDefs(chalk) { - return { - keyword: chalk.cyan, - capitalized: chalk.yellow, - jsx_tag: chalk.yellow, - punctuator: chalk.yellow, - - number: chalk.magenta, - string: chalk.green, - regex: chalk.magenta, - comment: chalk.grey, - invalid: chalk.white.bgRed.bold, - gutter: chalk.grey, - marker: chalk.red.bold - }; -} - -var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; - -var JSX_TAG = /^[a-z][\w-]*$/i; - -var BRACKET = /^[()\[\]{}]$/; - -function getTokenType(match) { - var _match$slice = match.slice(-2), - offset = _match$slice[0], - text = _match$slice[1]; - - var token = (0, _jsTokens.matchToToken)(match); - - if (token.type === "name") { - if (_esutils2.default.keyword.isReservedWordES6(token.value)) { - return "keyword"; - } - - if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " 1) { - // don't slice `arguments`, it prevents v8 optimizations - for (var a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || !str) { - return str; - } - - var nestedStyles = this._styles; - var i = nestedStyles.length; - - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - var originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { - ansiStyles.dim.open = ''; - } - - while (i--) { - var code = ansiStyles[nestedStyles[i]]; - - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; - } - - // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. - ansiStyles.dim.open = originalDim; - - return str; -} - -function init() { - var ret = {}; - - Object.keys(styles).forEach(function (name) { - ret[name] = { - get: function () { - return build.call(this, [name]); - } - }; - }); - - return ret; -} - -defineProps(Chalk.prototype, init()); - -module.exports = new Chalk(); -module.exports.styles = ansiStyles; -module.exports.hasColor = hasAnsi; -module.exports.stripColor = stripAnsi; -module.exports.supportsColor = supportsColor; diff --git a/tools/node_modules/eslint/node_modules/babel-code-frame/node_modules/chalk/license b/tools/node_modules/eslint/node_modules/babel-code-frame/node_modules/chalk/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/tools/node_modules/eslint/node_modules/babel-code-frame/node_modules/chalk/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/tools/node_modules/eslint/node_modules/babel-code-frame/node_modules/chalk/package.json b/tools/node_modules/eslint/node_modules/babel-code-frame/node_modules/chalk/package.json deleted file mode 100644 index f152f2a7546385..00000000000000 --- a/tools/node_modules/eslint/node_modules/babel-code-frame/node_modules/chalk/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "bugs": { - "url": "https://github.com/chalk/chalk/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "deprecated": false, - "description": "Terminal string styling done right. Much color.", - "devDependencies": { - "coveralls": "^2.11.2", - "matcha": "^0.6.0", - "mocha": "*", - "nyc": "^3.0.0", - "require-uncached": "^1.0.2", - "resolve-from": "^1.0.0", - "semver": "^4.3.3", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/chalk#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - }, - { - "name": "JD Ballard", - "email": "i.am.qix@gmail.com", - "url": "github.com/qix-" - } - ], - "name": "chalk", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/chalk.git" - }, - "scripts": { - "bench": "matcha benchmark.js", - "coverage": "nyc npm test && nyc report", - "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls", - "test": "xo && mocha" - }, - "version": "1.1.3", - "xo": { - "envs": [ - "node", - "mocha" - ] - } -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/babel-code-frame/node_modules/chalk/readme.md b/tools/node_modules/eslint/node_modules/babel-code-frame/node_modules/chalk/readme.md deleted file mode 100644 index 5cf111e353383d..00000000000000 --- a/tools/node_modules/eslint/node_modules/babel-code-frame/node_modules/chalk/readme.md +++ /dev/null @@ -1,213 +0,0 @@ -

-
-
- chalk -
-
-
-

- -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) -[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) -[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) - - -[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. - -**Chalk is a clean and focused alternative.** - -![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) - - -## Why - -- Highly performant -- Doesn't extend `String.prototype` -- Expressive API -- Ability to nest styles -- Clean and focused -- Auto-detects color support -- Actively maintained -- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 - - -## Install - -``` -$ npm install --save chalk -``` - - -## Usage - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -var chalk = require('chalk'); - -// style a string -chalk.blue('Hello world!'); - -// combine styled and normal strings -chalk.blue('Hello') + 'World' + chalk.red('!'); - -// compose multiple styles using the chainable API -chalk.blue.bgRed.bold('Hello world!'); - -// pass in multiple arguments -chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); - -// nest styles -chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); - -// nest styles of the same type even (color, underline, background) -chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -); -``` - -Easily define your own themes. - -```js -var chalk = require('chalk'); -var error = chalk.bold.red; -console.log(error('Error!')); -``` - -Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). - -```js -var name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> Hello Sindre -``` - - -## API - -### chalk.`