eslint 5.0.1 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -0
- package/README.md +1 -1
- package/conf/eslint-recommended.js +4 -0
- package/lib/cli-engine.js +38 -78
- package/lib/cli.js +1 -1
- package/lib/code-path-analysis/code-path-analyzer.js +2 -2
- package/lib/config/config-initializer.js +8 -8
- package/lib/config/config-validator.js +13 -6
- package/lib/config.js +1 -1
- package/lib/formatters/stylish.js +1 -1
- package/lib/ignored-paths.js +125 -37
- package/lib/linter.js +6 -7
- package/lib/rules/array-bracket-newline.js +1 -1
- package/lib/rules/array-bracket-spacing.js +1 -1
- package/lib/rules/array-callback-return.js +1 -1
- package/lib/rules/array-element-newline.js +1 -1
- package/lib/rules/arrow-body-style.js +1 -1
- package/lib/rules/arrow-parens.js +1 -1
- package/lib/rules/arrow-spacing.js +1 -1
- package/lib/rules/block-spacing.js +1 -1
- package/lib/rules/brace-style.js +1 -1
- package/lib/rules/capitalized-comments.js +1 -1
- package/lib/rules/comma-dangle.js +1 -1
- package/lib/rules/comma-spacing.js +1 -1
- package/lib/rules/comma-style.js +2 -2
- package/lib/rules/complexity.js +3 -3
- package/lib/rules/computed-property-spacing.js +1 -1
- package/lib/rules/consistent-return.js +1 -1
- package/lib/rules/curly.js +1 -1
- package/lib/rules/dot-location.js +1 -1
- package/lib/rules/dot-notation.js +1 -1
- package/lib/rules/eqeqeq.js +1 -1
- package/lib/rules/func-call-spacing.js +1 -1
- package/lib/rules/func-name-matching.js +1 -1
- package/lib/rules/func-names.js +1 -1
- package/lib/rules/function-paren-newline.js +1 -1
- package/lib/rules/getter-return.js +1 -1
- package/lib/rules/indent-legacy.js +1 -1
- package/lib/rules/indent.js +43 -7
- package/lib/rules/jsx-quotes.js +1 -1
- package/lib/rules/key-spacing.js +2 -2
- package/lib/rules/keyword-spacing.js +1 -1
- package/lib/rules/line-comment-position.js +3 -3
- package/lib/rules/linebreak-style.js +1 -1
- package/lib/rules/lines-around-comment.js +1 -1
- package/lib/rules/lines-around-directive.js +1 -1
- package/lib/rules/lines-between-class-members.js +1 -1
- package/lib/rules/max-depth.js +2 -2
- package/lib/rules/max-len.js +1 -1
- package/lib/rules/max-lines-per-function.js +1 -1
- package/lib/rules/max-lines.js +2 -2
- package/lib/rules/max-nested-callbacks.js +2 -2
- package/lib/rules/max-params.js +3 -3
- package/lib/rules/max-statements-per-line.js +1 -1
- package/lib/rules/max-statements.js +3 -3
- package/lib/rules/multiline-comment-style.js +1 -1
- package/lib/rules/multiline-ternary.js +1 -1
- package/lib/rules/new-parens.js +1 -1
- package/lib/rules/newline-after-var.js +1 -1
- package/lib/rules/newline-per-chained-call.js +1 -1
- package/lib/rules/no-alert.js +1 -1
- package/lib/rules/no-async-promise-executor.js +33 -0
- package/lib/rules/no-catch-shadow.js +5 -2
- package/lib/rules/no-class-assign.js +1 -1
- package/lib/rules/no-cond-assign.js +1 -1
- package/lib/rules/no-confusing-arrow.js +1 -1
- package/lib/rules/no-console.js +1 -1
- package/lib/rules/no-const-assign.js +1 -1
- package/lib/rules/no-debugger.js +2 -10
- package/lib/rules/no-dupe-keys.js +1 -1
- package/lib/rules/no-else-return.js +1 -1
- package/lib/rules/no-empty-function.js +1 -1
- package/lib/rules/no-empty.js +1 -1
- package/lib/rules/no-eval.js +1 -1
- package/lib/rules/no-ex-assign.js +1 -1
- package/lib/rules/no-extend-native.js +1 -1
- package/lib/rules/no-extra-bind.js +1 -1
- package/lib/rules/no-extra-boolean-cast.js +1 -1
- package/lib/rules/no-extra-label.js +1 -1
- package/lib/rules/no-extra-parens.js +2 -2
- package/lib/rules/no-extra-semi.js +1 -1
- package/lib/rules/no-floating-decimal.js +1 -1
- package/lib/rules/no-func-assign.js +1 -1
- package/lib/rules/no-implicit-coercion.js +1 -1
- package/lib/rules/no-inline-comments.js +1 -1
- package/lib/rules/no-invalid-this.js +1 -1
- package/lib/rules/no-irregular-whitespace.js +1 -1
- package/lib/rules/no-label-var.js +1 -1
- package/lib/rules/no-labels.js +1 -1
- package/lib/rules/no-misleading-character-class.js +189 -0
- package/lib/rules/no-mixed-operators.js +1 -1
- package/lib/rules/no-multi-spaces.js +1 -1
- package/lib/rules/no-multi-str.js +1 -1
- package/lib/rules/no-regex-spaces.js +1 -1
- package/lib/rules/no-restricted-globals.js +1 -1
- package/lib/rules/no-restricted-imports.js +1 -1
- package/lib/rules/no-restricted-modules.js +1 -1
- package/lib/rules/no-restricted-properties.js +1 -1
- package/lib/rules/no-return-assign.js +1 -1
- package/lib/rules/no-return-await.js +1 -1
- package/lib/rules/no-self-assign.js +1 -1
- package/lib/rules/no-sequences.js +1 -1
- package/lib/rules/no-shadow.js +1 -1
- package/lib/rules/no-this-before-super.js +1 -1
- package/lib/rules/no-throw-literal.js +1 -1
- package/lib/rules/no-trailing-spaces.js +1 -1
- package/lib/rules/no-undef-init.js +1 -1
- package/lib/rules/no-unexpected-multiline.js +1 -1
- package/lib/rules/no-unmodified-loop-condition.js +2 -3
- package/lib/rules/no-unneeded-ternary.js +1 -1
- package/lib/rules/no-unsafe-negation.js +1 -1
- package/lib/rules/no-unused-vars.js +1 -1
- package/lib/rules/no-useless-call.js +1 -1
- package/lib/rules/no-useless-computed-key.js +1 -1
- package/lib/rules/no-useless-concat.js +1 -1
- package/lib/rules/no-useless-escape.js +1 -1
- package/lib/rules/no-useless-return.js +2 -11
- package/lib/rules/no-var.js +1 -1
- package/lib/rules/no-warning-comments.js +1 -1
- package/lib/rules/no-whitespace-before-property.js +1 -1
- package/lib/rules/object-curly-newline.js +1 -1
- package/lib/rules/object-curly-spacing.js +1 -1
- package/lib/rules/object-shorthand.js +1 -1
- package/lib/rules/one-var.js +6 -6
- package/lib/rules/operator-assignment.js +1 -1
- package/lib/rules/operator-linebreak.js +1 -1
- package/lib/rules/padded-blocks.js +6 -6
- package/lib/rules/padding-line-between-statements.js +2 -2
- package/lib/rules/prefer-const.js +3 -12
- package/lib/rules/prefer-object-spread.js +154 -197
- package/lib/rules/prefer-promise-reject-errors.js +1 -1
- package/lib/rules/prefer-reflect.js +1 -1
- package/lib/rules/prefer-spread.js +1 -1
- package/lib/rules/prefer-template.js +1 -1
- package/lib/rules/quotes.js +1 -1
- package/lib/rules/radix.js +1 -1
- package/lib/rules/require-atomic-updates.js +239 -0
- package/lib/rules/require-await.js +1 -1
- package/lib/rules/require-unicode-regexp.js +65 -0
- package/lib/rules/semi-spacing.js +3 -3
- package/lib/rules/semi-style.js +1 -1
- package/lib/rules/semi.js +1 -1
- package/lib/rules/sort-keys.js +2 -2
- package/lib/rules/space-before-blocks.js +1 -1
- package/lib/rules/space-before-function-paren.js +1 -1
- package/lib/rules/space-in-parens.js +1 -1
- package/lib/rules/space-unary-ops.js +2 -2
- package/lib/rules/spaced-comment.js +1 -1
- package/lib/rules/strict.js +1 -1
- package/lib/rules/switch-colon-spacing.js +1 -1
- package/lib/rules/symbol-description.js +1 -1
- package/lib/rules/template-curly-spacing.js +1 -1
- package/lib/rules/valid-jsdoc.js +1 -1
- package/lib/rules/wrap-iife.js +1 -1
- package/lib/rules/wrap-regex.js +8 -4
- package/lib/rules/yoda.js +1 -1
- package/lib/testers/rule-tester.js +8 -10
- package/lib/token-store/index.js +1 -1
- package/lib/{ast-utils.js → util/ast-utils.js} +0 -0
- package/lib/{file-finder.js → util/file-finder.js} +2 -2
- package/lib/util/fix-tracker.js +1 -1
- package/lib/util/{glob-util.js → glob-utils.js} +4 -4
- package/lib/util/lint-result-cache.js +146 -0
- package/lib/{logging.js → util/logging.js} +0 -0
- package/lib/util/naming.js +2 -2
- package/lib/util/node-event-generator.js +3 -3
- package/lib/util/{npm-util.js → npm-utils.js} +1 -1
- package/lib/util/{path-util.js → path-utils.js} +1 -1
- package/lib/util/source-code-fixer.js +1 -1
- package/lib/util/{source-code-util.js → source-code-utils.js} +3 -3
- package/lib/util/source-code.js +1 -1
- package/lib/{timing.js → util/timing.js} +0 -0
- package/lib/util/unicode/index.js +11 -0
- package/lib/util/unicode/is-combining-character.js +13 -0
- package/lib/util/unicode/is-emoji-modifier.js +13 -0
- package/lib/util/unicode/is-regional-indicator-symbol.js +13 -0
- package/lib/util/unicode/is-surrogate-pair.js +14 -0
- package/package.json +6 -6
- package/lib/rules/.eslintrc.yml +0 -4
package/lib/util/fix-tracker.js
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
// Requirements
|
9
9
|
//------------------------------------------------------------------------------
|
10
10
|
|
11
|
-
const astUtils = require("../ast-utils");
|
11
|
+
const astUtils = require("../util/ast-utils");
|
12
12
|
|
13
13
|
//------------------------------------------------------------------------------
|
14
14
|
// Public Interface
|
@@ -13,10 +13,10 @@ const lodash = require("lodash"),
|
|
13
13
|
path = require("path"),
|
14
14
|
GlobSync = require("./glob"),
|
15
15
|
|
16
|
-
|
16
|
+
pathUtils = require("./path-utils"),
|
17
17
|
IgnoredPaths = require("../ignored-paths");
|
18
18
|
|
19
|
-
const debug = require("debug")("eslint:glob-
|
19
|
+
const debug = require("debug")("eslint:glob-utils");
|
20
20
|
|
21
21
|
//------------------------------------------------------------------------------
|
22
22
|
// Helpers
|
@@ -77,7 +77,7 @@ function processPath(options) {
|
|
77
77
|
newPath = pathname.replace(/[/\\]$/, "") + suffix;
|
78
78
|
}
|
79
79
|
|
80
|
-
return
|
80
|
+
return pathUtils.convertPathToPosix(newPath);
|
81
81
|
};
|
82
82
|
}
|
83
83
|
|
@@ -194,7 +194,7 @@ function listFilesToProcess(globPatterns, providedOptions) {
|
|
194
194
|
);
|
195
195
|
|
196
196
|
/*
|
197
|
-
* The test "should use default options if none are provided" (source-code-
|
197
|
+
* The test "should use default options if none are provided" (source-code-utils.js) checks that 'module.exports.resolveFileGlobPatterns' was called.
|
198
198
|
* So it cannot use the local function "resolveFileGlobPatterns".
|
199
199
|
*/
|
200
200
|
const resolvedGlobPatterns = module.exports.resolveFileGlobPatterns(globPatterns, options);
|
@@ -0,0 +1,146 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview Utility for caching lint results.
|
3
|
+
* @author Kevin Partington
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
//-----------------------------------------------------------------------------
|
8
|
+
// Requirements
|
9
|
+
//-----------------------------------------------------------------------------
|
10
|
+
|
11
|
+
const assert = require("assert"),
|
12
|
+
fs = require("fs"),
|
13
|
+
fileEntryCache = require("file-entry-cache"),
|
14
|
+
hash = require("./hash"),
|
15
|
+
pkg = require("../../package.json"),
|
16
|
+
stringify = require("json-stable-stringify-without-jsonify");
|
17
|
+
|
18
|
+
//-----------------------------------------------------------------------------
|
19
|
+
// Helpers
|
20
|
+
//-----------------------------------------------------------------------------
|
21
|
+
|
22
|
+
const configHashCache = new WeakMap();
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Calculates the hash of the config file used to validate a given file
|
26
|
+
* @param {Object} configHelper The config helper for retrieving configuration information
|
27
|
+
* @param {string} filename The path of the file to retrieve a config object for to calculate the hash
|
28
|
+
* @returns {string} The hash of the config
|
29
|
+
*/
|
30
|
+
function hashOfConfigFor(configHelper, filename) {
|
31
|
+
const config = configHelper.getConfig(filename);
|
32
|
+
|
33
|
+
if (!configHashCache.has(config)) {
|
34
|
+
configHashCache.set(config, hash(`${pkg.version}_${stringify(config)}`));
|
35
|
+
}
|
36
|
+
|
37
|
+
return configHashCache.get(config);
|
38
|
+
}
|
39
|
+
|
40
|
+
//-----------------------------------------------------------------------------
|
41
|
+
// Public Interface
|
42
|
+
//-----------------------------------------------------------------------------
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Lint result cache. This wraps around the file-entry-cache module,
|
46
|
+
* transparently removing properties that are difficult or expensive to
|
47
|
+
* serialize and adding them back in on retrieval.
|
48
|
+
*/
|
49
|
+
class LintResultCache {
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Creates a new LintResultCache instance.
|
53
|
+
* @constructor
|
54
|
+
* @param {string} cacheFileLocation The cache file location.
|
55
|
+
* @param {Object} configHelper The configuration helper (used for
|
56
|
+
* configuration lookup by file path).
|
57
|
+
*/
|
58
|
+
constructor(cacheFileLocation, configHelper) {
|
59
|
+
assert(cacheFileLocation, "Cache file location is required");
|
60
|
+
assert(configHelper, "Config helper is required");
|
61
|
+
|
62
|
+
this.fileEntryCache = fileEntryCache.create(cacheFileLocation);
|
63
|
+
this.configHelper = configHelper;
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Retrieve cached lint results for a given file path, if present in the
|
68
|
+
* cache. If the file is present and has not been changed, rebuild any
|
69
|
+
* missing result information.
|
70
|
+
* @param {string} filePath The file for which to retrieve lint results.
|
71
|
+
* @returns {Object|null} The rebuilt lint results, or null if the file is
|
72
|
+
* changed or not in the filesystem.
|
73
|
+
*/
|
74
|
+
getCachedLintResults(filePath) {
|
75
|
+
|
76
|
+
/*
|
77
|
+
* Cached lint results are valid if and only if:
|
78
|
+
* 1. The file is present in the filesystem
|
79
|
+
* 2. The file has not changed since the time it was previously linted
|
80
|
+
* 3. The ESLint configuration has not changed since the time the file
|
81
|
+
* was previously linted
|
82
|
+
* If any of these are not true, we will not reuse the lint results.
|
83
|
+
*/
|
84
|
+
|
85
|
+
const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
|
86
|
+
const hashOfConfig = hashOfConfigFor(this.configHelper, filePath);
|
87
|
+
const changed = fileDescriptor.changed || fileDescriptor.meta.hashOfConfig !== hashOfConfig;
|
88
|
+
|
89
|
+
if (fileDescriptor.notFound || changed) {
|
90
|
+
return null;
|
91
|
+
}
|
92
|
+
|
93
|
+
// If source is present but null, need to reread the file from the filesystem.
|
94
|
+
if (fileDescriptor.meta.results && fileDescriptor.meta.results.source === null) {
|
95
|
+
fileDescriptor.meta.results.source = fs.readFileSync(filePath, "utf-8");
|
96
|
+
}
|
97
|
+
|
98
|
+
return fileDescriptor.meta.results;
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Set the cached lint results for a given file path, after removing any
|
103
|
+
* information that will be both unnecessary and difficult to serialize.
|
104
|
+
* Avoids caching results with an "output" property (meaning fixes were
|
105
|
+
* applied), to prevent potentially incorrect results if fixes are not
|
106
|
+
* written to disk.
|
107
|
+
* @param {string} filePath The file for which to set lint results.
|
108
|
+
* @param {Object} result The lint result to be set for the file.
|
109
|
+
* @returns {void}
|
110
|
+
*/
|
111
|
+
setCachedLintResults(filePath, result) {
|
112
|
+
if (result && Object.prototype.hasOwnProperty.call(result, "output")) {
|
113
|
+
return;
|
114
|
+
}
|
115
|
+
|
116
|
+
const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
|
117
|
+
|
118
|
+
if (fileDescriptor && !fileDescriptor.notFound) {
|
119
|
+
|
120
|
+
// Serialize the result, except that we want to remove the file source if present.
|
121
|
+
const resultToSerialize = Object.assign({}, result);
|
122
|
+
|
123
|
+
/*
|
124
|
+
* Set result.source to null.
|
125
|
+
* In `getCachedLintResults`, if source is explicitly null, we will
|
126
|
+
* read the file from the filesystem to set the value again.
|
127
|
+
*/
|
128
|
+
if (Object.prototype.hasOwnProperty.call(resultToSerialize, "source")) {
|
129
|
+
resultToSerialize.source = null;
|
130
|
+
}
|
131
|
+
|
132
|
+
fileDescriptor.meta.results = resultToSerialize;
|
133
|
+
fileDescriptor.meta.hashOfConfig = hashOfConfigFor(this.configHelper, result.filePath);
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Persists the in-memory cache to disk.
|
139
|
+
* @returns {void}
|
140
|
+
*/
|
141
|
+
reconcile() {
|
142
|
+
this.fileEntryCache.reconcile();
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
module.exports = LintResultCache;
|
File without changes
|
package/lib/util/naming.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
// Requirements
|
8
8
|
//------------------------------------------------------------------------------
|
9
9
|
|
10
|
-
const
|
10
|
+
const pathUtils = require("../util/path-utils");
|
11
11
|
|
12
12
|
//------------------------------------------------------------------------------
|
13
13
|
// Private
|
@@ -31,7 +31,7 @@ function normalizePackageName(name, prefix) {
|
|
31
31
|
* https://github.com/eslint/eslint/issues/5644
|
32
32
|
*/
|
33
33
|
if (normalizedName.indexOf("\\") > -1) {
|
34
|
-
normalizedName =
|
34
|
+
normalizedName = pathUtils.convertPathToPosix(normalizedName);
|
35
35
|
}
|
36
36
|
|
37
37
|
if (normalizedName.charAt(0) === "@") {
|
@@ -45,8 +45,8 @@ function getPossibleTypes(parsedSelector) {
|
|
45
45
|
case "matches": {
|
46
46
|
const typesForComponents = parsedSelector.selectors.map(getPossibleTypes);
|
47
47
|
|
48
|
-
if (typesForComponents.every(
|
49
|
-
return lodash.union
|
48
|
+
if (typesForComponents.every(Boolean)) {
|
49
|
+
return lodash.union(...typesForComponents);
|
50
50
|
}
|
51
51
|
return null;
|
52
52
|
}
|
@@ -63,7 +63,7 @@ function getPossibleTypes(parsedSelector) {
|
|
63
63
|
* If at least one of the components could only match a particular type, the compound could only match
|
64
64
|
* the intersection of those types.
|
65
65
|
*/
|
66
|
-
return lodash.intersection
|
66
|
+
return lodash.intersection(...typesForComponents);
|
67
67
|
}
|
68
68
|
|
69
69
|
case "child":
|
@@ -54,7 +54,7 @@ function getRelativePath(filepath, baseDir) {
|
|
54
54
|
|
55
55
|
if (baseDir) {
|
56
56
|
if (!path.isAbsolute(baseDir)) {
|
57
|
-
throw new Error(
|
57
|
+
throw new Error(`baseDir should be an absolute path: ${baseDir}`);
|
58
58
|
}
|
59
59
|
return path.relative(baseDir, absolutePath);
|
60
60
|
}
|
@@ -107,7 +107,7 @@ SourceCodeFixer.applyFixes = function(sourceText, messages, shouldFix) {
|
|
107
107
|
}
|
108
108
|
|
109
109
|
messages.forEach(problem => {
|
110
|
-
if (
|
110
|
+
if (Object.prototype.hasOwnProperty.call(problem, "fix")) {
|
111
111
|
fixes.push(problem);
|
112
112
|
} else {
|
113
113
|
remainingMessages.push(problem);
|
@@ -10,10 +10,10 @@
|
|
10
10
|
//------------------------------------------------------------------------------
|
11
11
|
|
12
12
|
const CLIEngine = require("../cli-engine"),
|
13
|
-
|
13
|
+
globUtils = require("./glob-utils"),
|
14
14
|
baseDefaultOptions = require("../../conf/default-cli-options");
|
15
15
|
|
16
|
-
const debug = require("debug")("eslint:source-code-
|
16
|
+
const debug = require("debug")("eslint:source-code-utils");
|
17
17
|
|
18
18
|
//------------------------------------------------------------------------------
|
19
19
|
// Helpers
|
@@ -79,7 +79,7 @@ function getSourceCodeOfFiles(patterns, providedOptions, providedCallback) {
|
|
79
79
|
}
|
80
80
|
debug("constructed options:", options);
|
81
81
|
|
82
|
-
const filenames =
|
82
|
+
const filenames = globUtils.listFilesToProcess(globPatternsList, options)
|
83
83
|
.filter(fileInfo => !fileInfo.ignored)
|
84
84
|
.reduce((files, fileInfo) => files.concat(fileInfo.filename), []);
|
85
85
|
|
package/lib/util/source-code.js
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
const TokenStore = require("../token-store"),
|
12
12
|
Traverser = require("./traverser"),
|
13
|
-
astUtils = require("../ast-utils"),
|
13
|
+
astUtils = require("../util/ast-utils"),
|
14
14
|
lodash = require("lodash");
|
15
15
|
|
16
16
|
//------------------------------------------------------------------------------
|
File without changes
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* @author Toru Nagashima <https://github.com/mysticatea>
|
3
|
+
*/
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
isCombiningCharacter: require("./is-combining-character"),
|
8
|
+
isEmojiModifier: require("./is-emoji-modifier"),
|
9
|
+
isRegionalIndicatorSymbol: require("./is-regional-indicator-symbol"),
|
10
|
+
isSurrogatePair: require("./is-surrogate-pair")
|
11
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// THIS FILE WAS GENERATED BY 'tools/update-unicode-utils.js'
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
const combiningChars = new Set([768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,1155,1156,1157,1158,1159,1160,1161,1425,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1471,1473,1474,1476,1477,1479,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561,1562,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,1626,1627,1628,1629,1630,1631,1648,1750,1751,1752,1753,1754,1755,1756,1759,1760,1761,1762,1763,1764,1767,1768,1770,1771,1772,1773,1809,1840,1841,1842,1843,1844,1845,1846,1847,1848,1849,1850,1851,1852,1853,1854,1855,1856,1857,1858,1859,1860,1861,1862,1863,1864,1865,1866,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,2027,2028,2029,2030,2031,2032,2033,2034,2035,2070,2071,2072,2073,2075,2076,2077,2078,2079,2080,2081,2082,2083,2085,2086,2087,2089,2090,2091,2092,2093,2137,2138,2139,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298,2299,2300,2301,2302,2303,2304,2305,2306,2307,2362,2363,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2385,2386,2387,2388,2389,2390,2391,2402,2403,2433,2434,2435,2492,2494,2495,2496,2497,2498,2499,2500,2503,2504,2507,2508,2509,2519,2530,2531,2561,2562,2563,2620,2622,2623,2624,2625,2626,2631,2632,2635,2636,2637,2641,2672,2673,2677,2689,2690,2691,2748,2750,2751,2752,2753,2754,2755,2756,2757,2759,2760,2761,2763,2764,2765,2786,2787,2810,2811,2812,2813,2814,2815,2817,2818,2819,2876,2878,2879,2880,2881,2882,2883,2884,2887,2888,2891,2892,2893,2902,2903,2914,2915,2946,3006,3007,3008,3009,3010,3014,3015,3016,3018,3019,3020,3021,3031,3072,3073,3074,3075,3134,3135,3136,3137,3138,3139,3140,3142,3143,3144,3146,3147,3148,3149,3157,3158,3170,3171,3201,3202,3203,3260,3262,3263,3264,3265,3266,3267,3268,3270,3271,3272,3274,3275,3276,3277,3285,3286,3298,3299,3328,3329,3330,3331,3387,3388,3390,3391,3392,3393,3394,3395,3396,3398,3399,3400,3402,3403,3404,3405,3415,3426,3427,3458,3459,3530,3535,3536,3537,3538,3539,3540,3542,3544,3545,3546,3547,3548,3549,3550,3551,3570,3571,3633,3636,3637,3638,3639,3640,3641,3642,3655,3656,3657,3658,3659,3660,3661,3662,3761,3764,3765,3766,3767,3768,3769,3771,3772,3784,3785,3786,3787,3788,3789,3864,3865,3893,3895,3897,3902,3903,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,3966,3967,3968,3969,3970,3971,3972,3974,3975,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,3993,3994,3995,3996,3997,3998,3999,4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4038,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4182,4183,4184,4185,4190,4191,4192,4194,4195,4196,4199,4200,4201,4202,4203,4204,4205,4209,4210,4211,4212,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4239,4250,4251,4252,4253,4957,4958,4959,5906,5907,5908,5938,5939,5940,5970,5971,6002,6003,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6109,6155,6156,6157,6277,6278,6313,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6679,6680,6681,6682,6683,6741,6742,6743,6744,6745,6746,6747,6748,6749,6750,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6783,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6912,6913,6914,6915,6916,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,7019,7020,7021,7022,7023,7024,7025,7026,7027,7040,7041,7042,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7376,7377,7378,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7405,7410,7411,7412,7415,7416,7417,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7675,7676,7677,7678,7679,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,11503,11504,11505,11647,11744,11745,11746,11747,11748,11749,11750,11751,11752,11753,11754,11755,11756,11757,11758,11759,11760,11761,11762,11763,11764,11765,11766,11767,11768,11769,11770,11771,11772,11773,11774,11775,12330,12331,12332,12333,12334,12335,12441,12442,42607,42608,42609,42610,42612,42613,42614,42615,42616,42617,42618,42619,42620,42621,42654,42655,42736,42737,43010,43014,43019,43043,43044,43045,43046,43047,43136,43137,43188,43189,43190,43191,43192,43193,43194,43195,43196,43197,43198,43199,43200,43201,43202,43203,43204,43205,43232,43233,43234,43235,43236,43237,43238,43239,43240,43241,43242,43243,43244,43245,43246,43247,43248,43249,43302,43303,43304,43305,43306,43307,43308,43309,43335,43336,43337,43338,43339,43340,43341,43342,43343,43344,43345,43346,43347,43392,43393,43394,43395,43443,43444,43445,43446,43447,43448,43449,43450,43451,43452,43453,43454,43455,43456,43493,43561,43562,43563,43564,43565,43566,43567,43568,43569,43570,43571,43572,43573,43574,43587,43596,43597,43643,43644,43645,43696,43698,43699,43700,43703,43704,43710,43711,43713,43755,43756,43757,43758,43759,43765,43766,44003,44004,44005,44006,44007,44008,44009,44010,44012,44013,64286,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65056,65057,65058,65059,65060,65061,65062,65063,65064,65065,65066,65067,65068,65069,65070,65071,66045,66272,66422,66423,66424,66425,66426,68097,68098,68099,68101,68102,68108,68109,68110,68111,68152,68153,68154,68159,68325,68326,69632,69633,69634,69688,69689,69690,69691,69692,69693,69694,69695,69696,69697,69698,69699,69700,69701,69702,69759,69760,69761,69762,69808,69809,69810,69811,69812,69813,69814,69815,69816,69817,69818,69888,69889,69890,69927,69928,69929,69930,69931,69932,69933,69934,69935,69936,69937,69938,69939,69940,70003,70016,70017,70018,70067,70068,70069,70070,70071,70072,70073,70074,70075,70076,70077,70078,70079,70080,70090,70091,70092,70188,70189,70190,70191,70192,70193,70194,70195,70196,70197,70198,70199,70206,70367,70368,70369,70370,70371,70372,70373,70374,70375,70376,70377,70378,70400,70401,70402,70403,70460,70462,70463,70464,70465,70466,70467,70468,70471,70472,70475,70476,70477,70487,70498,70499,70502,70503,70504,70505,70506,70507,70508,70512,70513,70514,70515,70516,70709,70710,70711,70712,70713,70714,70715,70716,70717,70718,70719,70720,70721,70722,70723,70724,70725,70726,70832,70833,70834,70835,70836,70837,70838,70839,70840,70841,70842,70843,70844,70845,70846,70847,70848,70849,70850,70851,71087,71088,71089,71090,71091,71092,71093,71096,71097,71098,71099,71100,71101,71102,71103,71104,71132,71133,71216,71217,71218,71219,71220,71221,71222,71223,71224,71225,71226,71227,71228,71229,71230,71231,71232,71339,71340,71341,71342,71343,71344,71345,71346,71347,71348,71349,71350,71351,71453,71454,71455,71456,71457,71458,71459,71460,71461,71462,71463,71464,71465,71466,71467,72193,72194,72195,72196,72197,72198,72199,72200,72201,72202,72243,72244,72245,72246,72247,72248,72249,72251,72252,72253,72254,72263,72273,72274,72275,72276,72277,72278,72279,72280,72281,72282,72283,72330,72331,72332,72333,72334,72335,72336,72337,72338,72339,72340,72341,72342,72343,72344,72345,72751,72752,72753,72754,72755,72756,72757,72758,72760,72761,72762,72763,72764,72765,72766,72767,72850,72851,72852,72853,72854,72855,72856,72857,72858,72859,72860,72861,72862,72863,72864,72865,72866,72867,72868,72869,72870,72871,72873,72874,72875,72876,72877,72878,72879,72880,72881,72882,72883,72884,72885,72886,73009,73010,73011,73012,73013,73014,73018,73020,73021,73023,73024,73025,73026,73027,73028,73029,73031,92912,92913,92914,92915,92916,92976,92977,92978,92979,92980,92981,92982,94033,94034,94035,94036,94037,94038,94039,94040,94041,94042,94043,94044,94045,94046,94047,94048,94049,94050,94051,94052,94053,94054,94055,94056,94057,94058,94059,94060,94061,94062,94063,94064,94065,94066,94067,94068,94069,94070,94071,94072,94073,94074,94075,94076,94077,94078,94095,94096,94097,94098,113821,113822,119141,119142,119143,119144,119145,119149,119150,119151,119152,119153,119154,119163,119164,119165,119166,119167,119168,119169,119170,119173,119174,119175,119176,119177,119178,119179,119210,119211,119212,119213,119362,119363,119364,121344,121345,121346,121347,121348,121349,121350,121351,121352,121353,121354,121355,121356,121357,121358,121359,121360,121361,121362,121363,121364,121365,121366,121367,121368,121369,121370,121371,121372,121373,121374,121375,121376,121377,121378,121379,121380,121381,121382,121383,121384,121385,121386,121387,121388,121389,121390,121391,121392,121393,121394,121395,121396,121397,121398,121403,121404,121405,121406,121407,121408,121409,121410,121411,121412,121413,121414,121415,121416,121417,121418,121419,121420,121421,121422,121423,121424,121425,121426,121427,121428,121429,121430,121431,121432,121433,121434,121435,121436,121437,121438,121439,121440,121441,121442,121443,121444,121445,121446,121447,121448,121449,121450,121451,121452,121461,121476,121499,121500,121501,121502,121503,121505,121506,121507,121508,121509,121510,121511,121512,121513,121514,121515,121516,121517,121518,121519,122880,122881,122882,122883,122884,122885,122886,122888,122889,122890,122891,122892,122893,122894,122895,122896,122897,122898,122899,122900,122901,122902,122903,122904,122907,122908,122909,122910,122911,122912,122913,122915,122916,122918,122919,122920,122921,122922,125136,125137,125138,125139,125140,125141,125142,125252,125253,125254,125255,125256,125257,125258,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999])
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Check whether a given character is a combining mark or not.
|
8
|
+
* @param {number} c The character code to check.
|
9
|
+
* @returns {boolean} `true` if the character belongs to the category, one of `Mc`, `Me`, and `Mn`.
|
10
|
+
*/
|
11
|
+
module.exports = function isCombiningCharacter(c) {
|
12
|
+
return combiningChars.has(c);
|
13
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* @author Toru Nagashima <https://github.com/mysticatea>
|
3
|
+
*/
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Check whether a given character is an emoji modifier.
|
8
|
+
* @param {number} code The character code to check.
|
9
|
+
* @returns {boolean} `true` if the character is an emoji modifier.
|
10
|
+
*/
|
11
|
+
module.exports = function isEmojiModifier(code) {
|
12
|
+
return code >= 0x1F3FB && code <= 0x1F3FF;
|
13
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* @author Toru Nagashima <https://github.com/mysticatea>
|
3
|
+
*/
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Check whether a given character is a regional indicator symbol.
|
8
|
+
* @param {number} code The character code to check.
|
9
|
+
* @returns {boolean} `true` if the character is a regional indicator symbol.
|
10
|
+
*/
|
11
|
+
module.exports = function isRegionalIndicatorSymbol(code) {
|
12
|
+
return code >= 0x1F1E6 && code <= 0x1F1FF;
|
13
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* @author Toru Nagashima <https://github.com/mysticatea>
|
3
|
+
*/
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Check whether given two characters are a surrogate pair.
|
8
|
+
* @param {number} lead The code of the lead character.
|
9
|
+
* @param {number} tail The code of the tail character.
|
10
|
+
* @returns {boolean} `true` if the character pair is a surrogate pair.
|
11
|
+
*/
|
12
|
+
module.exports = function isSurrogatePair(lead, tail) {
|
13
|
+
return lead >= 0xD800 && lead < 0xDC00 && tail >= 0xDC00 && tail < 0xE000;
|
14
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint",
|
3
|
-
"version": "5.0
|
3
|
+
"version": "5.4.0",
|
4
4
|
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
|
5
5
|
"description": "An AST-based pattern checker for JavaScript.",
|
6
6
|
"bin": {
|
@@ -42,6 +42,7 @@
|
|
42
42
|
"debug": "^3.1.0",
|
43
43
|
"doctrine": "^2.1.0",
|
44
44
|
"eslint-scope": "^4.0.0",
|
45
|
+
"eslint-utils": "^1.3.1",
|
45
46
|
"eslint-visitor-keys": "^1.0.0",
|
46
47
|
"espree": "^4.0.0",
|
47
48
|
"esquery": "^1.0.1",
|
@@ -49,8 +50,8 @@
|
|
49
50
|
"file-entry-cache": "^2.0.0",
|
50
51
|
"functional-red-black-tree": "^1.0.1",
|
51
52
|
"glob": "^7.1.2",
|
52
|
-
"globals": "^11.
|
53
|
-
"ignore": "^
|
53
|
+
"globals": "^11.7.0",
|
54
|
+
"ignore": "^4.0.2",
|
54
55
|
"imurmurhash": "^0.1.4",
|
55
56
|
"inquirer": "^5.2.0",
|
56
57
|
"is-resolvable": "^1.1.0",
|
@@ -65,10 +66,9 @@
|
|
65
66
|
"path-is-inside": "^1.0.2",
|
66
67
|
"pluralize": "^7.0.0",
|
67
68
|
"progress": "^2.0.0",
|
68
|
-
"regexpp": "^
|
69
|
+
"regexpp": "^2.0.0",
|
69
70
|
"require-uncached": "^1.0.3",
|
70
71
|
"semver": "^5.5.0",
|
71
|
-
"string.prototype.matchall": "^2.0.0",
|
72
72
|
"strip-ansi": "^4.0.0",
|
73
73
|
"strip-json-comments": "^2.0.1",
|
74
74
|
"table": "^4.0.3",
|
@@ -88,7 +88,7 @@
|
|
88
88
|
"dateformat": "^3.0.3",
|
89
89
|
"ejs": "^2.6.1",
|
90
90
|
"eslint-plugin-eslint-plugin": "^1.2.0",
|
91
|
-
"eslint-plugin-node": "^
|
91
|
+
"eslint-plugin-node": "^7.0.1",
|
92
92
|
"eslint-plugin-rulesdir": "^0.1.0",
|
93
93
|
"eslint-release": "^0.11.1",
|
94
94
|
"eslint-rule-composer": "^0.3.0",
|
package/lib/rules/.eslintrc.yml
DELETED