immosquare-cleaner 0.1.34 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/lib/immosquare-cleaner.rb +2 -2
- data/linters/eslint.config.mjs +30 -0
- data/linters/rubocop-3.2.2.yml +2 -0
- data/node_modules/function-bind/README.md +27 -25
- data/node_modules/function-bind/implementation.js +12 -44
- data/node_modules/function-bind/package.json +14 -38
- data/node_modules/is-core-module/CHANGELOG.md +0 -7
- data/node_modules/is-core-module/index.js +2 -2
- data/node_modules/is-core-module/package.json +4 -4
- data/package.json +2 -4
- metadata +3 -180
- data/linters/eslintrc.json +0 -57
- data/node_modules/.bin/rimraf +0 -1
- data/node_modules/eslint-config-airbnb-base/CHANGELOG.md +0 -374
- data/node_modules/eslint-config-airbnb-base/LICENSE.md +0 -21
- data/node_modules/eslint-config-airbnb-base/README.md +0 -112
- data/node_modules/eslint-config-airbnb-base/index.js +0 -17
- data/node_modules/eslint-config-airbnb-base/legacy.js +0 -34
- data/node_modules/eslint-config-airbnb-base/node_modules/semver/LICENSE +0 -15
- data/node_modules/eslint-config-airbnb-base/node_modules/semver/README.md +0 -443
- data/node_modules/eslint-config-airbnb-base/node_modules/semver/bin/semver.js +0 -174
- data/node_modules/eslint-config-airbnb-base/node_modules/semver/package.json +0 -38
- data/node_modules/eslint-config-airbnb-base/node_modules/semver/range.bnf +0 -16
- data/node_modules/eslint-config-airbnb-base/node_modules/semver/semver.js +0 -1643
- data/node_modules/eslint-config-airbnb-base/package.json +0 -95
- data/node_modules/eslint-config-airbnb-base/rules/best-practices.js +0 -408
- data/node_modules/eslint-config-airbnb-base/rules/errors.js +0 -179
- data/node_modules/eslint-config-airbnb-base/rules/es6.js +0 -185
- data/node_modules/eslint-config-airbnb-base/rules/imports.js +0 -273
- data/node_modules/eslint-config-airbnb-base/rules/node.js +0 -43
- data/node_modules/eslint-config-airbnb-base/rules/strict.js +0 -6
- data/node_modules/eslint-config-airbnb-base/rules/style.js +0 -529
- data/node_modules/eslint-config-airbnb-base/rules/variables.js +0 -56
- data/node_modules/eslint-config-airbnb-base/test/requires.js +0 -13
- data/node_modules/eslint-config-airbnb-base/test/test-base.js +0 -32
- data/node_modules/eslint-config-airbnb-base/whitespace-async.js +0 -96
- data/node_modules/eslint-config-airbnb-base/whitespace.js +0 -102
- data/node_modules/eslint-plugin-import/CHANGELOG.md +0 -1925
- data/node_modules/eslint-plugin-import/CONTRIBUTING.md +0 -84
- data/node_modules/eslint-plugin-import/LICENSE +0 -22
- data/node_modules/eslint-plugin-import/README.md +0 -500
- data/node_modules/eslint-plugin-import/RELEASE.md +0 -54
- data/node_modules/eslint-plugin-import/SECURITY.md +0 -11
- data/node_modules/eslint-plugin-import/config/electron.js +0 -8
- data/node_modules/eslint-plugin-import/config/errors.js +0 -14
- data/node_modules/eslint-plugin-import/config/react-native.js +0 -13
- data/node_modules/eslint-plugin-import/config/react.js +0 -18
- data/node_modules/eslint-plugin-import/config/recommended.js +0 -28
- data/node_modules/eslint-plugin-import/config/stage-0.js +0 -12
- data/node_modules/eslint-plugin-import/config/typescript.js +0 -34
- data/node_modules/eslint-plugin-import/config/warnings.js +0 -12
- data/node_modules/eslint-plugin-import/docs/rules/consistent-type-specifier-style.md +0 -91
- data/node_modules/eslint-plugin-import/docs/rules/default.md +0 -72
- data/node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md +0 -92
- data/node_modules/eslint-plugin-import/docs/rules/export.md +0 -37
- data/node_modules/eslint-plugin-import/docs/rules/exports-last.md +0 -51
- data/node_modules/eslint-plugin-import/docs/rules/extensions.md +0 -174
- data/node_modules/eslint-plugin-import/docs/rules/first.md +0 -75
- data/node_modules/eslint-plugin-import/docs/rules/group-exports.md +0 -118
- data/node_modules/eslint-plugin-import/docs/rules/imports-first.md +0 -9
- data/node_modules/eslint-plugin-import/docs/rules/max-dependencies.md +0 -70
- data/node_modules/eslint-plugin-import/docs/rules/named.md +0 -102
- data/node_modules/eslint-plugin-import/docs/rules/namespace.md +0 -106
- data/node_modules/eslint-plugin-import/docs/rules/newline-after-import.md +0 -167
- data/node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md +0 -54
- data/node_modules/eslint-plugin-import/docs/rules/no-amd.md +0 -37
- data/node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md +0 -83
- data/node_modules/eslint-plugin-import/docs/rules/no-commonjs.md +0 -96
- data/node_modules/eslint-plugin-import/docs/rules/no-cycle.md +0 -111
- data/node_modules/eslint-plugin-import/docs/rules/no-default-export.md +0 -65
- data/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md +0 -62
- data/node_modules/eslint-plugin-import/docs/rules/no-duplicates.md +0 -109
- data/node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md +0 -25
- data/node_modules/eslint-plugin-import/docs/rules/no-empty-named-blocks.md +0 -49
- data/node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md +0 -139
- data/node_modules/eslint-plugin-import/docs/rules/no-import-module-exports.md +0 -81
- data/node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md +0 -136
- data/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md +0 -54
- data/node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md +0 -52
- data/node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md +0 -53
- data/node_modules/eslint-plugin-import/docs/rules/no-named-default.md +0 -36
- data/node_modules/eslint-plugin-import/docs/rules/no-named-export.md +0 -79
- data/node_modules/eslint-plugin-import/docs/rules/no-namespace.md +0 -44
- data/node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md +0 -42
- data/node_modules/eslint-plugin-import/docs/rules/no-relative-packages.md +0 -70
- data/node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md +0 -123
- data/node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md +0 -198
- data/node_modules/eslint-plugin-import/docs/rules/no-self-import.md +0 -32
- data/node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md +0 -60
- data/node_modules/eslint-plugin-import/docs/rules/no-unresolved.md +0 -110
- data/node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md +0 -125
- data/node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md +0 -85
- data/node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md +0 -39
- data/node_modules/eslint-plugin-import/docs/rules/order.md +0 -365
- data/node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md +0 -185
- data/node_modules/eslint-plugin-import/docs/rules/unambiguous.md +0 -57
- data/node_modules/eslint-plugin-import/lib/ExportMap.js +0 -856
- data/node_modules/eslint-plugin-import/lib/core/importType.js +0 -129
- data/node_modules/eslint-plugin-import/lib/core/packagePath.js +0 -22
- data/node_modules/eslint-plugin-import/lib/core/staticRequire.js +0 -11
- data/node_modules/eslint-plugin-import/lib/docsUrl.js +0 -8
- data/node_modules/eslint-plugin-import/lib/importDeclaration.js +0 -5
- data/node_modules/eslint-plugin-import/lib/index.js +0 -71
- data/node_modules/eslint-plugin-import/lib/rules/consistent-type-specifier-style.js +0 -221
- data/node_modules/eslint-plugin-import/lib/rules/default.js +0 -40
- data/node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js +0 -120
- data/node_modules/eslint-plugin-import/lib/rules/export.js +0 -250
- data/node_modules/eslint-plugin-import/lib/rules/exports-last.js +0 -40
- data/node_modules/eslint-plugin-import/lib/rules/extensions.js +0 -193
- data/node_modules/eslint-plugin-import/lib/rules/first.js +0 -144
- data/node_modules/eslint-plugin-import/lib/rules/group-exports.js +0 -155
- data/node_modules/eslint-plugin-import/lib/rules/imports-first.js +0 -16
- data/node_modules/eslint-plugin-import/lib/rules/max-dependencies.js +0 -60
- data/node_modules/eslint-plugin-import/lib/rules/named.js +0 -143
- data/node_modules/eslint-plugin-import/lib/rules/namespace.js +0 -218
- data/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js +0 -237
- data/node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js +0 -40
- data/node_modules/eslint-plugin-import/lib/rules/no-amd.js +0 -47
- data/node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js +0 -103
- data/node_modules/eslint-plugin-import/lib/rules/no-commonjs.js +0 -141
- data/node_modules/eslint-plugin-import/lib/rules/no-cycle.js +0 -158
- data/node_modules/eslint-plugin-import/lib/rules/no-default-export.js +0 -43
- data/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js +0 -138
- data/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js +0 -354
- data/node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js +0 -77
- data/node_modules/eslint-plugin-import/lib/rules/no-empty-named-blocks.js +0 -105
- data/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js +0 -301
- data/node_modules/eslint-plugin-import/lib/rules/no-import-module-exports.js +0 -85
- data/node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js +0 -144
- data/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js +0 -59
- data/node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js +0 -96
- data/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js +0 -45
- data/node_modules/eslint-plugin-import/lib/rules/no-named-default.js +0 -31
- data/node_modules/eslint-plugin-import/lib/rules/no-named-export.js +0 -39
- data/node_modules/eslint-plugin-import/lib/rules/no-namespace.js +0 -175
- data/node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js +0 -44
- data/node_modules/eslint-plugin-import/lib/rules/no-relative-packages.js +0 -71
- data/node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js +0 -48
- data/node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js +0 -245
- data/node_modules/eslint-plugin-import/lib/rules/no-self-import.js +0 -39
- data/node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js +0 -79
- data/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js +0 -60
- data/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js +0 -945
- data/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js +0 -147
- data/node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js +0 -26
- data/node_modules/eslint-plugin-import/lib/rules/order.js +0 -785
- data/node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js +0 -116
- data/node_modules/eslint-plugin-import/lib/rules/unambiguous.js +0 -38
- data/node_modules/eslint-plugin-import/memo-parser/LICENSE +0 -22
- data/node_modules/eslint-plugin-import/memo-parser/README.md +0 -21
- data/node_modules/eslint-plugin-import/memo-parser/index.js +0 -41
- data/node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md +0 -395
- data/node_modules/eslint-plugin-import/node_modules/debug/LICENSE +0 -19
- data/node_modules/eslint-plugin-import/node_modules/debug/README.md +0 -437
- data/node_modules/eslint-plugin-import/node_modules/debug/node.js +0 -1
- data/node_modules/eslint-plugin-import/node_modules/debug/node_modules/ms/index.js +0 -162
- data/node_modules/eslint-plugin-import/node_modules/debug/node_modules/ms/license.md +0 -21
- data/node_modules/eslint-plugin-import/node_modules/debug/node_modules/ms/package.json +0 -38
- data/node_modules/eslint-plugin-import/node_modules/debug/node_modules/ms/readme.md +0 -59
- data/node_modules/eslint-plugin-import/node_modules/debug/package.json +0 -51
- data/node_modules/eslint-plugin-import/node_modules/debug/src/browser.js +0 -180
- data/node_modules/eslint-plugin-import/node_modules/debug/src/common.js +0 -249
- data/node_modules/eslint-plugin-import/node_modules/debug/src/index.js +0 -12
- data/node_modules/eslint-plugin-import/node_modules/debug/src/node.js +0 -177
- data/node_modules/eslint-plugin-import/node_modules/doctrine/CHANGELOG.md +0 -94
- data/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE +0 -177
- data/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.closure-compiler +0 -202
- data/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.esprima +0 -19
- data/node_modules/eslint-plugin-import/node_modules/doctrine/README.md +0 -165
- data/node_modules/eslint-plugin-import/node_modules/doctrine/lib/doctrine.js +0 -899
- data/node_modules/eslint-plugin-import/node_modules/doctrine/lib/typed.js +0 -1305
- data/node_modules/eslint-plugin-import/node_modules/doctrine/lib/utility.js +0 -35
- data/node_modules/eslint-plugin-import/node_modules/doctrine/package.json +0 -57
- data/node_modules/eslint-plugin-import/node_modules/minimatch/LICENSE +0 -15
- data/node_modules/eslint-plugin-import/node_modules/minimatch/README.md +0 -230
- data/node_modules/eslint-plugin-import/node_modules/minimatch/minimatch.js +0 -947
- data/node_modules/eslint-plugin-import/node_modules/minimatch/node_modules/brace-expansion/LICENSE +0 -21
- data/node_modules/eslint-plugin-import/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
- data/node_modules/eslint-plugin-import/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
- data/node_modules/eslint-plugin-import/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
- data/node_modules/eslint-plugin-import/node_modules/minimatch/package.json +0 -33
- data/node_modules/eslint-plugin-import/node_modules/semver/LICENSE +0 -15
- data/node_modules/eslint-plugin-import/node_modules/semver/README.md +0 -443
- data/node_modules/eslint-plugin-import/node_modules/semver/bin/semver.js +0 -174
- data/node_modules/eslint-plugin-import/node_modules/semver/package.json +0 -38
- data/node_modules/eslint-plugin-import/node_modules/semver/range.bnf +0 -16
- data/node_modules/eslint-plugin-import/node_modules/semver/semver.js +0 -1643
- data/node_modules/eslint-plugin-import/package.json +0 -124
- data/node_modules/function-bind/CHANGELOG.md +0 -136
@@ -1,354 +0,0 @@
|
|
1
|
-
'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve);
|
2
|
-
var _semver = require('semver');var _semver2 = _interopRequireDefault(_semver);
|
3
|
-
var _arrayPrototype = require('array.prototype.flatmap');var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);
|
4
|
-
|
5
|
-
var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _toArray(arr) {return Array.isArray(arr) ? arr : Array.from(arr);}
|
6
|
-
|
7
|
-
var typescriptPkg = void 0;
|
8
|
-
try {
|
9
|
-
typescriptPkg = require('typescript/package.json'); // eslint-disable-line import/no-extraneous-dependencies
|
10
|
-
} catch (e) {/**/}
|
11
|
-
|
12
|
-
function checkImports(imported, context) {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try {
|
13
|
-
for (var _iterator = imported.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var _ref = _step.value;var _ref2 = _slicedToArray(_ref, 2);var _module = _ref2[0];var nodes = _ref2[1];
|
14
|
-
if (nodes.length > 1) {
|
15
|
-
var message = '\'' + String(_module) + '\' imported multiple times.';var _nodes = _toArray(
|
16
|
-
nodes),first = _nodes[0],rest = _nodes.slice(1);
|
17
|
-
var sourceCode = context.getSourceCode();
|
18
|
-
var fix = getFix(first, rest, sourceCode, context);
|
19
|
-
|
20
|
-
context.report({
|
21
|
-
node: first.source,
|
22
|
-
message: message,
|
23
|
-
fix: fix // Attach the autofix (if any) to the first import.
|
24
|
-
});var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try {
|
25
|
-
|
26
|
-
for (var _iterator2 = rest[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var node = _step2.value;
|
27
|
-
context.report({
|
28
|
-
node: node.source,
|
29
|
-
message: message });
|
30
|
-
|
31
|
-
}} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}}
|
32
|
-
}
|
33
|
-
}} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}}
|
34
|
-
}
|
35
|
-
|
36
|
-
function getFix(first, rest, sourceCode, context) {
|
37
|
-
// Sorry ESLint <= 3 users, no autofix for you. Autofixing duplicate imports
|
38
|
-
// requires multiple `fixer.whatever()` calls in the `fix`: We both need to
|
39
|
-
// update the first one, and remove the rest. Support for multiple
|
40
|
-
// `fixer.whatever()` in a single `fix` was added in ESLint 4.1.
|
41
|
-
// `sourceCode.getCommentsBefore` was added in 4.0, so that's an easy thing to
|
42
|
-
// check for.
|
43
|
-
if (typeof sourceCode.getCommentsBefore !== 'function') {
|
44
|
-
return undefined;
|
45
|
-
}
|
46
|
-
|
47
|
-
// Adjusting the first import might make it multiline, which could break
|
48
|
-
// `eslint-disable-next-line` comments and similar, so bail if the first
|
49
|
-
// import has comments. Also, if the first import is `import * as ns from
|
50
|
-
// './foo'` there's nothing we can do.
|
51
|
-
if (hasProblematicComments(first, sourceCode) || hasNamespace(first)) {
|
52
|
-
return undefined;
|
53
|
-
}
|
54
|
-
|
55
|
-
var defaultImportNames = new Set(
|
56
|
-
(0, _arrayPrototype2['default'])([].concat(first, rest || []), function (x) {return getDefaultImportName(x) || [];}));
|
57
|
-
|
58
|
-
|
59
|
-
// Bail if there are multiple different default import names – it's up to the
|
60
|
-
// user to choose which one to keep.
|
61
|
-
if (defaultImportNames.size > 1) {
|
62
|
-
return undefined;
|
63
|
-
}
|
64
|
-
|
65
|
-
// Leave it to the user to handle comments. Also skip `import * as ns from
|
66
|
-
// './foo'` imports, since they cannot be merged into another import.
|
67
|
-
var restWithoutComments = rest.filter(function (node) {return !hasProblematicComments(node, sourceCode) && !hasNamespace(node);});
|
68
|
-
|
69
|
-
var specifiers = restWithoutComments.
|
70
|
-
map(function (node) {
|
71
|
-
var tokens = sourceCode.getTokens(node);
|
72
|
-
var openBrace = tokens.find(function (token) {return isPunctuator(token, '{');});
|
73
|
-
var closeBrace = tokens.find(function (token) {return isPunctuator(token, '}');});
|
74
|
-
|
75
|
-
if (openBrace == null || closeBrace == null) {
|
76
|
-
return undefined;
|
77
|
-
}
|
78
|
-
|
79
|
-
return {
|
80
|
-
importNode: node,
|
81
|
-
identifiers: sourceCode.text.slice(openBrace.range[1], closeBrace.range[0]).split(','), // Split the text into separate identifiers (retaining any whitespace before or after)
|
82
|
-
isEmpty: !hasSpecifiers(node) };
|
83
|
-
|
84
|
-
}).
|
85
|
-
filter(Boolean);
|
86
|
-
|
87
|
-
var unnecessaryImports = restWithoutComments.filter(function (node) {return !hasSpecifiers(node) &&
|
88
|
-
!hasNamespace(node) &&
|
89
|
-
!specifiers.some(function (specifier) {return specifier.importNode === node;});});
|
90
|
-
|
91
|
-
|
92
|
-
var shouldAddDefault = getDefaultImportName(first) == null && defaultImportNames.size === 1;
|
93
|
-
var shouldAddSpecifiers = specifiers.length > 0;
|
94
|
-
var shouldRemoveUnnecessary = unnecessaryImports.length > 0;
|
95
|
-
|
96
|
-
if (!(shouldAddDefault || shouldAddSpecifiers || shouldRemoveUnnecessary)) {
|
97
|
-
return undefined;
|
98
|
-
}
|
99
|
-
|
100
|
-
return function (fixer) {
|
101
|
-
var tokens = sourceCode.getTokens(first);
|
102
|
-
var openBrace = tokens.find(function (token) {return isPunctuator(token, '{');});
|
103
|
-
var closeBrace = tokens.find(function (token) {return isPunctuator(token, '}');});
|
104
|
-
var firstToken = sourceCode.getFirstToken(first);var _defaultImportNames = _slicedToArray(
|
105
|
-
defaultImportNames, 1),defaultImportName = _defaultImportNames[0];
|
106
|
-
|
107
|
-
var firstHasTrailingComma = closeBrace != null && isPunctuator(sourceCode.getTokenBefore(closeBrace), ',');
|
108
|
-
var firstIsEmpty = !hasSpecifiers(first);
|
109
|
-
var firstExistingIdentifiers = firstIsEmpty ?
|
110
|
-
new Set() :
|
111
|
-
new Set(sourceCode.text.slice(openBrace.range[1], closeBrace.range[0]).
|
112
|
-
split(',').
|
113
|
-
map(function (x) {return x.trim();}));var _specifiers$reduce =
|
114
|
-
|
115
|
-
|
116
|
-
specifiers.reduce(
|
117
|
-
function (_ref3, specifier) {var _ref4 = _slicedToArray(_ref3, 3),result = _ref4[0],needsComma = _ref4[1],existingIdentifiers = _ref4[2];
|
118
|
-
var isTypeSpecifier = specifier.importNode.importKind === 'type';
|
119
|
-
|
120
|
-
var preferInline = context.options[0] && context.options[0]['prefer-inline'];
|
121
|
-
// a user might set prefer-inline but not have a supporting TypeScript version. Flow does not support inline types so this should fail in that case as well.
|
122
|
-
if (preferInline && (!typescriptPkg || !_semver2['default'].satisfies(typescriptPkg.version, '>= 4.5'))) {
|
123
|
-
throw new Error('Your version of TypeScript does not support inline type imports.');
|
124
|
-
}
|
125
|
-
|
126
|
-
// Add *only* the new identifiers that don't already exist, and track any new identifiers so we don't add them again in the next loop
|
127
|
-
var _specifier$identifier = specifier.identifiers.reduce(function (_ref5, cur) {var _ref6 = _slicedToArray(_ref5, 2),text = _ref6[0],set = _ref6[1];
|
128
|
-
var trimmed = cur.trim(); // Trim whitespace before/after to compare to our set of existing identifiers
|
129
|
-
var curWithType = trimmed.length > 0 && preferInline && isTypeSpecifier ? 'type ' + String(cur) : cur;
|
130
|
-
if (existingIdentifiers.has(trimmed)) {
|
131
|
-
return [text, set];
|
132
|
-
}
|
133
|
-
return [text.length > 0 ? String(text) + ',' + String(curWithType) : curWithType, set.add(trimmed)];
|
134
|
-
}, ['', existingIdentifiers]),_specifier$identifier2 = _slicedToArray(_specifier$identifier, 2),specifierText = _specifier$identifier2[0],updatedExistingIdentifiers = _specifier$identifier2[1];
|
135
|
-
|
136
|
-
return [
|
137
|
-
needsComma && !specifier.isEmpty && specifierText.length > 0 ? String(
|
138
|
-
result) + ',' + String(specifierText) : '' + String(
|
139
|
-
result) + String(specifierText),
|
140
|
-
specifier.isEmpty ? needsComma : true,
|
141
|
-
updatedExistingIdentifiers];
|
142
|
-
|
143
|
-
},
|
144
|
-
['', !firstHasTrailingComma && !firstIsEmpty, firstExistingIdentifiers]),_specifiers$reduce2 = _slicedToArray(_specifiers$reduce, 1),specifiersText = _specifiers$reduce2[0];
|
145
|
-
|
146
|
-
|
147
|
-
var fixes = [];
|
148
|
-
|
149
|
-
if (shouldAddDefault && openBrace == null && shouldAddSpecifiers) {
|
150
|
-
// `import './foo'` → `import def, {...} from './foo'`
|
151
|
-
fixes.push(
|
152
|
-
fixer.insertTextAfter(firstToken, ' ' + String(defaultImportName) + ', {' + String(specifiersText) + '} from'));
|
153
|
-
|
154
|
-
} else if (shouldAddDefault && openBrace == null && !shouldAddSpecifiers) {
|
155
|
-
// `import './foo'` → `import def from './foo'`
|
156
|
-
fixes.push(fixer.insertTextAfter(firstToken, ' ' + String(defaultImportName) + ' from'));
|
157
|
-
} else if (shouldAddDefault && openBrace != null && closeBrace != null) {
|
158
|
-
// `import {...} from './foo'` → `import def, {...} from './foo'`
|
159
|
-
fixes.push(fixer.insertTextAfter(firstToken, ' ' + String(defaultImportName) + ','));
|
160
|
-
if (shouldAddSpecifiers) {
|
161
|
-
// `import def, {...} from './foo'` → `import def, {..., ...} from './foo'`
|
162
|
-
fixes.push(fixer.insertTextBefore(closeBrace, specifiersText));
|
163
|
-
}
|
164
|
-
} else if (!shouldAddDefault && openBrace == null && shouldAddSpecifiers) {
|
165
|
-
if (first.specifiers.length === 0) {
|
166
|
-
// `import './foo'` → `import {...} from './foo'`
|
167
|
-
fixes.push(fixer.insertTextAfter(firstToken, ' {' + String(specifiersText) + '} from'));
|
168
|
-
} else {
|
169
|
-
// `import def from './foo'` → `import def, {...} from './foo'`
|
170
|
-
fixes.push(fixer.insertTextAfter(first.specifiers[0], ', {' + String(specifiersText) + '}'));
|
171
|
-
}
|
172
|
-
} else if (!shouldAddDefault && openBrace != null && closeBrace != null) {
|
173
|
-
// `import {...} './foo'` → `import {..., ...} from './foo'`
|
174
|
-
fixes.push(fixer.insertTextBefore(closeBrace, specifiersText));
|
175
|
-
}
|
176
|
-
|
177
|
-
// Remove imports whose specifiers have been moved into the first import.
|
178
|
-
var _iteratorNormalCompletion3 = true;var _didIteratorError3 = false;var _iteratorError3 = undefined;try {for (var _iterator3 = specifiers[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {var specifier = _step3.value;
|
179
|
-
var importNode = specifier.importNode;
|
180
|
-
fixes.push(fixer.remove(importNode));
|
181
|
-
|
182
|
-
var charAfterImportRange = [importNode.range[1], importNode.range[1] + 1];
|
183
|
-
var charAfterImport = sourceCode.text.substring(charAfterImportRange[0], charAfterImportRange[1]);
|
184
|
-
if (charAfterImport === '\n') {
|
185
|
-
fixes.push(fixer.removeRange(charAfterImportRange));
|
186
|
-
}
|
187
|
-
}
|
188
|
-
|
189
|
-
// Remove imports whose default import has been moved to the first import,
|
190
|
-
// and side-effect-only imports that are unnecessary due to the first
|
191
|
-
// import.
|
192
|
-
} catch (err) {_didIteratorError3 = true;_iteratorError3 = err;} finally {try {if (!_iteratorNormalCompletion3 && _iterator3['return']) {_iterator3['return']();}} finally {if (_didIteratorError3) {throw _iteratorError3;}}}var _iteratorNormalCompletion4 = true;var _didIteratorError4 = false;var _iteratorError4 = undefined;try {for (var _iterator4 = unnecessaryImports[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {var node = _step4.value;
|
193
|
-
fixes.push(fixer.remove(node));
|
194
|
-
|
195
|
-
var charAfterImportRange = [node.range[1], node.range[1] + 1];
|
196
|
-
var charAfterImport = sourceCode.text.substring(charAfterImportRange[0], charAfterImportRange[1]);
|
197
|
-
if (charAfterImport === '\n') {
|
198
|
-
fixes.push(fixer.removeRange(charAfterImportRange));
|
199
|
-
}
|
200
|
-
}} catch (err) {_didIteratorError4 = true;_iteratorError4 = err;} finally {try {if (!_iteratorNormalCompletion4 && _iterator4['return']) {_iterator4['return']();}} finally {if (_didIteratorError4) {throw _iteratorError4;}}}
|
201
|
-
|
202
|
-
return fixes;
|
203
|
-
};
|
204
|
-
}
|
205
|
-
|
206
|
-
function isPunctuator(node, value) {
|
207
|
-
return node.type === 'Punctuator' && node.value === value;
|
208
|
-
}
|
209
|
-
|
210
|
-
// Get the name of the default import of `node`, if any.
|
211
|
-
function getDefaultImportName(node) {
|
212
|
-
var defaultSpecifier = node.specifiers.
|
213
|
-
find(function (specifier) {return specifier.type === 'ImportDefaultSpecifier';});
|
214
|
-
return defaultSpecifier != null ? defaultSpecifier.local.name : undefined;
|
215
|
-
}
|
216
|
-
|
217
|
-
// Checks whether `node` has a namespace import.
|
218
|
-
function hasNamespace(node) {
|
219
|
-
var specifiers = node.specifiers.
|
220
|
-
filter(function (specifier) {return specifier.type === 'ImportNamespaceSpecifier';});
|
221
|
-
return specifiers.length > 0;
|
222
|
-
}
|
223
|
-
|
224
|
-
// Checks whether `node` has any non-default specifiers.
|
225
|
-
function hasSpecifiers(node) {
|
226
|
-
var specifiers = node.specifiers.
|
227
|
-
filter(function (specifier) {return specifier.type === 'ImportSpecifier';});
|
228
|
-
return specifiers.length > 0;
|
229
|
-
}
|
230
|
-
|
231
|
-
// It's not obvious what the user wants to do with comments associated with
|
232
|
-
// duplicate imports, so skip imports with comments when autofixing.
|
233
|
-
function hasProblematicComments(node, sourceCode) {
|
234
|
-
return (
|
235
|
-
hasCommentBefore(node, sourceCode) ||
|
236
|
-
hasCommentAfter(node, sourceCode) ||
|
237
|
-
hasCommentInsideNonSpecifiers(node, sourceCode));
|
238
|
-
|
239
|
-
}
|
240
|
-
|
241
|
-
// Checks whether `node` has a comment (that ends) on the previous line or on
|
242
|
-
// the same line as `node` (starts).
|
243
|
-
function hasCommentBefore(node, sourceCode) {
|
244
|
-
return sourceCode.getCommentsBefore(node).
|
245
|
-
some(function (comment) {return comment.loc.end.line >= node.loc.start.line - 1;});
|
246
|
-
}
|
247
|
-
|
248
|
-
// Checks whether `node` has a comment (that starts) on the same line as `node`
|
249
|
-
// (ends).
|
250
|
-
function hasCommentAfter(node, sourceCode) {
|
251
|
-
return sourceCode.getCommentsAfter(node).
|
252
|
-
some(function (comment) {return comment.loc.start.line === node.loc.end.line;});
|
253
|
-
}
|
254
|
-
|
255
|
-
// Checks whether `node` has any comments _inside,_ except inside the `{...}`
|
256
|
-
// part (if any).
|
257
|
-
function hasCommentInsideNonSpecifiers(node, sourceCode) {
|
258
|
-
var tokens = sourceCode.getTokens(node);
|
259
|
-
var openBraceIndex = tokens.findIndex(function (token) {return isPunctuator(token, '{');});
|
260
|
-
var closeBraceIndex = tokens.findIndex(function (token) {return isPunctuator(token, '}');});
|
261
|
-
// Slice away the first token, since we're no looking for comments _before_
|
262
|
-
// `node` (only inside). If there's a `{...}` part, look for comments before
|
263
|
-
// the `{`, but not before the `}` (hence the `+1`s).
|
264
|
-
var someTokens = openBraceIndex >= 0 && closeBraceIndex >= 0 ?
|
265
|
-
tokens.slice(1, openBraceIndex + 1).concat(tokens.slice(closeBraceIndex + 1)) :
|
266
|
-
tokens.slice(1);
|
267
|
-
return someTokens.some(function (token) {return sourceCode.getCommentsBefore(token).length > 0;});
|
268
|
-
}
|
269
|
-
|
270
|
-
module.exports = {
|
271
|
-
meta: {
|
272
|
-
type: 'problem',
|
273
|
-
docs: {
|
274
|
-
category: 'Style guide',
|
275
|
-
description: 'Forbid repeated import of the same module in multiple places.',
|
276
|
-
url: (0, _docsUrl2['default'])('no-duplicates') },
|
277
|
-
|
278
|
-
fixable: 'code',
|
279
|
-
schema: [
|
280
|
-
{
|
281
|
-
type: 'object',
|
282
|
-
properties: {
|
283
|
-
considerQueryString: {
|
284
|
-
type: 'boolean' },
|
285
|
-
|
286
|
-
'prefer-inline': {
|
287
|
-
type: 'boolean' } },
|
288
|
-
|
289
|
-
|
290
|
-
additionalProperties: false }] },
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
create: function () {function create(context) {
|
296
|
-
// Prepare the resolver from options.
|
297
|
-
var considerQueryStringOption = context.options[0] &&
|
298
|
-
context.options[0].considerQueryString;
|
299
|
-
var defaultResolver = function () {function defaultResolver(sourcePath) {return (0, _resolve2['default'])(sourcePath, context) || sourcePath;}return defaultResolver;}();
|
300
|
-
var resolver = considerQueryStringOption ? function (sourcePath) {
|
301
|
-
var parts = sourcePath.match(/^([^?]*)\?(.*)$/);
|
302
|
-
if (!parts) {
|
303
|
-
return defaultResolver(sourcePath);
|
304
|
-
}
|
305
|
-
return String(defaultResolver(parts[1])) + '?' + String(parts[2]);
|
306
|
-
} : defaultResolver;
|
307
|
-
|
308
|
-
var moduleMaps = new Map();
|
309
|
-
|
310
|
-
function getImportMap(n) {
|
311
|
-
if (!moduleMaps.has(n.parent)) {
|
312
|
-
moduleMaps.set(n.parent, {
|
313
|
-
imported: new Map(),
|
314
|
-
nsImported: new Map(),
|
315
|
-
defaultTypesImported: new Map(),
|
316
|
-
namedTypesImported: new Map() });
|
317
|
-
|
318
|
-
}
|
319
|
-
var map = moduleMaps.get(n.parent);
|
320
|
-
var preferInline = context.options[0] && context.options[0]['prefer-inline'];
|
321
|
-
if (!preferInline && n.importKind === 'type') {
|
322
|
-
return n.specifiers.length > 0 && n.specifiers[0].type === 'ImportDefaultSpecifier' ? map.defaultTypesImported : map.namedTypesImported;
|
323
|
-
}
|
324
|
-
if (!preferInline && n.specifiers.some(function (spec) {return spec.importKind === 'type';})) {
|
325
|
-
return map.namedTypesImported;
|
326
|
-
}
|
327
|
-
|
328
|
-
return hasNamespace(n) ? map.nsImported : map.imported;
|
329
|
-
}
|
330
|
-
|
331
|
-
return {
|
332
|
-
ImportDeclaration: function () {function ImportDeclaration(n) {
|
333
|
-
// resolved path will cover aliased duplicates
|
334
|
-
var resolvedPath = resolver(n.source.value);
|
335
|
-
var importMap = getImportMap(n);
|
336
|
-
|
337
|
-
if (importMap.has(resolvedPath)) {
|
338
|
-
importMap.get(resolvedPath).push(n);
|
339
|
-
} else {
|
340
|
-
importMap.set(resolvedPath, [n]);
|
341
|
-
}
|
342
|
-
}return ImportDeclaration;}(),
|
343
|
-
|
344
|
-
'Program:exit': function () {function ProgramExit() {var _iteratorNormalCompletion5 = true;var _didIteratorError5 = false;var _iteratorError5 = undefined;try {
|
345
|
-
for (var _iterator5 = moduleMaps.values()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {var map = _step5.value;
|
346
|
-
checkImports(map.imported, context);
|
347
|
-
checkImports(map.nsImported, context);
|
348
|
-
checkImports(map.defaultTypesImported, context);
|
349
|
-
checkImports(map.namedTypesImported, context);
|
350
|
-
}} catch (err) {_didIteratorError5 = true;_iteratorError5 = err;} finally {try {if (!_iteratorNormalCompletion5 && _iterator5['return']) {_iterator5['return']();}} finally {if (_didIteratorError5) {throw _iteratorError5;}}}
|
351
|
-
}return ProgramExit;}() };
|
352
|
-
|
353
|
-
}return create;}() };
|
354
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1kdXBsaWNhdGVzLmpzIl0sIm5hbWVzIjpbInR5cGVzY3JpcHRQa2ciLCJyZXF1aXJlIiwiZSIsImNoZWNrSW1wb3J0cyIsImltcG9ydGVkIiwiY29udGV4dCIsImVudHJpZXMiLCJtb2R1bGUiLCJub2RlcyIsImxlbmd0aCIsIm1lc3NhZ2UiLCJmaXJzdCIsInJlc3QiLCJzb3VyY2VDb2RlIiwiZ2V0U291cmNlQ29kZSIsImZ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NJbXBvcnRlZCwgY29udGV4dCk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0=
|
@@ -1,77 +0,0 @@
|
|
1
|
-
'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
|
2
|
-
|
3
|
-
function isRequire(node) {
|
4
|
-
return node &&
|
5
|
-
node.callee &&
|
6
|
-
node.callee.type === 'Identifier' &&
|
7
|
-
node.callee.name === 'require' &&
|
8
|
-
node.arguments.length >= 1;
|
9
|
-
}
|
10
|
-
|
11
|
-
function isDynamicImport(node) {
|
12
|
-
return node &&
|
13
|
-
node.callee &&
|
14
|
-
node.callee.type === 'Import';
|
15
|
-
}
|
16
|
-
|
17
|
-
function isStaticValue(arg) {
|
18
|
-
return arg.type === 'Literal' ||
|
19
|
-
arg.type === 'TemplateLiteral' && arg.expressions.length === 0;
|
20
|
-
}
|
21
|
-
|
22
|
-
var dynamicImportErrorMessage = 'Calls to import() should use string literals';
|
23
|
-
|
24
|
-
module.exports = {
|
25
|
-
meta: {
|
26
|
-
type: 'suggestion',
|
27
|
-
docs: {
|
28
|
-
category: 'Static analysis',
|
29
|
-
description: 'Forbid `require()` calls with expressions.',
|
30
|
-
url: (0, _docsUrl2['default'])('no-dynamic-require') },
|
31
|
-
|
32
|
-
schema: [
|
33
|
-
{
|
34
|
-
type: 'object',
|
35
|
-
properties: {
|
36
|
-
esmodule: {
|
37
|
-
type: 'boolean' } },
|
38
|
-
|
39
|
-
|
40
|
-
additionalProperties: false }] },
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
create: function () {function create(context) {
|
46
|
-
var options = context.options[0] || {};
|
47
|
-
|
48
|
-
return {
|
49
|
-
CallExpression: function () {function CallExpression(node) {
|
50
|
-
if (!node.arguments[0] || isStaticValue(node.arguments[0])) {
|
51
|
-
return;
|
52
|
-
}
|
53
|
-
if (isRequire(node)) {
|
54
|
-
return context.report({
|
55
|
-
node: node,
|
56
|
-
message: 'Calls to require() should use string literals' });
|
57
|
-
|
58
|
-
}
|
59
|
-
if (options.esmodule && isDynamicImport(node)) {
|
60
|
-
return context.report({
|
61
|
-
node: node,
|
62
|
-
message: dynamicImportErrorMessage });
|
63
|
-
|
64
|
-
}
|
65
|
-
}return CallExpression;}(),
|
66
|
-
ImportExpression: function () {function ImportExpression(node) {
|
67
|
-
if (!options.esmodule || isStaticValue(node.source)) {
|
68
|
-
return;
|
69
|
-
}
|
70
|
-
return context.report({
|
71
|
-
node: node,
|
72
|
-
message: dynamicImportErrorMessage });
|
73
|
-
|
74
|
-
}return ImportExpression;}() };
|
75
|
-
|
76
|
-
}return create;}() };
|
77
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1keW5hbWljLXJlcXVpcmUuanMiXSwibmFtZXMiOlsiaXNSZXF1aXJlIiwibm9kZSIsImNhbGxlZSIsInR5cGUiLCJuYW1lIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwiaXNEeW5hbWljSW1wb3J0IiwiaXNTdGF0aWNWYWx1ZSIsImFyZyIsImV4cHJlc3Npb25zIiwiZHluYW1pY0ltcG9ydEVycm9yTWVzc2FnZSIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1cmwiLCJzY2hlbWEiLCJwcm9wZXJ0aWVzIiwiZXNtb2R1bGUiLCJhZGRpdGlvbmFsUHJvcGVydGllcyIsImNyZWF0ZSIsImNvbnRleHQiLCJvcHRpb25zIiwiQ2FsbEV4cHJlc3Npb24iLCJyZXBvcnQiLCJtZXNzYWdlIiwiSW1wb3J0RXhwcmVzc2lvbiIsInNvdXJjZSJdLCJtYXBwaW5ncyI6ImFBQUEscUM7O0FBRUEsU0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ICAgIHR5cGU6ICdib29sZWFuJyxcbiAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgICAgICBhZGRpdGlvbmFsUHJvcGVydGllczogZmFsc2UsXG4gICAgICB9LFxuICAgIF0sXG4gIH0sXG5cbiAgY3JlYXRlKGNvbnRleHQpIHtcbiAgICBjb25zdCBvcHRpb25zID0gY29udGV4dC5vcHRpb25zWzBdIHx8IHt9O1xuXG4gICAgcmV0dXJuIHtcbiAgICAgIENhbGxFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgaWYgKCFub2RlLmFyZ3VtZW50c1swXSB8fCBpc1N0YXRpY1ZhbHVlKG5vZGUuYXJndW1lbnRzWzBdKSkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNSZXF1aXJlKG5vZGUpKSB7XG4gICAgICAgICAgcmV0dXJuIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICBtZXNzYWdlOiAnQ2FsbHMgdG8gcmVxdWlyZSgpIHNob3VsZCB1c2Ugc3RyaW5nIGxpdGVyYWxzJyxcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAob3B0aW9ucy5lc21vZHVsZSAmJiBpc0R5bmFtaWNJbXBvcnQobm9kZSkpIHtcbiAgICAgICAgICByZXR1cm4gY29udGV4dC5yZXBvcnQoe1xuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIG1lc3NhZ2U6IGR5bmFtaWNJbXBvcnRFcnJvck1lc3NhZ2UsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBJbXBvcnRFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgaWYgKCFvcHRpb25zLmVzbW9kdWxlIHx8IGlzU3RhdGljVmFsdWUobm9kZS5zb3VyY2UpKSB7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgbm9kZSxcbiAgICAgICAgICBtZXNzYWdlOiBkeW5hbWljSW1wb3J0RXJyb3JNZXNzYWdlLFxuICAgICAgICB9KTtcbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0=
|
@@ -1,105 +0,0 @@
|
|
1
|
-
'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
|
2
|
-
|
3
|
-
function getEmptyBlockRange(tokens, index) {
|
4
|
-
var token = tokens[index];
|
5
|
-
var nextToken = tokens[index + 1];
|
6
|
-
var prevToken = tokens[index - 1];
|
7
|
-
var start = token.range[0];
|
8
|
-
var end = nextToken.range[1];
|
9
|
-
|
10
|
-
// Remove block tokens and the previous comma
|
11
|
-
if (prevToken.value === ',' || prevToken.value === 'type' || prevToken.value === 'typeof') {
|
12
|
-
start = prevToken.range[0];
|
13
|
-
}
|
14
|
-
|
15
|
-
return [start, end];
|
16
|
-
}
|
17
|
-
|
18
|
-
module.exports = {
|
19
|
-
meta: {
|
20
|
-
type: 'suggestion',
|
21
|
-
docs: {
|
22
|
-
category: 'Helpful warnings',
|
23
|
-
description: 'Forbid empty named import blocks.',
|
24
|
-
url: (0, _docsUrl2['default'])('no-empty-named-blocks') },
|
25
|
-
|
26
|
-
fixable: 'code',
|
27
|
-
schema: [],
|
28
|
-
hasSuggestions: true },
|
29
|
-
|
30
|
-
|
31
|
-
create: function () {function create(context) {
|
32
|
-
var importsWithoutNameds = [];
|
33
|
-
|
34
|
-
return {
|
35
|
-
ImportDeclaration: function () {function ImportDeclaration(node) {
|
36
|
-
if (!node.specifiers.some(function (x) {return x.type === 'ImportSpecifier';})) {
|
37
|
-
importsWithoutNameds.push(node);
|
38
|
-
}
|
39
|
-
}return ImportDeclaration;}(),
|
40
|
-
|
41
|
-
'Program:exit': function () {function ProgramExit(program) {
|
42
|
-
var importsTokens = importsWithoutNameds.map(function (node) {return [node, program.tokens.filter(function (x) {return x.range[0] >= node.range[0] && x.range[1] <= node.range[1];})];});
|
43
|
-
|
44
|
-
importsTokens.forEach(function (_ref) {var _ref2 = _slicedToArray(_ref, 2),node = _ref2[0],tokens = _ref2[1];
|
45
|
-
tokens.forEach(function (token) {
|
46
|
-
var idx = program.tokens.indexOf(token);
|
47
|
-
var nextToken = program.tokens[idx + 1];
|
48
|
-
|
49
|
-
if (nextToken && token.value === '{' && nextToken.value === '}') {
|
50
|
-
var hasOtherIdentifiers = tokens.some(function (token) {return token.type === 'Identifier' &&
|
51
|
-
token.value !== 'from' &&
|
52
|
-
token.value !== 'type' &&
|
53
|
-
token.value !== 'typeof';});
|
54
|
-
|
55
|
-
|
56
|
-
// If it has no other identifiers it's the only thing in the import, so we can either remove the import
|
57
|
-
// completely or transform it in a side-effects only import
|
58
|
-
if (!hasOtherIdentifiers) {
|
59
|
-
context.report({
|
60
|
-
node: node,
|
61
|
-
message: 'Unexpected empty named import block',
|
62
|
-
suggest: [
|
63
|
-
{
|
64
|
-
desc: 'Remove unused import',
|
65
|
-
fix: function () {function fix(fixer) {
|
66
|
-
// Remove the whole import
|
67
|
-
return fixer.remove(node);
|
68
|
-
}return fix;}() },
|
69
|
-
|
70
|
-
{
|
71
|
-
desc: 'Remove empty import block',
|
72
|
-
fix: function () {function fix(fixer) {
|
73
|
-
// Remove the empty block and the 'from' token, leaving the import only for its side
|
74
|
-
// effects, e.g. `import 'mod'`
|
75
|
-
var sourceCode = context.getSourceCode();
|
76
|
-
var fromToken = program.tokens.find(function (t) {return t.value === 'from';});
|
77
|
-
var importToken = program.tokens.find(function (t) {return t.value === 'import';});
|
78
|
-
var hasSpaceAfterFrom = sourceCode.isSpaceBetween(fromToken, sourceCode.getTokenAfter(fromToken));
|
79
|
-
var hasSpaceAfterImport = sourceCode.isSpaceBetween(importToken, sourceCode.getTokenAfter(fromToken));var _getEmptyBlockRange =
|
80
|
-
|
81
|
-
getEmptyBlockRange(program.tokens, idx),_getEmptyBlockRange2 = _slicedToArray(_getEmptyBlockRange, 1),start = _getEmptyBlockRange2[0];var _fromToken$range = _slicedToArray(
|
82
|
-
fromToken.range, 2),end = _fromToken$range[1];
|
83
|
-
var range = [start, hasSpaceAfterFrom ? end + 1 : end];
|
84
|
-
|
85
|
-
return fixer.replaceTextRange(range, hasSpaceAfterImport ? '' : ' ');
|
86
|
-
}return fix;}() }] });
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
} else {
|
91
|
-
context.report({
|
92
|
-
node: node,
|
93
|
-
message: 'Unexpected empty named import block',
|
94
|
-
fix: function () {function fix(fixer) {
|
95
|
-
return fixer.removeRange(getEmptyBlockRange(program.tokens, idx));
|
96
|
-
}return fix;}() });
|
97
|
-
|
98
|
-
}
|
99
|
-
}
|
100
|
-
});
|
101
|
-
});
|
102
|
-
}return ProgramExit;}() };
|
103
|
-
|
104
|
-
}return create;}() };
|
105
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby1lbXB0eS1uYW1lZC1ibG9ja3MuanMiXSwibmFtZXMiOlsiZ2V0RW1wdHlCbG9ja1JhbmdlIiwidG9rZW5zIiwiaW5kZXgiLCJ0b2tlbiIsIm5leHRUb2tlbiIsInByZXZUb2tlbiIsInN0YXJ0IiwicmF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bnMuZm9yRWFjaCgoW25vZGUsIHRva2Vuc10pID0+IHtcbiAgICAgICAgICB0b2tlbnMuZm9yRWFjaCgodG9rZW4pID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGlkeCA9IHByb2dyYW0udG9rZW5zLmluZGV4T2YodG9rZW4pO1xuICAgICAgICAgICAgY29uc3QgbmV4dFRva2VuID0gcHJvZ3JhbS50b2tlbnNbaWR4ICsgMV07XG5cbiAgICAgICAgICAgIGlmIChuZXh0VG9rZW4gJiYgdG9rZW4udmFsdWUgPT09ICd7JyAmJiBuZXh0VG9rZW4udmFsdWUgPT09ICd9Jykge1xuICAgICAgICAgICAgICBjb25zdCBoYXNPdGhlcklkZW50aWZpZXJzID0gdG9rZW5zLnNvbWUoKHRva2VuKSA9PiB0b2tlbi50eXBlID09PSAnSWRlbnRpZmllcidcbiAgICAgICAgICAgICAgICAgICYmIHRva2VuLnZhbHVlICE9PSAnZnJvbSdcbiAgICAgICAgICAgICAgICAgICYmIHRva2VuLnZhbHVlICE9PSAndHlwZSdcbiAgICAgICAgICAgICAgICAgICYmIHRva2VuLnZhbHVlICE9PSAndHlwZW9mJyxcbiAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAvLyBJZiBpdCBoYXMgbm8gb3RoZXIgaWRlbnRpZmllcnMgaXQncyB0aGUgb25seSB0aGluZyBpbiB0aGUgaW1wb3J0LCBzbyB3ZSBjYW4gZWl0aGVyIHJlbW92ZSB0aGUgaW1wb3J0XG4gICAgICAgICAgICAgIC8vIGNvbXBsZXRlbHkgb3IgdHJhbnNmb3JtIGl0IGluIGEgc2lkZS1lZmZlY3RzIG9ubHkgaW1wb3J0XG4gICAgICAgICAgICAgIGlmICghaGFzT3RoZXJJZGVudGlmaWVycykge1xuICAgICAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICBtZXNzYWdlOiAnVW5leHBlY3RlZCBlbXB0eSBuYW1lZCBpbXBvcnQgYmxvY2snLFxuICAgICAgICAgICAgICAgICAgc3VnZ2VzdDogW1xuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ1JlbW92ZSB1bnVzZWQgaW1wb3J0JyxcbiAgICAgICAgICAgICAgICAgICAgICBmaXgoZml4ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJlbW92ZSB0aGUgd2hvbGUgaW1wb3J0XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZml4ZXIucmVtb3ZlKG5vZGUpO1xuICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnUmVtb3ZlIGVtcHR5IGltcG9ydCBibG9jaycsXG4gICAgICAgICAgICAgICAgICAgICAgZml4KGZpeGVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBSZW1vdmUgdGhlIGVtcHR5IGJsb2NrIGFuZCB0aGUgJ2Zyb20nIHRva2VuLCBsZWF2aW5nIHRoZSBpbXBvcnQgb25seSBmb3IgaXRzIHNpZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVmZmVjdHMsIGUuZy4gYGltcG9ydCAnbW9kJ2BcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNvdXJjZUNvZGUgPSBjb250ZXh0LmdldFNvdXJjZUNvZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGZyb21Ub2tlbiA9IHByb2dyYW0udG9rZW5zLmZpbmQoKHQpID0+IHQudmFsdWUgPT09ICdmcm9tJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBpbXBvcnRUb2tlbiA9IHByb2dyYW0udG9rZW5zLmZpbmQoKHQpID0+IHQudmFsdWUgPT09ICdpbXBvcnQnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGhhc1NwYWNlQWZ0ZXJGcm9tID0gc291cmNlQ29kZS5pc1NwYWNlQmV0d2Vlbihmcm9tVG9rZW4sIHNvdXJjZUNvZGUuZ2V0VG9rZW5BZnRlcihmcm9tVG9rZW4pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGhhc1NwYWNlQWZ0ZXJJbXBvcnQgPSBzb3VyY2VDb2RlLmlzU3BhY2VCZXR3ZWVuKGltcG9ydFRva2VuLCBzb3VyY2VDb2RlLmdldFRva2VuQWZ0ZXIoZnJvbVRva2VuKSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFtzdGFydF0gPSBnZXRFbXB0eUJsb2NrUmFuZ2UocHJvZ3JhbS50b2tlbnMsIGlkeCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBbLCBlbmRdID0gZnJvbVRva2VuLnJhbmdlO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmFuZ2UgPSBbc3RhcnQsIGhhc1NwYWNlQWZ0ZXJGcm9tID8gZW5kICsgMSA6IGVuZF07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmaXhlci5yZXBsYWNlVGV4dFJhbmdlKHJhbmdlLCBoYXNTcGFjZUFmdGVySW1wb3J0ID8gJycgOiAnICcpO1xuICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICBtZXNzYWdlOiAnVW5leHBlY3RlZCBlbXB0eSBuYW1lZCBpbXBvcnQgYmxvY2snLFxuICAgICAgICAgICAgICAgICAgZml4KGZpeGVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaXhlci5yZW1vdmVSYW5nZShnZXRFbXB0eUJsb2NrUmFuZ2UocHJvZ3JhbS50b2tlbnMsIGlkeCkpO1xuICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0=
|