tools: update ESLint to 4.15.0
PR-URL: https://github.com/nodejs/node/pull/17820 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
parent
3dc3063275
commit
7a52c51e81
6
tools/node_modules/eslint/README.md
generated
vendored
6
tools/node_modules/eslint/README.md
generated
vendored
@ -156,7 +156,7 @@ Before filing an issue, please be sure to read the guidelines for what you're re
|
|||||||
|
|
||||||
## Semantic Versioning Policy
|
## Semantic Versioning Policy
|
||||||
|
|
||||||
ESLint follows [semantic versioning](http://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint:
|
ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint:
|
||||||
|
|
||||||
* Patch release (intended to not break your lint build)
|
* Patch release (intended to not break your lint build)
|
||||||
* A bug fix in a rule that results in ESLint reporting fewer errors.
|
* A bug fix in a rule that results in ESLint reporting fewer errors.
|
||||||
@ -188,7 +188,7 @@ According to our policy, any minor update may report more errors than the previo
|
|||||||
|
|
||||||
### How is ESLint different from JSHint?
|
### How is ESLint different from JSHint?
|
||||||
|
|
||||||
The most significant difference is that ESlint has pluggable linting rules. That means you can use the rules it comes with, or you can extend it with rules created by others or by yourself!
|
The most significant difference is that ESLint has pluggable linting rules. That means you can use the rules it comes with, or you can extend it with rules created by others or by yourself!
|
||||||
|
|
||||||
### How does ESLint performance compare to JSHint?
|
### How does ESLint performance compare to JSHint?
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ Once a language feature has been adopted into the ECMAScript standard (stage 4 a
|
|||||||
|
|
||||||
### Where to ask for help?
|
### Where to ask for help?
|
||||||
|
|
||||||
Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://gitter.im/eslint/eslint)
|
Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://gitter.im/eslint/eslint).
|
||||||
|
|
||||||
|
|
||||||
[npm-image]: https://img.shields.io/npm/v/eslint.svg?style=flat-square
|
[npm-image]: https://img.shields.io/npm/v/eslint.svg?style=flat-square
|
||||||
|
4
tools/node_modules/eslint/lib/cli-engine.js
generated
vendored
4
tools/node_modules/eslint/lib/cli-engine.js
generated
vendored
@ -420,6 +420,10 @@ class CLIEngine {
|
|||||||
this.config = new Config(this.options, this.linter);
|
this.config = new Config(this.options, this.linter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getRules() {
|
||||||
|
return this.linter.getRules();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns results that only contains errors.
|
* Returns results that only contains errors.
|
||||||
* @param {LintResult[]} results The results to filter.
|
* @param {LintResult[]} results The results to filter.
|
||||||
|
2
tools/node_modules/eslint/lib/formatters/checkstyle.js
generated
vendored
2
tools/node_modules/eslint/lib/formatters/checkstyle.js
generated
vendored
@ -32,7 +32,7 @@ module.exports = function(results) {
|
|||||||
|
|
||||||
let output = "";
|
let output = "";
|
||||||
|
|
||||||
output += "<?xml version=\"1.1\" encoding=\"utf-8\"?>";
|
output += "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
|
||||||
output += "<checkstyle version=\"4.3\">";
|
output += "<checkstyle version=\"4.3\">";
|
||||||
|
|
||||||
results.forEach(result => {
|
results.forEach(result => {
|
||||||
|
2
tools/node_modules/eslint/lib/formatters/jslint-xml.js
generated
vendored
2
tools/node_modules/eslint/lib/formatters/jslint-xml.js
generated
vendored
@ -14,7 +14,7 @@ module.exports = function(results) {
|
|||||||
|
|
||||||
let output = "";
|
let output = "";
|
||||||
|
|
||||||
output += "<?xml version=\"1.1\" encoding=\"utf-8\"?>";
|
output += "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
|
||||||
output += "<jslint>";
|
output += "<jslint>";
|
||||||
|
|
||||||
results.forEach(result => {
|
results.forEach(result => {
|
||||||
|
2
tools/node_modules/eslint/lib/formatters/junit.js
generated
vendored
2
tools/node_modules/eslint/lib/formatters/junit.js
generated
vendored
@ -32,7 +32,7 @@ module.exports = function(results) {
|
|||||||
|
|
||||||
let output = "";
|
let output = "";
|
||||||
|
|
||||||
output += "<?xml version=\"1.1\" encoding=\"utf-8\"?>\n";
|
output += "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
|
||||||
output += "<testsuites>\n";
|
output += "<testsuites>\n";
|
||||||
|
|
||||||
results.forEach(result => {
|
results.forEach(result => {
|
||||||
|
113
tools/node_modules/eslint/lib/linter.js
generated
vendored
113
tools/node_modules/eslint/lib/linter.js
generated
vendored
@ -10,6 +10,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
const eslintScope = require("eslint-scope"),
|
const eslintScope = require("eslint-scope"),
|
||||||
|
evk = require("eslint-visitor-keys"),
|
||||||
levn = require("levn"),
|
levn = require("levn"),
|
||||||
lodash = require("lodash"),
|
lodash = require("lodash"),
|
||||||
blankScriptAST = require("../conf/blank-script.json"),
|
blankScriptAST = require("../conf/blank-script.json"),
|
||||||
@ -43,6 +44,8 @@ const MAX_AUTOFIX_PASSES = 10;
|
|||||||
* @property {ASTNode} ast The ESTree AST Program node.
|
* @property {ASTNode} ast The ESTree AST Program node.
|
||||||
* @property {Object} services An object containing additional services related
|
* @property {Object} services An object containing additional services related
|
||||||
* to the parser.
|
* to the parser.
|
||||||
|
* @property {ScopeManager|null} scopeManager The scope manager object of this AST.
|
||||||
|
* @property {Object|null} visitorKeys The visitor keys to traverse this AST.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -501,6 +504,28 @@ function getRuleOptions(ruleConfig) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Analyze scope of the given AST.
|
||||||
|
* @param {ASTNode} ast The `Program` node to analyze.
|
||||||
|
* @param {Object} parserOptions The parser options.
|
||||||
|
* @param {Object} visitorKeys The visitor keys.
|
||||||
|
* @returns {ScopeManager} The analysis result.
|
||||||
|
*/
|
||||||
|
function analyzeScope(ast, parserOptions, visitorKeys) {
|
||||||
|
const ecmaFeatures = parserOptions.ecmaFeatures || {};
|
||||||
|
const ecmaVersion = parserOptions.ecmaVersion || 5;
|
||||||
|
|
||||||
|
return eslintScope.analyze(ast, {
|
||||||
|
ignoreEval: true,
|
||||||
|
nodejsScope: ecmaFeatures.globalReturn,
|
||||||
|
impliedStrict: ecmaFeatures.impliedStrict,
|
||||||
|
ecmaVersion,
|
||||||
|
sourceType: parserOptions.sourceType || "script",
|
||||||
|
childVisitorKeys: visitorKeys || evk.KEYS,
|
||||||
|
fallback: Traverser.getKeys
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses text into an AST. Moved out here because the try-catch prevents
|
* Parses text into an AST. Moved out here because the try-catch prevents
|
||||||
* optimization of functions, so it's best to keep the try-catch as isolated
|
* optimization of functions, so it's best to keep the try-catch as isolated
|
||||||
@ -509,18 +534,20 @@ function getRuleOptions(ruleConfig) {
|
|||||||
* @param {Object} providedParserOptions Options to pass to the parser
|
* @param {Object} providedParserOptions Options to pass to the parser
|
||||||
* @param {Object} parser The parser module
|
* @param {Object} parser The parser module
|
||||||
* @param {string} filePath The path to the file being parsed.
|
* @param {string} filePath The path to the file being parsed.
|
||||||
* @returns {{success: false, error: Problem}|{success: true,ast: ASTNode, services: Object}}
|
* @returns {{success: false, error: Problem}|{success: true, sourceCode: SourceCode}}
|
||||||
* An object containing the AST and parser services if parsing was successful, or the error if parsing failed
|
* An object containing the AST and parser services if parsing was successful, or the error if parsing failed
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function parse(text, providedParserOptions, parser, filePath) {
|
function parse(text, providedParserOptions, parser, filePath) {
|
||||||
|
const textToParse = stripUnicodeBOM(text).replace(astUtils.SHEBANG_MATCHER, (match, captured) => `//${captured}`);
|
||||||
const parserOptions = Object.assign({}, providedParserOptions, {
|
const parserOptions = Object.assign({}, providedParserOptions, {
|
||||||
loc: true,
|
loc: true,
|
||||||
range: true,
|
range: true,
|
||||||
raw: true,
|
raw: true,
|
||||||
tokens: true,
|
tokens: true,
|
||||||
comment: true,
|
comment: true,
|
||||||
|
eslintVisitorKeys: true,
|
||||||
|
eslintScopeManager: true,
|
||||||
filePath
|
filePath
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -531,20 +558,30 @@ function parse(text, providedParserOptions, parser, filePath) {
|
|||||||
* problem that ESLint identified just like any other.
|
* problem that ESLint identified just like any other.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
if (typeof parser.parseForESLint === "function") {
|
const parseResult = (typeof parser.parseForESLint === "function")
|
||||||
const parseResult = parser.parseForESLint(text, parserOptions);
|
? parser.parseForESLint(textToParse, parserOptions)
|
||||||
|
: { ast: parser.parse(textToParse, parserOptions) };
|
||||||
return {
|
const ast = parseResult.ast;
|
||||||
success: true,
|
const parserServices = parseResult.services || {};
|
||||||
ast: parseResult.ast,
|
const visitorKeys = parseResult.visitorKeys || evk.KEYS;
|
||||||
services: parseResult.services || {}
|
const scopeManager = parseResult.scopeManager || analyzeScope(ast, parserOptions, visitorKeys);
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
ast: parser.parse(text, parserOptions),
|
|
||||||
services: {}
|
/*
|
||||||
|
* Save all values that `parseForESLint()` returned.
|
||||||
|
* If a `SourceCode` object is given as the first parameter instead of source code text,
|
||||||
|
* linter skips the parsing process and reuses the source code object.
|
||||||
|
* In that case, linter needs all the values that `parseForESLint()` returned.
|
||||||
|
*/
|
||||||
|
sourceCode: new SourceCode({
|
||||||
|
text,
|
||||||
|
ast,
|
||||||
|
parserServices,
|
||||||
|
scopeManager,
|
||||||
|
visitorKeys
|
||||||
|
})
|
||||||
};
|
};
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|
||||||
@ -717,7 +754,6 @@ module.exports = class Linter {
|
|||||||
*/
|
*/
|
||||||
_verifyWithoutProcessors(textOrSourceCode, config, filenameOrOptions) {
|
_verifyWithoutProcessors(textOrSourceCode, config, filenameOrOptions) {
|
||||||
let text,
|
let text,
|
||||||
parserServices,
|
|
||||||
allowInlineConfig,
|
allowInlineConfig,
|
||||||
providedFilename,
|
providedFilename,
|
||||||
reportUnusedDisableDirectives;
|
reportUnusedDisableDirectives;
|
||||||
@ -731,8 +767,6 @@ module.exports = class Linter {
|
|||||||
providedFilename = filenameOrOptions;
|
providedFilename = filenameOrOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
const filename = typeof providedFilename === "string" ? providedFilename : "<input>";
|
|
||||||
|
|
||||||
if (typeof textOrSourceCode === "string") {
|
if (typeof textOrSourceCode === "string") {
|
||||||
lastSourceCodes.set(this, null);
|
lastSourceCodes.set(this, null);
|
||||||
text = textOrSourceCode;
|
text = textOrSourceCode;
|
||||||
@ -741,6 +775,8 @@ module.exports = class Linter {
|
|||||||
text = textOrSourceCode.text;
|
text = textOrSourceCode.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const filename = typeof providedFilename === "string" ? providedFilename : "<input>";
|
||||||
|
|
||||||
// search and apply "eslint-env *".
|
// search and apply "eslint-env *".
|
||||||
const envInFile = findEslintEnv(text);
|
const envInFile = findEslintEnv(text);
|
||||||
|
|
||||||
@ -757,9 +793,7 @@ module.exports = class Linter {
|
|||||||
// process initial config to make it safe to extend
|
// process initial config to make it safe to extend
|
||||||
config = prepareConfig(config, this.environments);
|
config = prepareConfig(config, this.environments);
|
||||||
|
|
||||||
if (lastSourceCodes.get(this)) {
|
if (!lastSourceCodes.get(this)) {
|
||||||
parserServices = {};
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// there's no input, just exit here
|
// there's no input, just exit here
|
||||||
if (text.trim().length === 0) {
|
if (text.trim().length === 0) {
|
||||||
@ -783,7 +817,7 @@ module.exports = class Linter {
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
const parseResult = parse(
|
const parseResult = parse(
|
||||||
stripUnicodeBOM(text).replace(astUtils.SHEBANG_MATCHER, (match, captured) => `//${captured}`),
|
text,
|
||||||
config.parserOptions,
|
config.parserOptions,
|
||||||
parser,
|
parser,
|
||||||
filename
|
filename
|
||||||
@ -793,8 +827,24 @@ module.exports = class Linter {
|
|||||||
return [parseResult.error];
|
return [parseResult.error];
|
||||||
}
|
}
|
||||||
|
|
||||||
parserServices = parseResult.services;
|
lastSourceCodes.set(this, parseResult.sourceCode);
|
||||||
lastSourceCodes.set(this, new SourceCode(text, parseResult.ast));
|
} else {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the given source code object as the first argument does not have scopeManager, analyze the scope.
|
||||||
|
* This is for backward compatibility (SourceCode is frozen so it cannot rebind).
|
||||||
|
*/
|
||||||
|
const lastSourceCode = lastSourceCodes.get(this);
|
||||||
|
|
||||||
|
if (!lastSourceCode.scopeManager) {
|
||||||
|
lastSourceCodes.set(this, new SourceCode({
|
||||||
|
text: lastSourceCode.text,
|
||||||
|
ast: lastSourceCode.ast,
|
||||||
|
parserServices: lastSourceCode.parserServices,
|
||||||
|
visitorKeys: lastSourceCode.visitorKeys,
|
||||||
|
scopeManager: analyzeScope(lastSourceCode.ast, config.parserOptions)
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const problems = [];
|
const problems = [];
|
||||||
@ -814,16 +864,7 @@ module.exports = class Linter {
|
|||||||
|
|
||||||
const emitter = createEmitter();
|
const emitter = createEmitter();
|
||||||
const traverser = new Traverser();
|
const traverser = new Traverser();
|
||||||
const ecmaFeatures = config.parserOptions.ecmaFeatures || {};
|
const scopeManager = sourceCode.scopeManager;
|
||||||
const ecmaVersion = config.parserOptions.ecmaVersion || 5;
|
|
||||||
const scopeManager = eslintScope.analyze(sourceCode.ast, {
|
|
||||||
ignoreEval: true,
|
|
||||||
nodejsScope: ecmaFeatures.globalReturn,
|
|
||||||
impliedStrict: ecmaFeatures.impliedStrict,
|
|
||||||
ecmaVersion,
|
|
||||||
sourceType: config.parserOptions.sourceType || "script",
|
|
||||||
fallback: Traverser.getKeys
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a frozen object with the ruleContext properties and methods that are shared by all rules.
|
* Create a frozen object with the ruleContext properties and methods that are shared by all rules.
|
||||||
@ -842,7 +883,7 @@ module.exports = class Linter {
|
|||||||
markVariableAsUsed: name => markVariableAsUsed(scopeManager, traverser.current(), config.parserOptions, name),
|
markVariableAsUsed: name => markVariableAsUsed(scopeManager, traverser.current(), config.parserOptions, name),
|
||||||
parserOptions: config.parserOptions,
|
parserOptions: config.parserOptions,
|
||||||
parserPath: config.parser,
|
parserPath: config.parser,
|
||||||
parserServices,
|
parserServices: sourceCode.parserServices,
|
||||||
settings: config.settings,
|
settings: config.settings,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -870,6 +911,7 @@ module.exports = class Linter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const rule = this.rules.get(ruleId);
|
const rule = this.rules.get(ruleId);
|
||||||
|
const messageIds = rule && rule.meta && rule.meta.messages;
|
||||||
let reportTranslator = null;
|
let reportTranslator = null;
|
||||||
const ruleContext = Object.freeze(
|
const ruleContext = Object.freeze(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
@ -890,7 +932,7 @@ module.exports = class Linter {
|
|||||||
* with Node 8.4.0.
|
* with Node 8.4.0.
|
||||||
*/
|
*/
|
||||||
if (reportTranslator === null) {
|
if (reportTranslator === null) {
|
||||||
reportTranslator = createReportTranslator({ ruleId, severity, sourceCode });
|
reportTranslator = createReportTranslator({ ruleId, severity, sourceCode, messageIds });
|
||||||
}
|
}
|
||||||
const problem = reportTranslator.apply(null, arguments);
|
const problem = reportTranslator.apply(null, arguments);
|
||||||
|
|
||||||
@ -957,7 +999,8 @@ module.exports = class Linter {
|
|||||||
},
|
},
|
||||||
leave(node) {
|
leave(node) {
|
||||||
eventGenerator.leaveNode(node);
|
eventGenerator.leaveNode(node);
|
||||||
}
|
},
|
||||||
|
visitorKeys: sourceCode.visitorKeys
|
||||||
});
|
});
|
||||||
|
|
||||||
return applyDisableDirectives({
|
return applyDisableDirectives({
|
||||||
|
94
tools/node_modules/eslint/lib/options.js
generated
vendored
94
tools/node_modules/eslint/lib/options.js
generated
vendored
@ -64,26 +64,6 @@ module.exports = optionator({
|
|||||||
type: "Object",
|
type: "Object",
|
||||||
description: "Specify parser options"
|
description: "Specify parser options"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
heading: "Caching"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: "cache",
|
|
||||||
type: "Boolean",
|
|
||||||
default: "false",
|
|
||||||
description: "Only check changed files"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: "cache-file",
|
|
||||||
type: "path::String",
|
|
||||||
default: ".eslintcache",
|
|
||||||
description: "Path to the cache file. Deprecated: use --cache-location"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: "cache-location",
|
|
||||||
type: "path::String",
|
|
||||||
description: "Path to the cache file or directory"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
heading: "Specifying rules and plugins"
|
heading: "Specifying rules and plugins"
|
||||||
},
|
},
|
||||||
@ -102,6 +82,21 @@ module.exports = optionator({
|
|||||||
type: "Object",
|
type: "Object",
|
||||||
description: "Specify rules"
|
description: "Specify rules"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
heading: "Fixing problems"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "fix",
|
||||||
|
type: "Boolean",
|
||||||
|
default: false,
|
||||||
|
description: "Automatically fix problems"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "fix-dry-run",
|
||||||
|
type: "Boolean",
|
||||||
|
default: false,
|
||||||
|
description: "Automatically fix problems without saving the changes to the file system"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
heading: "Ignoring files"
|
heading: "Ignoring files"
|
||||||
},
|
},
|
||||||
@ -175,6 +170,41 @@ module.exports = optionator({
|
|||||||
alias: "no-color",
|
alias: "no-color",
|
||||||
description: "Force enabling/disabling of color"
|
description: "Force enabling/disabling of color"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
heading: "Inline configuration comments"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "inline-config",
|
||||||
|
type: "Boolean",
|
||||||
|
default: "true",
|
||||||
|
description: "Prevent comments from changing config or rules"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "report-unused-disable-directives",
|
||||||
|
type: "Boolean",
|
||||||
|
default: false,
|
||||||
|
description: "Adds reported errors for unused eslint-disable directives"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
heading: "Caching"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "cache",
|
||||||
|
type: "Boolean",
|
||||||
|
default: "false",
|
||||||
|
description: "Only check changed files"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "cache-file",
|
||||||
|
type: "path::String",
|
||||||
|
default: ".eslintcache",
|
||||||
|
description: "Path to the cache file. Deprecated: use --cache-location"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "cache-location",
|
||||||
|
type: "path::String",
|
||||||
|
description: "Path to the cache file or directory"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
heading: "Miscellaneous"
|
heading: "Miscellaneous"
|
||||||
},
|
},
|
||||||
@ -184,18 +214,6 @@ module.exports = optionator({
|
|||||||
default: "false",
|
default: "false",
|
||||||
description: "Run config initialization wizard"
|
description: "Run config initialization wizard"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
option: "fix",
|
|
||||||
type: "Boolean",
|
|
||||||
default: false,
|
|
||||||
description: "Automatically fix problems"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: "fix-dry-run",
|
|
||||||
type: "Boolean",
|
|
||||||
default: false,
|
|
||||||
description: "Automatically fix problems without saving the changes to the file system"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
option: "debug",
|
option: "debug",
|
||||||
type: "Boolean",
|
type: "Boolean",
|
||||||
@ -214,18 +232,6 @@ module.exports = optionator({
|
|||||||
type: "Boolean",
|
type: "Boolean",
|
||||||
description: "Output the version number"
|
description: "Output the version number"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
option: "inline-config",
|
|
||||||
type: "Boolean",
|
|
||||||
default: "true",
|
|
||||||
description: "Prevent comments from changing config or rules"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
option: "report-unused-disable-directives",
|
|
||||||
type: "Boolean",
|
|
||||||
default: false,
|
|
||||||
description: "Adds reported errors for unused eslint-disable directives"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
option: "print-config",
|
option: "print-config",
|
||||||
type: "path::String",
|
type: "path::String",
|
||||||
|
47
tools/node_modules/eslint/lib/report-translator.js
generated
vendored
47
tools/node_modules/eslint/lib/report-translator.js
generated
vendored
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
const assert = require("assert");
|
const assert = require("assert");
|
||||||
const ruleFixer = require("./util/rule-fixer");
|
const ruleFixer = require("./util/rule-fixer");
|
||||||
|
const interpolate = require("./util/interpolate");
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Typedefs
|
// Typedefs
|
||||||
@ -41,7 +42,9 @@ function normalizeMultiArgReportCall() {
|
|||||||
|
|
||||||
// If there is one argument, it is considered to be a new-style call already.
|
// If there is one argument, it is considered to be a new-style call already.
|
||||||
if (arguments.length === 1) {
|
if (arguments.length === 1) {
|
||||||
return arguments[0];
|
|
||||||
|
// Shallow clone the object to avoid surprises if reusing the descriptor
|
||||||
|
return Object.assign({}, arguments[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the second argument is a string, the arguments are interpreted as [node, message, data, fix].
|
// If the second argument is a string, the arguments are interpreted as [node, message, data, fix].
|
||||||
@ -100,16 +103,7 @@ function normalizeReportLoc(descriptor) {
|
|||||||
* @returns {string} The interpolated message for the descriptor
|
* @returns {string} The interpolated message for the descriptor
|
||||||
*/
|
*/
|
||||||
function normalizeMessagePlaceholders(descriptor) {
|
function normalizeMessagePlaceholders(descriptor) {
|
||||||
if (!descriptor.data) {
|
return interpolate(descriptor.message, descriptor.data);
|
||||||
return descriptor.message;
|
|
||||||
}
|
|
||||||
return descriptor.message.replace(/\{\{\s*([^{}]+?)\s*\}\}/g, (fullMatch, term) => {
|
|
||||||
if (term in descriptor.data) {
|
|
||||||
return descriptor.data[term];
|
|
||||||
}
|
|
||||||
|
|
||||||
return fullMatch;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -216,6 +210,14 @@ function createProblem(options) {
|
|||||||
source: options.sourceLines[options.loc.start.line - 1] || ""
|
source: options.sourceLines[options.loc.start.line - 1] || ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If this isn’t in the conditional, some of the tests fail
|
||||||
|
* because `messageId` is present in the problem object
|
||||||
|
*/
|
||||||
|
if (options.messageId) {
|
||||||
|
problem.messageId = options.messageId;
|
||||||
|
}
|
||||||
|
|
||||||
if (options.loc.end) {
|
if (options.loc.end) {
|
||||||
problem.endLine = options.loc.end.line;
|
problem.endLine = options.loc.end.line;
|
||||||
problem.endColumn = options.loc.end.column + 1;
|
problem.endColumn = options.loc.end.column + 1;
|
||||||
@ -231,12 +233,13 @@ function createProblem(options) {
|
|||||||
/**
|
/**
|
||||||
* Returns a function that converts the arguments of a `context.report` call from a rule into a reported
|
* Returns a function that converts the arguments of a `context.report` call from a rule into a reported
|
||||||
* problem for the Node.js API.
|
* problem for the Node.js API.
|
||||||
* @param {{ruleId: string, severity: number, sourceCode: SourceCode}} metadata Metadata for the reported problem
|
* @param {{ruleId: string, severity: number, sourceCode: SourceCode, messageIds: Object}} metadata Metadata for the reported problem
|
||||||
* @param {SourceCode} sourceCode The `SourceCode` instance for the text being linted
|
* @param {SourceCode} sourceCode The `SourceCode` instance for the text being linted
|
||||||
* @returns {function(...args): {
|
* @returns {function(...args): {
|
||||||
* ruleId: string,
|
* ruleId: string,
|
||||||
* severity: (0|1|2),
|
* severity: (0|1|2),
|
||||||
* message: string,
|
* message: (string|undefined),
|
||||||
|
* messageId: (string|undefined),
|
||||||
* line: number,
|
* line: number,
|
||||||
* column: number,
|
* column: number,
|
||||||
* endLine: (number|undefined),
|
* endLine: (number|undefined),
|
||||||
@ -261,11 +264,29 @@ module.exports = function createReportTranslator(metadata) {
|
|||||||
|
|
||||||
assertValidNodeInfo(descriptor);
|
assertValidNodeInfo(descriptor);
|
||||||
|
|
||||||
|
if (descriptor.messageId) {
|
||||||
|
if (!metadata.messageIds) {
|
||||||
|
throw new TypeError("context.report() called with a messageId, but no messages were present in the rule metadata.");
|
||||||
|
}
|
||||||
|
const id = descriptor.messageId;
|
||||||
|
const messages = metadata.messageIds;
|
||||||
|
|
||||||
|
if (descriptor.message) {
|
||||||
|
throw new TypeError("context.report() called with a message and a messageId. Please only pass one.");
|
||||||
|
}
|
||||||
|
if (!messages || !Object.prototype.hasOwnProperty.call(messages, id)) {
|
||||||
|
throw new TypeError(`context.report() called with a messageId of '${id}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`);
|
||||||
|
}
|
||||||
|
descriptor.message = messages[id];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return createProblem({
|
return createProblem({
|
||||||
ruleId: metadata.ruleId,
|
ruleId: metadata.ruleId,
|
||||||
severity: metadata.severity,
|
severity: metadata.severity,
|
||||||
node: descriptor.node,
|
node: descriptor.node,
|
||||||
message: normalizeMessagePlaceholders(descriptor),
|
message: normalizeMessagePlaceholders(descriptor),
|
||||||
|
messageId: descriptor.messageId,
|
||||||
loc: normalizeReportLoc(descriptor),
|
loc: normalizeReportLoc(descriptor),
|
||||||
fix: normalizeFixes(descriptor, metadata.sourceCode),
|
fix: normalizeFixes(descriptor, metadata.sourceCode),
|
||||||
sourceLines: metadata.sourceCode.lines
|
sourceLines: metadata.sourceCode.lines
|
||||||
|
1
tools/node_modules/eslint/lib/rules/.eslintrc.yml
generated
vendored
1
tools/node_modules/eslint/lib/rules/.eslintrc.yml
generated
vendored
@ -1,3 +1,4 @@
|
|||||||
rules:
|
rules:
|
||||||
rulesdir/no-invalid-meta: "error"
|
rulesdir/no-invalid-meta: "error"
|
||||||
rulesdir/consistent-docs-description: "error"
|
rulesdir/consistent-docs-description: "error"
|
||||||
|
rulesdir/consistent-docs-url: "error"
|
||||||
|
3
tools/node_modules/eslint/lib/rules/accessor-pairs.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/accessor-pairs.js
generated
vendored
@ -75,7 +75,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce getter and setter pairs in objects",
|
description: "enforce getter and setter pairs in objects",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/accessor-pairs"
|
||||||
},
|
},
|
||||||
schema: [{
|
schema: [{
|
||||||
type: "object",
|
type: "object",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/array-bracket-newline.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/array-bracket-newline.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce linebreaks after opening and before closing array brackets",
|
description: "enforce linebreaks after opening and before closing array brackets",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/array-bracket-newline"
|
||||||
},
|
},
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/array-bracket-spacing.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/array-bracket-spacing.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent spacing inside array brackets",
|
description: "enforce consistent spacing inside array brackets",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/array-bracket-spacing"
|
||||||
},
|
},
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
schema: [
|
schema: [
|
||||||
|
21
tools/node_modules/eslint/lib/rules/array-callback-return.js
generated
vendored
21
tools/node_modules/eslint/lib/rules/array-callback-return.js
generated
vendored
@ -142,13 +142,27 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce `return` statements in callbacks of array methods",
|
description: "enforce `return` statements in callbacks of array methods",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/array-callback-return"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: [
|
||||||
|
{
|
||||||
|
type: "object",
|
||||||
|
properties: {
|
||||||
|
allowImplicit: {
|
||||||
|
type: "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
additionalProperties: false
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
create(context) {
|
create(context) {
|
||||||
|
|
||||||
|
const options = context.options[0] || { allowImplicit: false };
|
||||||
|
|
||||||
let funcInfo = {
|
let funcInfo = {
|
||||||
upper: null,
|
upper: null,
|
||||||
codePath: null,
|
codePath: null,
|
||||||
@ -212,7 +226,8 @@ module.exports = {
|
|||||||
if (funcInfo.shouldCheck) {
|
if (funcInfo.shouldCheck) {
|
||||||
funcInfo.hasReturn = true;
|
funcInfo.hasReturn = true;
|
||||||
|
|
||||||
if (!node.argument) {
|
// if allowImplicit: false, should also check node.argument
|
||||||
|
if (!options.allowImplicit && !node.argument) {
|
||||||
context.report({
|
context.report({
|
||||||
node,
|
node,
|
||||||
message: "{{name}} expected a return value.",
|
message: "{{name}} expected a return value.",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/array-element-newline.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/array-element-newline.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce line breaks after each array element",
|
description: "enforce line breaks after each array element",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/array-element-newline"
|
||||||
},
|
},
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
schema: [
|
schema: [
|
||||||
|
17
tools/node_modules/eslint/lib/rules/arrow-body-style.js
generated
vendored
17
tools/node_modules/eslint/lib/rules/arrow-body-style.js
generated
vendored
@ -19,7 +19,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require braces around arrow function bodies",
|
description: "require braces around arrow function bodies",
|
||||||
category: "ECMAScript 6",
|
category: "ECMAScript 6",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/arrow-body-style"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: {
|
schema: {
|
||||||
@ -109,10 +110,22 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (never || asNeeded && blockBody[0].type === "ReturnStatement") {
|
if (never || asNeeded && blockBody[0].type === "ReturnStatement") {
|
||||||
|
let message;
|
||||||
|
|
||||||
|
if (blockBody.length === 0) {
|
||||||
|
message = "Unexpected block statement surrounding arrow body; put a value of `undefined` immediately after the `=>`.";
|
||||||
|
} else if (blockBody.length > 1) {
|
||||||
|
message = "Unexpected block statement surrounding arrow body.";
|
||||||
|
} else if (astUtils.isOpeningBraceToken(sourceCode.getFirstToken(blockBody[0], { skip: 1 }))) {
|
||||||
|
message = "Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the `=>`.";
|
||||||
|
} else {
|
||||||
|
message = "Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.";
|
||||||
|
}
|
||||||
|
|
||||||
context.report({
|
context.report({
|
||||||
node,
|
node,
|
||||||
loc: arrowBody.loc.start,
|
loc: arrowBody.loc.start,
|
||||||
message: "Unexpected block statement surrounding arrow body.",
|
message,
|
||||||
fix(fixer) {
|
fix(fixer) {
|
||||||
const fixes = [];
|
const fixes = [];
|
||||||
|
|
||||||
|
3
tools/node_modules/eslint/lib/rules/arrow-parens.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/arrow-parens.js
generated
vendored
@ -19,7 +19,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require parentheses around arrow function arguments",
|
description: "require parentheses around arrow function arguments",
|
||||||
category: "ECMAScript 6",
|
category: "ECMAScript 6",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/arrow-parens"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "code",
|
fixable: "code",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/arrow-spacing.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/arrow-spacing.js
generated
vendored
@ -19,7 +19,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent spacing before and after the arrow in arrow functions",
|
description: "enforce consistent spacing before and after the arrow in arrow functions",
|
||||||
category: "ECMAScript 6",
|
category: "ECMAScript 6",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/arrow-spacing"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/block-scoped-var.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/block-scoped-var.js
generated
vendored
@ -13,7 +13,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce the use of variables within the scope they are defined",
|
description: "enforce the use of variables within the scope they are defined",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/block-scoped-var"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/block-spacing.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/block-spacing.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow or enforce spaces inside of blocks after opening block and before closing block",
|
description: "disallow or enforce spaces inside of blocks after opening block and before closing block",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/block-spacing"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/brace-style.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/brace-style.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent brace style for blocks",
|
description: "enforce consistent brace style for blocks",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/brace-style"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/callback-return.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/callback-return.js
generated
vendored
@ -13,7 +13,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require `return` statements after callbacks",
|
description: "require `return` statements after callbacks",
|
||||||
category: "Node.js and CommonJS",
|
category: "Node.js and CommonJS",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/callback-return"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [{
|
schema: [{
|
||||||
|
46
tools/node_modules/eslint/lib/rules/camelcase.js
generated
vendored
46
tools/node_modules/eslint/lib/rules/camelcase.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce camelcase naming convention",
|
description: "enforce camelcase naming convention",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/camelcase"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
@ -92,34 +93,45 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Always report underscored object names
|
// Always report underscored object names
|
||||||
if (node.parent.object.type === "Identifier" &&
|
if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && isUnderscored(name)) {
|
||||||
node.parent.object.name === node.name &&
|
|
||||||
isUnderscored(name)) {
|
|
||||||
report(node);
|
report(node);
|
||||||
|
|
||||||
// Report AssignmentExpressions only if they are the left side of the assignment
|
// Report AssignmentExpressions only if they are the left side of the assignment
|
||||||
} else if (effectiveParent.type === "AssignmentExpression" &&
|
} else if (effectiveParent.type === "AssignmentExpression" && isUnderscored(name) && (effectiveParent.right.type !== "MemberExpression" || effectiveParent.left.type === "MemberExpression" && effectiveParent.left.property.name === node.name)) {
|
||||||
isUnderscored(name) &&
|
|
||||||
(effectiveParent.right.type !== "MemberExpression" ||
|
|
||||||
effectiveParent.left.type === "MemberExpression" &&
|
|
||||||
effectiveParent.left.property.name === node.name)) {
|
|
||||||
report(node);
|
report(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Properties have their own rules
|
/*
|
||||||
} else if (node.parent.type === "Property") {
|
* Properties have their own rules, and
|
||||||
|
* AssignmentPattern nodes can be treated like Properties:
|
||||||
|
* e.g.: const { no_camelcased = false } = bar;
|
||||||
|
*/
|
||||||
|
} else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") {
|
||||||
|
|
||||||
|
if (node.parent.parent && node.parent.parent.type === "ObjectPattern") {
|
||||||
|
|
||||||
|
if (node.parent.shorthand && node.parent.value.left && isUnderscored(name)) {
|
||||||
|
|
||||||
|
report(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
// prevent checking righthand side of destructured object
|
||||||
|
if (node.parent.key === node && node.parent.value !== node) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node.parent.value.name && isUnderscored(name)) {
|
||||||
|
report(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// "never" check properties
|
// "never" check properties
|
||||||
if (properties === "never") {
|
if (properties === "never") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.parent.parent && node.parent.parent.type === "ObjectPattern" &&
|
// don't check right hand side of AssignmentExpression to prevent duplicate warnings
|
||||||
node.parent.key === node && node.parent.value !== node) {
|
if (isUnderscored(name) && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isUnderscored(name) && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) {
|
|
||||||
report(node);
|
report(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
tools/node_modules/eslint/lib/rules/capitalized-comments.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/capitalized-comments.js
generated
vendored
@ -113,7 +113,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce or disallow capitalization of the first letter of a comment",
|
description: "enforce or disallow capitalization of the first letter of a comment",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/capitalized-comments"
|
||||||
},
|
},
|
||||||
fixable: "code",
|
fixable: "code",
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/class-methods-use-this.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/class-methods-use-this.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce that class methods utilize `this`",
|
description: "enforce that class methods utilize `this`",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/class-methods-use-this"
|
||||||
},
|
},
|
||||||
schema: [{
|
schema: [{
|
||||||
type: "object",
|
type: "object",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/comma-dangle.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/comma-dangle.js
generated
vendored
@ -79,7 +79,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require or disallow trailing commas",
|
description: "require or disallow trailing commas",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/comma-dangle"
|
||||||
},
|
},
|
||||||
fixable: "code",
|
fixable: "code",
|
||||||
schema: {
|
schema: {
|
||||||
|
3
tools/node_modules/eslint/lib/rules/comma-spacing.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/comma-spacing.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent spacing before and after commas",
|
description: "enforce consistent spacing before and after commas",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/comma-spacing"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/comma-style.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/comma-style.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent comma style",
|
description: "enforce consistent comma style",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/comma-style"
|
||||||
},
|
},
|
||||||
fixable: "code",
|
fixable: "code",
|
||||||
schema: [
|
schema: [
|
||||||
|
19
tools/node_modules/eslint/lib/rules/complexity.js
generated
vendored
19
tools/node_modules/eslint/lib/rules/complexity.js
generated
vendored
@ -23,7 +23,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce a maximum cyclomatic complexity allowed in a program",
|
description: "enforce a maximum cyclomatic complexity allowed in a program",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/complexity"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
@ -126,20 +127,6 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Increase the logical path complexity in context
|
|
||||||
* @param {ASTNode} node node to evaluate
|
|
||||||
* @returns {void}
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
function increaseLogicalComplexity(node) {
|
|
||||||
|
|
||||||
// Avoiding &&
|
|
||||||
if (node.operator === "||") {
|
|
||||||
increaseComplexity();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// Public API
|
// Public API
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -154,7 +141,7 @@ module.exports = {
|
|||||||
|
|
||||||
CatchClause: increaseComplexity,
|
CatchClause: increaseComplexity,
|
||||||
ConditionalExpression: increaseComplexity,
|
ConditionalExpression: increaseComplexity,
|
||||||
LogicalExpression: increaseLogicalComplexity,
|
LogicalExpression: increaseComplexity,
|
||||||
ForStatement: increaseComplexity,
|
ForStatement: increaseComplexity,
|
||||||
ForInStatement: increaseComplexity,
|
ForInStatement: increaseComplexity,
|
||||||
ForOfStatement: increaseComplexity,
|
ForOfStatement: increaseComplexity,
|
||||||
|
3
tools/node_modules/eslint/lib/rules/computed-property-spacing.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/computed-property-spacing.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent spacing inside computed property brackets",
|
description: "enforce consistent spacing inside computed property brackets",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/computed-property-spacing"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/consistent-return.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/consistent-return.js
generated
vendored
@ -56,7 +56,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require `return` statements to either always or never specify values",
|
description: "require `return` statements to either always or never specify values",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/consistent-return"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [{
|
schema: [{
|
||||||
|
3
tools/node_modules/eslint/lib/rules/consistent-this.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/consistent-this.js
generated
vendored
@ -13,7 +13,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent naming when capturing the current execution context",
|
description: "enforce consistent naming when capturing the current execution context",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/consistent-this"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: {
|
schema: {
|
||||||
|
3
tools/node_modules/eslint/lib/rules/constructor-super.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/constructor-super.js
generated
vendored
@ -95,7 +95,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require `super()` calls in constructors",
|
description: "require `super()` calls in constructors",
|
||||||
category: "ECMAScript 6",
|
category: "ECMAScript 6",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/constructor-super"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/curly.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/curly.js
generated
vendored
@ -19,7 +19,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent brace style for all control statements",
|
description: "enforce consistent brace style for all control statements",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/curly"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: {
|
schema: {
|
||||||
|
3
tools/node_modules/eslint/lib/rules/default-case.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/default-case.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require `default` cases in `switch` statements",
|
description: "require `default` cases in `switch` statements",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/default-case"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [{
|
schema: [{
|
||||||
|
3
tools/node_modules/eslint/lib/rules/dot-location.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/dot-location.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent newlines before and after dots",
|
description: "enforce consistent newlines before and after dots",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/dot-location"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/dot-notation.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/dot-notation.js
generated
vendored
@ -22,7 +22,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce dot notation whenever possible",
|
description: "enforce dot notation whenever possible",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/dot-notation"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
11
tools/node_modules/eslint/lib/rules/eol-last.js
generated
vendored
11
tools/node_modules/eslint/lib/rules/eol-last.js
generated
vendored
@ -19,7 +19,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require or disallow newline at the end of files",
|
description: "require or disallow newline at the end of files",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/eol-last"
|
||||||
},
|
},
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
schema: [
|
schema: [
|
||||||
@ -46,6 +47,14 @@ module.exports = {
|
|||||||
CRLF = `\r${LF}`,
|
CRLF = `\r${LF}`,
|
||||||
endsWithNewline = lodash.endsWith(src, LF);
|
endsWithNewline = lodash.endsWith(src, LF);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Empty source is always valid: No content in file so we don't
|
||||||
|
* need to lint for a newline on the last line of content.
|
||||||
|
*/
|
||||||
|
if (!src.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let mode = context.options[0] || "always",
|
let mode = context.options[0] || "always",
|
||||||
appendCRLF = false;
|
appendCRLF = false;
|
||||||
|
|
||||||
|
3
tools/node_modules/eslint/lib/rules/eqeqeq.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/eqeqeq.js
generated
vendored
@ -20,7 +20,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require the use of `===` and `!==`",
|
description: "require the use of `===` and `!==`",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/eqeqeq"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: {
|
schema: {
|
||||||
|
3
tools/node_modules/eslint/lib/rules/for-direction.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/for-direction.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce \"for\" loop update clause moving the counter in the right direction.",
|
description: "enforce \"for\" loop update clause moving the counter in the right direction.",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/for-direction"
|
||||||
},
|
},
|
||||||
fixable: null,
|
fixable: null,
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/func-call-spacing.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/func-call-spacing.js
generated
vendored
@ -20,7 +20,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require or disallow spacing between function identifiers and their invocations",
|
description: "require or disallow spacing between function identifiers and their invocations",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/func-call-spacing"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/func-name-matching.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/func-name-matching.js
generated
vendored
@ -70,7 +70,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require function names to match the name of the variable or property to which they are assigned",
|
description: "require function names to match the name of the variable or property to which they are assigned",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/func-name-matching"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: {
|
schema: {
|
||||||
|
3
tools/node_modules/eslint/lib/rules/func-names.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/func-names.js
generated
vendored
@ -29,7 +29,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require or disallow named `function` expressions",
|
description: "require or disallow named `function` expressions",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/func-names"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/func-style.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/func-style.js
generated
vendored
@ -13,7 +13,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce the consistent use of either `function` declarations or expressions",
|
description: "enforce the consistent use of either `function` declarations or expressions",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/func-style"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/function-paren-newline.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/function-paren-newline.js
generated
vendored
@ -19,7 +19,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent line breaks inside function parentheses",
|
description: "enforce consistent line breaks inside function parentheses",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/function-paren-newline"
|
||||||
},
|
},
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/generator-star-spacing.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/generator-star-spacing.js
generated
vendored
@ -30,7 +30,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent spacing around `*` operators in generator functions",
|
description: "enforce consistent spacing around `*` operators in generator functions",
|
||||||
category: "ECMAScript 6",
|
category: "ECMAScript 6",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/generator-star-spacing"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/getter-return.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/getter-return.js
generated
vendored
@ -47,7 +47,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce `return` statements in getters",
|
description: "enforce `return` statements in getters",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/getter-return"
|
||||||
},
|
},
|
||||||
fixable: null,
|
fixable: null,
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/global-require.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/global-require.js
generated
vendored
@ -51,7 +51,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require `require()` calls to be placed at top-level module scope",
|
description: "require `require()` calls to be placed at top-level module scope",
|
||||||
category: "Node.js and CommonJS",
|
category: "Node.js and CommonJS",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/global-require"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/guard-for-in.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/guard-for-in.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require `for-in` loops to include an `if` statement",
|
description: "require `for-in` loops to include an `if` statement",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/guard-for-in"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/handle-callback-err.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/handle-callback-err.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require error handling in callbacks",
|
description: "require error handling in callbacks",
|
||||||
category: "Node.js and CommonJS",
|
category: "Node.js and CommonJS",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/handle-callback-err"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/id-blacklist.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/id-blacklist.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow specified identifiers",
|
description: "disallow specified identifiers",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/id-blacklist"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: {
|
schema: {
|
||||||
|
3
tools/node_modules/eslint/lib/rules/id-length.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/id-length.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce minimum and maximum identifier lengths",
|
description: "enforce minimum and maximum identifier lengths",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/id-length"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/id-match.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/id-match.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require identifiers to match a specified regular expression",
|
description: "require identifiers to match a specified regular expression",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/id-match"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js
generated
vendored
@ -12,7 +12,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce the location of arrow function bodies",
|
description: "enforce the location of arrow function bodies",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/implicit-arrow-linebreak"
|
||||||
},
|
},
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/indent-legacy.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/indent-legacy.js
generated
vendored
@ -25,7 +25,8 @@ module.exports = {
|
|||||||
description: "enforce consistent indentation",
|
description: "enforce consistent indentation",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false,
|
recommended: false,
|
||||||
replacedBy: ["indent"]
|
replacedBy: ["indent"],
|
||||||
|
url: "https://eslint.org/docs/rules/indent-legacy"
|
||||||
},
|
},
|
||||||
|
|
||||||
deprecated: true,
|
deprecated: true,
|
||||||
|
15
tools/node_modules/eslint/lib/rules/indent.js
generated
vendored
15
tools/node_modules/eslint/lib/rules/indent.js
generated
vendored
@ -492,7 +492,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent indentation",
|
description: "enforce consistent indentation",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/indent"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
@ -600,6 +601,9 @@ module.exports = {
|
|||||||
pattern: ":exit$"
|
pattern: ":exit$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
ignoreComments: {
|
||||||
|
type: "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -638,7 +642,8 @@ module.exports = {
|
|||||||
ObjectExpression: 1,
|
ObjectExpression: 1,
|
||||||
ImportDeclaration: 1,
|
ImportDeclaration: 1,
|
||||||
flatTernaryExpressions: false,
|
flatTernaryExpressions: false,
|
||||||
ignoredNodes: []
|
ignoredNodes: [],
|
||||||
|
ignoreComments: false
|
||||||
};
|
};
|
||||||
|
|
||||||
if (context.options.length) {
|
if (context.options.length) {
|
||||||
@ -1457,6 +1462,12 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
"Program:exit"() {
|
"Program:exit"() {
|
||||||
|
|
||||||
|
// If ignoreComments option is enabled, ignore all comment tokens.
|
||||||
|
if (options.ignoreComments) {
|
||||||
|
sourceCode.getAllComments()
|
||||||
|
.forEach(comment => offsets.ignoreToken(comment));
|
||||||
|
}
|
||||||
|
|
||||||
// Invoke the queued offset listeners for the nodes that aren't ignored.
|
// Invoke the queued offset listeners for the nodes that aren't ignored.
|
||||||
listenerCallQueue
|
listenerCallQueue
|
||||||
.filter(nodeInfo => !ignoredNodes.has(nodeInfo.node))
|
.filter(nodeInfo => !ignoredNodes.has(nodeInfo.node))
|
||||||
|
3
tools/node_modules/eslint/lib/rules/init-declarations.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/init-declarations.js
generated
vendored
@ -47,7 +47,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require or disallow initialization in variable declarations",
|
description: "require or disallow initialization in variable declarations",
|
||||||
category: "Variables",
|
category: "Variables",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/init-declarations"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: {
|
schema: {
|
||||||
|
3
tools/node_modules/eslint/lib/rules/jsx-quotes.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/jsx-quotes.js
generated
vendored
@ -41,7 +41,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce the consistent use of either double or single quotes in JSX attributes",
|
description: "enforce the consistent use of either double or single quotes in JSX attributes",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/jsx-quotes"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/key-spacing.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/key-spacing.js
generated
vendored
@ -131,7 +131,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent spacing between keys and values in object literal properties",
|
description: "enforce consistent spacing between keys and values in object literal properties",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/key-spacing"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/keyword-spacing.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/keyword-spacing.js
generated
vendored
@ -68,7 +68,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent spacing before and after keywords",
|
description: "enforce consistent spacing before and after keywords",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/keyword-spacing"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/line-comment-position.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/line-comment-position.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce position of line comments",
|
description: "enforce position of line comments",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/line-comment-position"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/linebreak-style.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/linebreak-style.js
generated
vendored
@ -20,7 +20,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce consistent linebreak style",
|
description: "enforce consistent linebreak style",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/linebreak-style"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/lines-around-comment.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/lines-around-comment.js
generated
vendored
@ -55,7 +55,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require empty lines around comments",
|
description: "require empty lines around comments",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/lines-around-comment"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/lines-around-directive.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/lines-around-directive.js
generated
vendored
@ -18,7 +18,8 @@ module.exports = {
|
|||||||
description: "require or disallow newlines around directives",
|
description: "require or disallow newlines around directives",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false,
|
recommended: false,
|
||||||
replacedBy: ["padding-line-between-statements"]
|
replacedBy: ["padding-line-between-statements"],
|
||||||
|
url: "https://eslint.org/docs/rules/lines-around-directive"
|
||||||
},
|
},
|
||||||
schema: [{
|
schema: [{
|
||||||
oneOf: [
|
oneOf: [
|
||||||
|
57
tools/node_modules/eslint/lib/rules/lines-between-class-members.js
generated
vendored
57
tools/node_modules/eslint/lib/rules/lines-between-class-members.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require or disallow an empty line between class members",
|
description: "require or disallow an empty line between class members",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/lines-between-class-members"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
@ -55,7 +56,56 @@ module.exports = {
|
|||||||
* @returns {boolean} True if there is at least a line between the tokens
|
* @returns {boolean} True if there is at least a line between the tokens
|
||||||
*/
|
*/
|
||||||
function isPaddingBetweenTokens(first, second) {
|
function isPaddingBetweenTokens(first, second) {
|
||||||
return second.loc.start.line - first.loc.end.line >= 2;
|
const comments = sourceCode.getCommentsBefore(second);
|
||||||
|
const len = comments.length;
|
||||||
|
|
||||||
|
// If there is no comments
|
||||||
|
if (len === 0) {
|
||||||
|
const linesBetweenFstAndSnd = second.loc.start.line - first.loc.end.line - 1;
|
||||||
|
|
||||||
|
return linesBetweenFstAndSnd >= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// If there are comments
|
||||||
|
let sumOfCommentLines = 0; // the numbers of lines of comments
|
||||||
|
let prevCommentLineNum = -1; // line number of the end of the previous comment
|
||||||
|
|
||||||
|
for (let i = 0; i < len; i++) {
|
||||||
|
const commentLinesOfThisComment = comments[i].loc.end.line - comments[i].loc.start.line + 1;
|
||||||
|
|
||||||
|
sumOfCommentLines += commentLinesOfThisComment;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If this comment and the previous comment are in the same line,
|
||||||
|
* the count of comment lines is duplicated. So decrement sumOfCommentLines.
|
||||||
|
*/
|
||||||
|
if (prevCommentLineNum === comments[i].loc.start.line) {
|
||||||
|
sumOfCommentLines -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
prevCommentLineNum = comments[i].loc.end.line;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the first block and the first comment are in the same line,
|
||||||
|
* the count of comment lines is duplicated. So decrement sumOfCommentLines.
|
||||||
|
*/
|
||||||
|
if (first.loc.end.line === comments[0].loc.start.line) {
|
||||||
|
sumOfCommentLines -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the last comment and the second block are in the same line,
|
||||||
|
* the count of comment lines is duplicated. So decrement sumOfCommentLines.
|
||||||
|
*/
|
||||||
|
if (comments[len - 1].loc.end.line === second.loc.start.line) {
|
||||||
|
sumOfCommentLines -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const linesBetweenFstAndSnd = second.loc.start.line - first.loc.end.line - 1;
|
||||||
|
|
||||||
|
return linesBetweenFstAndSnd - sumOfCommentLines >= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -65,8 +115,7 @@ module.exports = {
|
|||||||
for (let i = 0; i < body.length - 1; i++) {
|
for (let i = 0; i < body.length - 1; i++) {
|
||||||
const curFirst = sourceCode.getFirstToken(body[i]);
|
const curFirst = sourceCode.getFirstToken(body[i]);
|
||||||
const curLast = sourceCode.getLastToken(body[i]);
|
const curLast = sourceCode.getLastToken(body[i]);
|
||||||
const comments = sourceCode.getCommentsBefore(body[i + 1]);
|
const nextFirst = sourceCode.getFirstToken(body[i + 1]);
|
||||||
const nextFirst = comments.length ? comments[0] : sourceCode.getFirstToken(body[i + 1]);
|
|
||||||
const isPadded = isPaddingBetweenTokens(curLast, nextFirst);
|
const isPadded = isPaddingBetweenTokens(curLast, nextFirst);
|
||||||
const isMulti = !astUtils.isTokenOnSameLine(curFirst, curLast);
|
const isMulti = !astUtils.isTokenOnSameLine(curFirst, curLast);
|
||||||
const skip = !isMulti && options[1].exceptAfterSingleLine;
|
const skip = !isMulti && options[1].exceptAfterSingleLine;
|
||||||
|
3
tools/node_modules/eslint/lib/rules/max-depth.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/max-depth.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce a maximum depth that blocks can be nested",
|
description: "enforce a maximum depth that blocks can be nested",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/max-depth"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/max-len.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/max-len.js
generated
vendored
@ -68,7 +68,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce a maximum line length",
|
description: "enforce a maximum line length",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/max-len"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/max-lines.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/max-lines.js
generated
vendored
@ -20,7 +20,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce a maximum number of lines per file",
|
description: "enforce a maximum number of lines per file",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/max-lines"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/max-nested-callbacks.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/max-nested-callbacks.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce a maximum depth that callbacks can be nested",
|
description: "enforce a maximum depth that callbacks can be nested",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/max-nested-callbacks"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/max-params.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/max-params.js
generated
vendored
@ -22,7 +22,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce a maximum number of parameters in function definitions",
|
description: "enforce a maximum number of parameters in function definitions",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/max-params"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/max-statements-per-line.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/max-statements-per-line.js
generated
vendored
@ -19,7 +19,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce a maximum number of statements allowed per line",
|
description: "enforce a maximum number of statements allowed per line",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/max-statements-per-line"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/max-statements.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/max-statements.js
generated
vendored
@ -22,7 +22,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce a maximum number of statements allowed in function blocks",
|
description: "enforce a maximum number of statements allowed in function blocks",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/max-statements"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/multiline-comment-style.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/multiline-comment-style.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce a particular style for multiline comments",
|
description: "enforce a particular style for multiline comments",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/multiline-comment-style"
|
||||||
},
|
},
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }]
|
schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }]
|
||||||
|
3
tools/node_modules/eslint/lib/rules/multiline-ternary.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/multiline-ternary.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "enforce newlines between operands of ternary expressions",
|
description: "enforce newlines between operands of ternary expressions",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/multiline-ternary"
|
||||||
},
|
},
|
||||||
schema: [
|
schema: [
|
||||||
{
|
{
|
||||||
|
3
tools/node_modules/eslint/lib/rules/new-cap.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/new-cap.js
generated
vendored
@ -77,7 +77,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require constructor names to begin with a capital letter",
|
description: "require constructor names to begin with a capital letter",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/new-cap"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/new-parens.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/new-parens.js
generated
vendored
@ -24,7 +24,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require parentheses when invoking a constructor with no arguments",
|
description: "require parentheses when invoking a constructor with no arguments",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/new-parens"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [],
|
schema: [],
|
||||||
|
3
tools/node_modules/eslint/lib/rules/newline-after-var.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/newline-after-var.js
generated
vendored
@ -22,7 +22,8 @@ module.exports = {
|
|||||||
description: "require or disallow an empty line after variable declarations",
|
description: "require or disallow an empty line after variable declarations",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false,
|
recommended: false,
|
||||||
replacedBy: ["padding-line-between-statements"]
|
replacedBy: ["padding-line-between-statements"],
|
||||||
|
url: "https://eslint.org/docs/rules/newline-after-var"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/newline-before-return.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/newline-before-return.js
generated
vendored
@ -15,7 +15,8 @@ module.exports = {
|
|||||||
description: "require an empty line before `return` statements",
|
description: "require an empty line before `return` statements",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false,
|
recommended: false,
|
||||||
replacedBy: ["padding-line-between-statements"]
|
replacedBy: ["padding-line-between-statements"],
|
||||||
|
url: "https://eslint.org/docs/rules/newline-before-return"
|
||||||
},
|
},
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
schema: [],
|
schema: [],
|
||||||
|
3
tools/node_modules/eslint/lib/rules/newline-per-chained-call.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/newline-per-chained-call.js
generated
vendored
@ -17,7 +17,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "require a newline after each call in a method chain",
|
description: "require a newline after each call in a method chain",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/newline-per-chained-call"
|
||||||
},
|
},
|
||||||
fixable: "whitespace",
|
fixable: "whitespace",
|
||||||
schema: [{
|
schema: [{
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-alert.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-alert.js
generated
vendored
@ -88,7 +88,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow the use of `alert`, `confirm`, and `prompt`",
|
description: "disallow the use of `alert`, `confirm`, and `prompt`",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-alert"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-array-constructor.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-array-constructor.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow `Array` constructors",
|
description: "disallow `Array` constructors",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-array-constructor"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-await-in-loop.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-await-in-loop.js
generated
vendored
@ -28,7 +28,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow `await` inside of loops",
|
description: "disallow `await` inside of loops",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-await-in-loop"
|
||||||
},
|
},
|
||||||
schema: []
|
schema: []
|
||||||
},
|
},
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-bitwise.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-bitwise.js
generated
vendored
@ -25,7 +25,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow bitwise operators",
|
description: "disallow bitwise operators",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-bitwise"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-buffer-constructor.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-buffer-constructor.js
generated
vendored
@ -13,7 +13,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow use of the Buffer() constructor",
|
description: "disallow use of the Buffer() constructor",
|
||||||
category: "Node.js and CommonJS",
|
category: "Node.js and CommonJS",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-buffer-constructor"
|
||||||
},
|
},
|
||||||
schema: []
|
schema: []
|
||||||
},
|
},
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-caller.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-caller.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow the use of `arguments.caller` or `arguments.callee`",
|
description: "disallow the use of `arguments.caller` or `arguments.callee`",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-caller"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-case-declarations.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-case-declarations.js
generated
vendored
@ -13,7 +13,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow lexical declarations in case clauses",
|
description: "disallow lexical declarations in case clauses",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-case-declarations"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-catch-shadow.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-catch-shadow.js
generated
vendored
@ -20,7 +20,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow `catch` clause parameters from shadowing variables in the outer scope",
|
description: "disallow `catch` clause parameters from shadowing variables in the outer scope",
|
||||||
category: "Variables",
|
category: "Variables",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-catch-shadow"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-class-assign.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-class-assign.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow reassigning class members",
|
description: "disallow reassigning class members",
|
||||||
category: "ECMAScript 6",
|
category: "ECMAScript 6",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-class-assign"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js
generated
vendored
@ -13,7 +13,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow comparing against -0",
|
description: "disallow comparing against -0",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-compare-neg-zero"
|
||||||
},
|
},
|
||||||
fixable: null,
|
fixable: null,
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-cond-assign.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-cond-assign.js
generated
vendored
@ -22,7 +22,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow assignment operators in conditional expressions",
|
description: "disallow assignment operators in conditional expressions",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-cond-assign"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-confusing-arrow.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-confusing-arrow.js
generated
vendored
@ -30,7 +30,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow arrow functions where they could be confused with comparisons",
|
description: "disallow arrow functions where they could be confused with comparisons",
|
||||||
category: "ECMAScript 6",
|
category: "ECMAScript 6",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-confusing-arrow"
|
||||||
},
|
},
|
||||||
|
|
||||||
fixable: "code",
|
fixable: "code",
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-console.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-console.js
generated
vendored
@ -20,7 +20,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow the use of `console`",
|
description: "disallow the use of `console`",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-console"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-const-assign.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-const-assign.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow reassigning `const` variables",
|
description: "disallow reassigning `const` variables",
|
||||||
category: "ECMAScript 6",
|
category: "ECMAScript 6",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-const-assign"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-constant-condition.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-constant-condition.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow constant expressions in conditions",
|
description: "disallow constant expressions in conditions",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-constant-condition"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: [
|
schema: [
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-continue.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-continue.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow `continue` statements",
|
description: "disallow `continue` statements",
|
||||||
category: "Stylistic Issues",
|
category: "Stylistic Issues",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-continue"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-control-regex.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-control-regex.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow control characters in regular expressions",
|
description: "disallow control characters in regular expressions",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-control-regex"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-debugger.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-debugger.js
generated
vendored
@ -16,7 +16,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow the use of `debugger`",
|
description: "disallow the use of `debugger`",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-debugger"
|
||||||
},
|
},
|
||||||
fixable: "code",
|
fixable: "code",
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-delete-var.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-delete-var.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow deleting variables",
|
description: "disallow deleting variables",
|
||||||
category: "Variables",
|
category: "Variables",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-delete-var"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-div-regex.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-div-regex.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow division operators explicitly at the beginning of regular expressions",
|
description: "disallow division operators explicitly at the beginning of regular expressions",
|
||||||
category: "Best Practices",
|
category: "Best Practices",
|
||||||
recommended: false
|
recommended: false,
|
||||||
|
url: "https://eslint.org/docs/rules/no-div-regex"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-dupe-args.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-dupe-args.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow duplicate arguments in `function` definitions",
|
description: "disallow duplicate arguments in `function` definitions",
|
||||||
category: "Possible Errors",
|
category: "Possible Errors",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-dupe-args"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
3
tools/node_modules/eslint/lib/rules/no-dupe-class-members.js
generated
vendored
3
tools/node_modules/eslint/lib/rules/no-dupe-class-members.js
generated
vendored
@ -14,7 +14,8 @@ module.exports = {
|
|||||||
docs: {
|
docs: {
|
||||||
description: "disallow duplicate class members",
|
description: "disallow duplicate class members",
|
||||||
category: "ECMAScript 6",
|
category: "ECMAScript 6",
|
||||||
recommended: true
|
recommended: true,
|
||||||
|
url: "https://eslint.org/docs/rules/no-dupe-class-members"
|
||||||
},
|
},
|
||||||
|
|
||||||
schema: []
|
schema: []
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user