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,193 +0,0 @@
|
|
1
|
-
'use strict';var _path = require('path');var _path2 = _interopRequireDefault(_path);
|
2
|
-
|
3
|
-
var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve);
|
4
|
-
var _importType = require('../core/importType');
|
5
|
-
var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor);
|
6
|
-
var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
|
7
|
-
|
8
|
-
var enumValues = { 'enum': ['always', 'ignorePackages', 'never'] };
|
9
|
-
var patternProperties = {
|
10
|
-
type: 'object',
|
11
|
-
patternProperties: { '.*': enumValues } };
|
12
|
-
|
13
|
-
var properties = {
|
14
|
-
type: 'object',
|
15
|
-
properties: {
|
16
|
-
pattern: patternProperties,
|
17
|
-
ignorePackages: { type: 'boolean' } } };
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
function buildProperties(context) {
|
22
|
-
|
23
|
-
var result = {
|
24
|
-
defaultConfig: 'never',
|
25
|
-
pattern: {},
|
26
|
-
ignorePackages: false };
|
27
|
-
|
28
|
-
|
29
|
-
context.options.forEach(function (obj) {
|
30
|
-
|
31
|
-
// If this is a string, set defaultConfig to its value
|
32
|
-
if (typeof obj === 'string') {
|
33
|
-
result.defaultConfig = obj;
|
34
|
-
return;
|
35
|
-
}
|
36
|
-
|
37
|
-
// If this is not the new structure, transfer all props to result.pattern
|
38
|
-
if (obj.pattern === undefined && obj.ignorePackages === undefined) {
|
39
|
-
Object.assign(result.pattern, obj);
|
40
|
-
return;
|
41
|
-
}
|
42
|
-
|
43
|
-
// If pattern is provided, transfer all props
|
44
|
-
if (obj.pattern !== undefined) {
|
45
|
-
Object.assign(result.pattern, obj.pattern);
|
46
|
-
}
|
47
|
-
|
48
|
-
// If ignorePackages is provided, transfer it to result
|
49
|
-
if (obj.ignorePackages !== undefined) {
|
50
|
-
result.ignorePackages = obj.ignorePackages;
|
51
|
-
}
|
52
|
-
});
|
53
|
-
|
54
|
-
if (result.defaultConfig === 'ignorePackages') {
|
55
|
-
result.defaultConfig = 'always';
|
56
|
-
result.ignorePackages = true;
|
57
|
-
}
|
58
|
-
|
59
|
-
return result;
|
60
|
-
}
|
61
|
-
|
62
|
-
module.exports = {
|
63
|
-
meta: {
|
64
|
-
type: 'suggestion',
|
65
|
-
docs: {
|
66
|
-
category: 'Style guide',
|
67
|
-
description: 'Ensure consistent use of file extension within the import path.',
|
68
|
-
url: (0, _docsUrl2['default'])('extensions') },
|
69
|
-
|
70
|
-
|
71
|
-
schema: {
|
72
|
-
anyOf: [
|
73
|
-
{
|
74
|
-
type: 'array',
|
75
|
-
items: [enumValues],
|
76
|
-
additionalItems: false },
|
77
|
-
|
78
|
-
{
|
79
|
-
type: 'array',
|
80
|
-
items: [
|
81
|
-
enumValues,
|
82
|
-
properties],
|
83
|
-
|
84
|
-
additionalItems: false },
|
85
|
-
|
86
|
-
{
|
87
|
-
type: 'array',
|
88
|
-
items: [properties],
|
89
|
-
additionalItems: false },
|
90
|
-
|
91
|
-
{
|
92
|
-
type: 'array',
|
93
|
-
items: [patternProperties],
|
94
|
-
additionalItems: false },
|
95
|
-
|
96
|
-
{
|
97
|
-
type: 'array',
|
98
|
-
items: [
|
99
|
-
enumValues,
|
100
|
-
patternProperties],
|
101
|
-
|
102
|
-
additionalItems: false }] } },
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
create: function () {function create(context) {
|
109
|
-
|
110
|
-
var props = buildProperties(context);
|
111
|
-
|
112
|
-
function getModifier(extension) {
|
113
|
-
return props.pattern[extension] || props.defaultConfig;
|
114
|
-
}
|
115
|
-
|
116
|
-
function isUseOfExtensionRequired(extension, isPackage) {
|
117
|
-
return getModifier(extension) === 'always' && (!props.ignorePackages || !isPackage);
|
118
|
-
}
|
119
|
-
|
120
|
-
function isUseOfExtensionForbidden(extension) {
|
121
|
-
return getModifier(extension) === 'never';
|
122
|
-
}
|
123
|
-
|
124
|
-
function isResolvableWithoutExtension(file) {
|
125
|
-
var extension = _path2['default'].extname(file);
|
126
|
-
var fileWithoutExtension = file.slice(0, -extension.length);
|
127
|
-
var resolvedFileWithoutExtension = (0, _resolve2['default'])(fileWithoutExtension, context);
|
128
|
-
|
129
|
-
return resolvedFileWithoutExtension === (0, _resolve2['default'])(file, context);
|
130
|
-
}
|
131
|
-
|
132
|
-
function isExternalRootModule(file) {
|
133
|
-
if (file === '.' || file === '..') {return false;}
|
134
|
-
var slashCount = file.split('/').length - 1;
|
135
|
-
|
136
|
-
if (slashCount === 0) {return true;}
|
137
|
-
if ((0, _importType.isScoped)(file) && slashCount <= 1) {return true;}
|
138
|
-
return false;
|
139
|
-
}
|
140
|
-
|
141
|
-
function checkFileExtension(source, node) {
|
142
|
-
// bail if the declaration doesn't have a source, e.g. "export { foo };", or if it's only partially typed like in an editor
|
143
|
-
if (!source || !source.value) {return;}
|
144
|
-
|
145
|
-
var importPathWithQueryString = source.value;
|
146
|
-
|
147
|
-
// don't enforce anything on builtins
|
148
|
-
if ((0, _importType.isBuiltIn)(importPathWithQueryString, context.settings)) {return;}
|
149
|
-
|
150
|
-
var importPath = importPathWithQueryString.replace(/\?(.*)$/, '');
|
151
|
-
|
152
|
-
// don't enforce in root external packages as they may have names with `.js`.
|
153
|
-
// Like `import Decimal from decimal.js`)
|
154
|
-
if (isExternalRootModule(importPath)) {return;}
|
155
|
-
|
156
|
-
var resolvedPath = (0, _resolve2['default'])(importPath, context);
|
157
|
-
|
158
|
-
// get extension from resolved path, if possible.
|
159
|
-
// for unresolved, use source value.
|
160
|
-
var extension = _path2['default'].extname(resolvedPath || importPath).substring(1);
|
161
|
-
|
162
|
-
// determine if this is a module
|
163
|
-
var isPackage = (0, _importType.isExternalModule)(
|
164
|
-
importPath,
|
165
|
-
(0, _resolve2['default'])(importPath, context),
|
166
|
-
context) ||
|
167
|
-
(0, _importType.isScoped)(importPath);
|
168
|
-
|
169
|
-
if (!extension || !importPath.endsWith('.' + String(extension))) {
|
170
|
-
// ignore type-only imports and exports
|
171
|
-
if (node.importKind === 'type' || node.exportKind === 'type') {return;}
|
172
|
-
var extensionRequired = isUseOfExtensionRequired(extension, isPackage);
|
173
|
-
var extensionForbidden = isUseOfExtensionForbidden(extension);
|
174
|
-
if (extensionRequired && !extensionForbidden) {
|
175
|
-
context.report({
|
176
|
-
node: source,
|
177
|
-
message: 'Missing file extension ' + (
|
178
|
-
extension ? '"' + String(extension) + '" ' : '') + 'for "' + String(importPathWithQueryString) + '"' });
|
179
|
-
|
180
|
-
}
|
181
|
-
} else if (extension) {
|
182
|
-
if (isUseOfExtensionForbidden(extension) && isResolvableWithoutExtension(importPath)) {
|
183
|
-
context.report({
|
184
|
-
node: source,
|
185
|
-
message: 'Unexpected use of file extension "' + String(extension) + '" for "' + String(importPathWithQueryString) + '"' });
|
186
|
-
|
187
|
-
}
|
188
|
-
}
|
189
|
-
}
|
190
|
-
|
191
|
-
return (0, _moduleVisitor2['default'])(checkFileExtension, { commonjs: true });
|
192
|
-
}return create;}() };
|
193
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9leHRlbnNpb25zLmpzIl0sIm5hbWVzIjpbImVudW1WYWx1ZXMiLCJwYXR0ZXJuUHJvcGVydGllcyIsInR5cGUiLCJwcm9wZXJ0aWVzIiwicGF0dGVybiIsImlnbm9yZVBhY2thZ2VzIiwiYnVpbGRQcm9wZXJ0aWVzIiwiY29udGV4dCIsInJlc3VsdCIsImRlZmF1bHRDb25maWciLCJvcHRpb25zIiwiZm9yRWFjaCIsIm9iaiIsInVuZGVmaW5lZCIsIk9iamVjdCIsImFzc2lnbiIsIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwiZG9jcyIsImNhdGVnb3J5IiwiZGVzY3JpcHRpb24iLCJ1cmwiLCJzY2hlbWEiLCJhbnlPZiIsIml0ZW1zIiwiYWRkaXRpb25hbEl0ZW1zIiwiY3JlYXRlIiwicHJvcHMiLCJnZXRNb2RpZmllciIsImV4dGVuc2lvbiIsImlzVXNlT2ZFeHRlbnNpb25SZXF1aXJlZCIsImlzUGFja2FnZSIsImlzVXNlT2ZFeHRlbnNpb25Gb3JiaWRkZW4iLCJpc1Jlc29sdmFibGVXaXRob3V0RXh0ZW5za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ciBcIiR7aW1wb3J0UGF0aFdpdGhRdWVyeVN0cmluZ31cImAsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAoZXh0ZW5zaW9uKSB7XG4gICAgICAgIGlmIChpc1VzZU9mRXh0ZW5zaW9uRm9yYmlkZGVuKGV4dGVuc2lvbikgJiYgaXNSZXNvbHZhYmxlV2l0aG91dEV4dGVuc2lvbihpbXBvcnRQYXRoKSkge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICAgIG5vZGU6IHNvdXJjZSxcbiAgICAgICAgICAgIG1lc3NhZ2U6IGBVbmV4cGVjdGVkIHVzZSBvZiBmaWxlIGV4dGVuc2lvbiBcIiR7ZXh0ZW5zaW9ufVwiIGZvciBcIiR7aW1wb3J0UGF0aFdpdGhRdWVyeVN0cmluZ31cImAsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gbW9kdWxlVmlzaXRvcihjaGVja0ZpbGVFeHRlbnNpb24sIHsgY29tbW9uanM6IHRydWUgfSk7XG4gIH0sXG59O1xuIl19
|
@@ -1,144 +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 getImportValue(node) {
|
4
|
-
return node.type === 'ImportDeclaration' ?
|
5
|
-
node.source.value :
|
6
|
-
node.moduleReference.expression.value;
|
7
|
-
}
|
8
|
-
|
9
|
-
module.exports = {
|
10
|
-
meta: {
|
11
|
-
type: 'suggestion',
|
12
|
-
docs: {
|
13
|
-
category: 'Style guide',
|
14
|
-
description: 'Ensure all imports appear before other statements.',
|
15
|
-
url: (0, _docsUrl2['default'])('first') },
|
16
|
-
|
17
|
-
fixable: 'code',
|
18
|
-
schema: [
|
19
|
-
{
|
20
|
-
type: 'string',
|
21
|
-
'enum': ['absolute-first', 'disable-absolute-first'] }] },
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
create: function () {function create(context) {
|
27
|
-
function isPossibleDirective(node) {
|
28
|
-
return node.type === 'ExpressionStatement' &&
|
29
|
-
node.expression.type === 'Literal' &&
|
30
|
-
typeof node.expression.value === 'string';
|
31
|
-
}
|
32
|
-
|
33
|
-
return {
|
34
|
-
Program: function () {function Program(n) {
|
35
|
-
var body = n.body;
|
36
|
-
if (!body) {
|
37
|
-
return;
|
38
|
-
}
|
39
|
-
var absoluteFirst = context.options[0] === 'absolute-first';
|
40
|
-
var message = 'Import in body of module; reorder to top.';
|
41
|
-
var sourceCode = context.getSourceCode();
|
42
|
-
var originSourceCode = sourceCode.getText();
|
43
|
-
var nonImportCount = 0;
|
44
|
-
var anyExpressions = false;
|
45
|
-
var anyRelative = false;
|
46
|
-
var lastLegalImp = null;
|
47
|
-
var errorInfos = [];
|
48
|
-
var shouldSort = true;
|
49
|
-
var lastSortNodesIndex = 0;
|
50
|
-
body.forEach(function (node, index) {
|
51
|
-
if (!anyExpressions && isPossibleDirective(node)) {
|
52
|
-
return;
|
53
|
-
}
|
54
|
-
|
55
|
-
anyExpressions = true;
|
56
|
-
|
57
|
-
if (node.type === 'ImportDeclaration' || node.type === 'TSImportEqualsDeclaration') {
|
58
|
-
if (absoluteFirst) {
|
59
|
-
if (/^\./.test(getImportValue(node))) {
|
60
|
-
anyRelative = true;
|
61
|
-
} else if (anyRelative) {
|
62
|
-
context.report({
|
63
|
-
node: node.type === 'ImportDeclaration' ? node.source : node.moduleReference,
|
64
|
-
message: 'Absolute imports should come before relative imports.' });
|
65
|
-
|
66
|
-
}
|
67
|
-
}
|
68
|
-
if (nonImportCount > 0) {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try {
|
69
|
-
for (var _iterator = context.getDeclaredVariables(node)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var variable = _step.value;
|
70
|
-
if (!shouldSort) {break;}
|
71
|
-
var references = variable.references;
|
72
|
-
if (references.length) {var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try {
|
73
|
-
for (var _iterator2 = references[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var reference = _step2.value;
|
74
|
-
if (reference.identifier.range[0] < node.range[1]) {
|
75
|
-
shouldSort = false;
|
76
|
-
break;
|
77
|
-
}
|
78
|
-
}} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2['return']) {_iterator2['return']();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}}
|
79
|
-
}
|
80
|
-
}} catch (err) {_didIteratorError = true;_iteratorError = err;} finally {try {if (!_iteratorNormalCompletion && _iterator['return']) {_iterator['return']();}} finally {if (_didIteratorError) {throw _iteratorError;}}}
|
81
|
-
shouldSort && (lastSortNodesIndex = errorInfos.length);
|
82
|
-
errorInfos.push({
|
83
|
-
node: node,
|
84
|
-
range: [body[index - 1].range[1], node.range[1]] });
|
85
|
-
|
86
|
-
} else {
|
87
|
-
lastLegalImp = node;
|
88
|
-
}
|
89
|
-
} else {
|
90
|
-
nonImportCount++;
|
91
|
-
}
|
92
|
-
});
|
93
|
-
if (!errorInfos.length) {return;}
|
94
|
-
errorInfos.forEach(function (errorInfo, index) {
|
95
|
-
var node = errorInfo.node;
|
96
|
-
var infos = {
|
97
|
-
node: node,
|
98
|
-
message: message };
|
99
|
-
|
100
|
-
if (index < lastSortNodesIndex) {
|
101
|
-
infos.fix = function (fixer) {
|
102
|
-
return fixer.insertTextAfter(node, '');
|
103
|
-
};
|
104
|
-
} else if (index === lastSortNodesIndex) {
|
105
|
-
var sortNodes = errorInfos.slice(0, lastSortNodesIndex + 1);
|
106
|
-
infos.fix = function (fixer) {
|
107
|
-
var removeFixers = sortNodes.map(function (_errorInfo) {
|
108
|
-
return fixer.removeRange(_errorInfo.range);
|
109
|
-
});
|
110
|
-
var range = [0, removeFixers[removeFixers.length - 1].range[1]];
|
111
|
-
var insertSourceCode = sortNodes.map(function (_errorInfo) {
|
112
|
-
var nodeSourceCode = String.prototype.slice.apply(
|
113
|
-
originSourceCode, _errorInfo.range);
|
114
|
-
|
115
|
-
if (/\S/.test(nodeSourceCode[0])) {
|
116
|
-
return '\n' + String(nodeSourceCode);
|
117
|
-
}
|
118
|
-
return nodeSourceCode;
|
119
|
-
}).join('');
|
120
|
-
var insertFixer = null;
|
121
|
-
var replaceSourceCode = '';
|
122
|
-
if (!lastLegalImp) {
|
123
|
-
insertSourceCode = insertSourceCode.trim() + insertSourceCode.match(/^(\s+)/)[0];
|
124
|
-
}
|
125
|
-
insertFixer = lastLegalImp ?
|
126
|
-
fixer.insertTextAfter(lastLegalImp, insertSourceCode) :
|
127
|
-
fixer.insertTextBefore(body[0], insertSourceCode);
|
128
|
-
|
129
|
-
var fixers = [insertFixer].concat(removeFixers);
|
130
|
-
fixers.forEach(function (computedFixer, i) {
|
131
|
-
replaceSourceCode += originSourceCode.slice(
|
132
|
-
fixers[i - 1] ? fixers[i - 1].range[1] : 0, computedFixer.range[0]) +
|
133
|
-
computedFixer.text;
|
134
|
-
});
|
135
|
-
|
136
|
-
return fixer.replaceTextRange(range, replaceSourceCode);
|
137
|
-
};
|
138
|
-
}
|
139
|
-
context.report(infos);
|
140
|
-
});
|
141
|
-
}return Program;}() };
|
142
|
-
|
143
|
-
}return create;}() };
|
144
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9maXJzdC5qcyJdLCJuYW1lcyI6WyJnZXRJbXBvcnRWYWx1ZSIsIm5vZGUiLCJ0eXBlIiwic291cmNlIiwidmFsdWUiLCJtb2R1bGVSZWZlcmVuY2UiLCJleHByZXNz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W1wb3J0RGVjbGFyYXRpb24nIHx8IG5vZGUudHlwZSA9PT0gJ1RTSW1wb3J0RXF1YWxzRGVjbGFyYXRpb24nKSB7XG4gICAgICAgICAgICBpZiAoYWJzb2x1dGVGaXJzdCkge1xuICAgICAgICAgICAgICBpZiAoKC9eXFwuLykudGVzdChnZXRJbXBvcnRWYWx1ZShub2RlKSkpIHtcbiAgICAgICAgICAgICAgICBhbnlSZWxhdGl2ZSA9IHRydWU7XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoYW55UmVsYXRpdmUpIHtcbiAgICAgICAgICAgICAgICBjb250ZXh0LnJlcG9ydCh7XG4gICAgICAgICAgICAgICAgICBub2RlOiBub2RlLnR5cGUgPT09ICdJbXBvcnREZWNsYXJhdGlvbicgPyBub2RlLnNvdXJjZSA6IG5vZGUubW9kdWxlUmVmZXJlbmNlLFxuICAgICAgICAgICAgICAgICAgbWVzc2FnZTogJ0Fic29sdXRlIGltcG9ydHMgc2hvdWxkIGNvbWUgYmVmb3JlIHJlbGF0aXZlIGltcG9ydHMuJyxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG5vbkltcG9ydENvdW50ID4gMCkge1xuICAgICAgICAgICAgICBmb3IgKGNvbnN0IHZhcmlhYmxlIG9mIGNvbnRleHQuZ2V0RGVjbGFyZWRWYXJpYWJsZXMobm9kZSkpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXNob3VsZFNvcnQpIHsgYnJlYWs7IH1cbiAgICAgICAgICAgICAgICBjb25zdCByZWZlcmVuY2VzID0gdmFyaWFibGUucmVmZXJlbmNlcztcbiAgICAgICAgICAgICAgICBpZiAocmVmZXJlbmNlcy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgcmVmZXJlbmNlIG9mIHJlZmVyZW5jZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlZmVyZW5jZS5pZGVudGlmaWVyLnJhbmdlWzBdIDwgbm9kZS5yYW5nZVsxXSkge1xuICAgICAgICAgICAgICAgICAgICAgIHNob3VsZFNvcnQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBzaG91bGRTb3J0ICYmIChsYXN0U29ydE5vZGVzSW5kZXggPSBlcnJvckluZm9zLmxlbmd0aCk7XG4gICAgICAgICAgICAgIGVycm9ySW5mb3MucHVzaCh7XG4gICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICByYW5nZTogW2JvZHlbaW5kZXggLSAxXS5yYW5nZVsxXSwgbm9kZS5yYW5nZVsxXV0sXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgbGFzdExlZ2FsSW1wID0gbm9kZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9uSW1wb3J0Q291bnQrKztcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoIWVycm9ySW5mb3MubGVuZ3RoKSB7IHJldHVybjsgfVxuICAgICAgICBlcnJvckluZm9zLmZvckVhY2goZnVuY3Rpb24gKGVycm9ySW5mbywgaW5kZXgpIHtcbiAgICAgICAgICBjb25zdCBub2RlID0gZXJyb3JJbmZvLm5vZGU7XG4gICAgICAgICAgY29uc3QgaW5mb3MgPSB7XG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgbWVzc2FnZSxcbiAgICAgICAgICB9O1xuICAgICAgICAgIGlmIChpbmRleCA8IGxhc3RTb3J0Tm9kZXNJbmRleCkge1xuICAgICAgICAgICAgaW5mb3MuZml4ID0gZnVuY3Rpb24gKGZpeGVyKSB7XG4gICAgICAgICAgICAgIHJldHVybiBmaXhlci5pbnNlcnRUZXh0QWZ0ZXIobm9kZSwgJycpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGluZGV4ID09PSBsYXN0U29ydE5vZGVzSW5kZXgpIHtcbiAgICAgICAgICAgIGNvbnN0IHNvcnROb2RlcyA9IGVycm9ySW5mb3Muc2xpY2UoMCwgbGFzdFNvcnROb2Rlc0luZGV4ICsgMSk7XG4gICAgICAgICAgICBpbmZvcy5maXggPSBmdW5jdGlvbiAoZml4ZXIpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVtb3ZlRml4ZXJzID0gc29ydE5vZGVzLm1hcChmdW5jdGlvbiAoX2Vycm9ySW5mbykge1xuICAgICAgICAgICAgICAgIHJldHVybiBmaXhlci5yZW1vdmVSYW5nZShfZXJyb3JJbmZvLnJhbmdlKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGNvbnN0IHJhbmdlID0gWzAsIHJlbW92ZUZpeGVyc1tyZW1vdmVGaXhlcnMubGVuZ3RoIC0gMV0ucmFuZ2VbMV1dO1xuICAgICAgICAgICAgICBsZXQgaW5zZXJ0U291cmNlQ29kZSA9IHNvcnROb2Rlcy5tYXAoZnVuY3Rpb24gKF9lcnJvckluZm8pIHtcbiAgICAgICAgICAgICAgICBjb25zdCBub2RlU291cmNlQ29kZSA9IFN0cmluZy5wcm90b3R5cGUuc2xpY2UuYXBwbHkoXG4gICAgICAgICAgICAgICAgICBvcmlnaW5Tb3VyY2VDb2RlLCBfZXJyb3JJbmZvLnJhbmdlLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgaWYgKCgvXFxTLykudGVzdChub2RlU291cmNlQ29kZVswXSkpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBgXFxuJHtub2RlU291cmNlQ29kZX1gO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZVNvdXJjZUNvZGU7XG4gICAgICAgICAgICAgIH0pLmpvaW4oJycpO1xuICAgICAgICAgICAgICBsZXQgaW5zZXJ0Rml4ZXIgPSBudWxsO1xuICAgICAgICAgICAgICBsZXQgcmVwbGFjZVNvdXJjZUNvZGUgPSAnJztcbiAgICAgICAgICAgICAgaWYgKCFsYXN0TGVnYWxJbXApIHtcbiAgICAgICAgICAgICAgICBpbnNlcnRTb3VyY2VDb2RlID0gaW5zZXJ0U291cmNlQ29kZS50cmltKCkgKyBpbnNlcnRTb3VyY2VDb2RlLm1hdGNoKC9eKFxccyspLylbMF07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaW5zZXJ0Rml4ZXIgPSBsYXN0TGVnYWxJbXBcbiAgICAgICAgICAgICAgICA/IGZpeGVyLmluc2VydFRleHRBZnRlcihsYXN0TGVnYWxJbXAsIGluc2VydFNvdXJjZUNvZGUpXG4gICAgICAgICAgICAgICAgOiBmaXhlci5pbnNlcnRUZXh0QmVmb3JlKGJvZHlbMF0sIGluc2VydFNvdXJjZUNvZGUpO1xuXG4gICAgICAgICAgICAgIGNvbnN0IGZpeGVycyA9IFtpbnNlcnRGaXhlcl0uY29uY2F0KHJlbW92ZUZpeGVycyk7XG4gICAgICAgICAgICAgIGZpeGVycy5mb3JFYWNoKChjb21wdXRlZEZpeGVyLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgcmVwbGFjZVNvdXJjZUNvZGUgKz0gb3JpZ2luU291cmNlQ29kZS5zbGljZShcbiAgICAgICAgICAgICAgICAgIGZpeGVyc1tpIC0gMV0gPyBmaXhlcnNbaSAtIDFdLnJhbmdlWzFdIDogMCwgY29tcHV0ZWRGaXhlci5yYW5nZVswXSxcbiAgICAgICAgICAgICAgICApICsgY29tcHV0ZWRGaXhlci50ZXh0O1xuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICByZXR1cm4gZml4ZXIucmVwbGFjZVRleHRSYW5nZShyYW5nZSwgcmVwbGFjZVNvdXJjZUNvZGUpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY29udGV4dC5yZXBvcnQoaW5mb3MpO1xuICAgICAgICB9KTtcbiAgICAgIH0sXG4gICAgfTtcbiAgfSxcbn07XG4iXX0=
|
@@ -1,155 +0,0 @@
|
|
1
|
-
'use strict';var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);
|
2
|
-
var _object = require('object.values');var _object2 = _interopRequireDefault(_object);
|
3
|
-
var _arrayPrototype = require('array.prototype.flat');var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
|
4
|
-
|
5
|
-
var meta = {
|
6
|
-
type: 'suggestion',
|
7
|
-
docs: {
|
8
|
-
category: 'Style guide',
|
9
|
-
description: 'Prefer named exports to be grouped together in a single export declaration',
|
10
|
-
url: (0, _docsUrl2['default'])('group-exports') } };
|
11
|
-
|
12
|
-
|
13
|
-
/* eslint-disable max-len */
|
14
|
-
var errors = {
|
15
|
-
ExportNamedDeclaration: 'Multiple named export declarations; consolidate all named exports into a single export declaration',
|
16
|
-
AssignmentExpression: 'Multiple CommonJS exports; consolidate all exports into a single assignment to `module.exports`' };
|
17
|
-
|
18
|
-
/* eslint-enable max-len */
|
19
|
-
|
20
|
-
/**
|
21
|
-
* Returns an array with names of the properties in the accessor chain for MemberExpression nodes
|
22
|
-
*
|
23
|
-
* Example:
|
24
|
-
*
|
25
|
-
* `module.exports = {}` => ['module', 'exports']
|
26
|
-
* `module.exports.property = true` => ['module', 'exports', 'property']
|
27
|
-
*
|
28
|
-
* @param {Node} node AST Node (MemberExpression)
|
29
|
-
* @return {Array} Array with the property names in the chain
|
30
|
-
* @private
|
31
|
-
*/
|
32
|
-
function accessorChain(node) {
|
33
|
-
var chain = [];
|
34
|
-
|
35
|
-
do {
|
36
|
-
chain.unshift(node.property.name);
|
37
|
-
|
38
|
-
if (node.object.type === 'Identifier') {
|
39
|
-
chain.unshift(node.object.name);
|
40
|
-
break;
|
41
|
-
}
|
42
|
-
|
43
|
-
node = node.object;
|
44
|
-
} while (node.type === 'MemberExpression');
|
45
|
-
|
46
|
-
return chain;
|
47
|
-
}
|
48
|
-
|
49
|
-
function create(context) {
|
50
|
-
var nodes = {
|
51
|
-
modules: {
|
52
|
-
set: new Set(),
|
53
|
-
sources: {} },
|
54
|
-
|
55
|
-
types: {
|
56
|
-
set: new Set(),
|
57
|
-
sources: {} },
|
58
|
-
|
59
|
-
commonjs: {
|
60
|
-
set: new Set() } };
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
return {
|
65
|
-
ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) {
|
66
|
-
var target = node.exportKind === 'type' ? nodes.types : nodes.modules;
|
67
|
-
if (!node.source) {
|
68
|
-
target.set.add(node);
|
69
|
-
} else if (Array.isArray(target.sources[node.source.value])) {
|
70
|
-
target.sources[node.source.value].push(node);
|
71
|
-
} else {
|
72
|
-
target.sources[node.source.value] = [node];
|
73
|
-
}
|
74
|
-
}return ExportNamedDeclaration;}(),
|
75
|
-
|
76
|
-
AssignmentExpression: function () {function AssignmentExpression(node) {
|
77
|
-
if (node.left.type !== 'MemberExpression') {
|
78
|
-
return;
|
79
|
-
}
|
80
|
-
|
81
|
-
var chain = accessorChain(node.left);
|
82
|
-
|
83
|
-
// Assignments to module.exports
|
84
|
-
// Deeper assignments are ignored since they just modify what's already being exported
|
85
|
-
// (ie. module.exports.exported.prop = true is ignored)
|
86
|
-
if (chain[0] === 'module' && chain[1] === 'exports' && chain.length <= 3) {
|
87
|
-
nodes.commonjs.set.add(node);
|
88
|
-
return;
|
89
|
-
}
|
90
|
-
|
91
|
-
// Assignments to exports (exports.* = *)
|
92
|
-
if (chain[0] === 'exports' && chain.length === 2) {
|
93
|
-
nodes.commonjs.set.add(node);
|
94
|
-
return;
|
95
|
-
}
|
96
|
-
}return AssignmentExpression;}(),
|
97
|
-
|
98
|
-
'Program:exit': function () {function onExit() {
|
99
|
-
// Report multiple `export` declarations (ES2015 modules)
|
100
|
-
if (nodes.modules.set.size > 1) {
|
101
|
-
nodes.modules.set.forEach(function (node) {
|
102
|
-
context.report({
|
103
|
-
node: node,
|
104
|
-
message: errors[node.type] });
|
105
|
-
|
106
|
-
});
|
107
|
-
}
|
108
|
-
|
109
|
-
// Report multiple `aggregated exports` from the same module (ES2015 modules)
|
110
|
-
(0, _arrayPrototype2['default'])((0, _object2['default'])(nodes.modules.sources).
|
111
|
-
filter(function (nodesWithSource) {return Array.isArray(nodesWithSource) && nodesWithSource.length > 1;})).
|
112
|
-
forEach(function (node) {
|
113
|
-
context.report({
|
114
|
-
node: node,
|
115
|
-
message: errors[node.type] });
|
116
|
-
|
117
|
-
});
|
118
|
-
|
119
|
-
// Report multiple `export type` declarations (FLOW ES2015 modules)
|
120
|
-
if (nodes.types.set.size > 1) {
|
121
|
-
nodes.types.set.forEach(function (node) {
|
122
|
-
context.report({
|
123
|
-
node: node,
|
124
|
-
message: errors[node.type] });
|
125
|
-
|
126
|
-
});
|
127
|
-
}
|
128
|
-
|
129
|
-
// Report multiple `aggregated type exports` from the same module (FLOW ES2015 modules)
|
130
|
-
(0, _arrayPrototype2['default'])((0, _object2['default'])(nodes.types.sources).
|
131
|
-
filter(function (nodesWithSource) {return Array.isArray(nodesWithSource) && nodesWithSource.length > 1;})).
|
132
|
-
forEach(function (node) {
|
133
|
-
context.report({
|
134
|
-
node: node,
|
135
|
-
message: errors[node.type] });
|
136
|
-
|
137
|
-
});
|
138
|
-
|
139
|
-
// Report multiple `module.exports` assignments (CommonJS)
|
140
|
-
if (nodes.commonjs.set.size > 1) {
|
141
|
-
nodes.commonjs.set.forEach(function (node) {
|
142
|
-
context.report({
|
143
|
-
node: node,
|
144
|
-
message: errors[node.type] });
|
145
|
-
|
146
|
-
});
|
147
|
-
}
|
148
|
-
}return onExit;}() };
|
149
|
-
|
150
|
-
}
|
151
|
-
|
152
|
-
module.exports = {
|
153
|
-
me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Q==
|
@@ -1,16 +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
|
-
var first = require('./first');
|
4
|
-
|
5
|
-
var newMeta = Object.assign({},
|
6
|
-
first.meta, {
|
7
|
-
deprecated: true,
|
8
|
-
docs: {
|
9
|
-
category: 'Style guide',
|
10
|
-
description: 'Replaced by `import/first`.',
|
11
|
-
url: (0, _docsUrl2['default'])('imports-first', '7b25c1cb95ee18acc1531002fd343e1e6031f9ed') } });
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
module.exports = Object.assign({}, first, { meta: newMeta });
|
16
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9pbXBvcnRzLWZpcnN0LmpzIl0sIm5hbWVzIjpbImZpcnN0IiwicmVxdWlyZSIsIm5ld01ldGEiLCJtZXRhIiwiZGVwcmVjYXRlZCIsImRvY3MiLCJjYXRlZ29yeSIsImRlc2NyaXB0aW9uIiwidXJsIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6ImFBQUEscUM7O0FBRUEsSUFBTUEsUUFBUUMsUUFBUSxTQUFSLENBQWQ7O0FBRUEsSUFBTUM7QUFDREYsTUFBTUcsSUFETDtBQUVKQyxjQUFZLElBRlI7QUFHSkMsUUFBTTtBQUNKQyxjQUFVLGFBRE47QUFFSkMsaUJBQWEsNkJBRlQ7QUFHSkMsU0FBSywwQkFBUSxlQUFSLEVBQXlCLDBDQUF6QixDQUhELEVBSEYsR0FBTjs7OztBQVVBQyxPQUFPQyxPQUFQLHFCQUFzQlYsS0FBdEIsSUFBNkJHLE1BQU1ELE9BQW5DIiwiZmlsZSI6ImltcG9ydHMtZmlyc3QuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgZG9jc1VybCBmcm9tICcuLi9kb2NzVXJsJztcblxuY29uc3QgZmlyc3QgPSByZXF1aXJlKCcuL2ZpcnN0Jyk7XG5cbmNvbnN0IG5ld01ldGEgPSB7XG4gIC4uLmZpcnN0Lm1ldGEsXG4gIGRlcHJlY2F0ZWQ6IHRydWUsXG4gIGRvY3M6IHtcbiAgICBjYXRlZ29yeTogJ1N0eWxlIGd1aWRlJyxcbiAgICBkZXNjcmlwdGlvbjogJ1JlcGxhY2VkIGJ5IGBpbXBvcnQvZmlyc3RgLicsXG4gICAgdXJsOiBkb2NzVXJsKCdpbXBvcnRzLWZpcnN0JywgJzdiMjVjMWNiOTVlZTE4YWNjMTUzMTAwMmZkMzQzZTFlNjAzMWY5ZWQnKSxcbiAgfSxcbn07XG5cbm1vZHVsZS5leHBvcnRzID0geyAuLi5maXJzdCwgbWV0YTogbmV3TWV0YSB9O1xuIl19
|
@@ -1,60 +0,0 @@
|
|
1
|
-
'use strict';var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor);
|
2
|
-
var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
|
3
|
-
|
4
|
-
var DEFAULT_MAX = 10;
|
5
|
-
var DEFAULT_IGNORE_TYPE_IMPORTS = false;
|
6
|
-
var TYPE_IMPORT = 'type';
|
7
|
-
|
8
|
-
var countDependencies = function countDependencies(dependencies, lastNode, context) {var _ref =
|
9
|
-
context.options[0] || { max: DEFAULT_MAX },max = _ref.max;
|
10
|
-
|
11
|
-
if (dependencies.size > max) {
|
12
|
-
context.report(lastNode, 'Maximum number of dependencies (' + String(max) + ') exceeded.');
|
13
|
-
}
|
14
|
-
};
|
15
|
-
|
16
|
-
module.exports = {
|
17
|
-
meta: {
|
18
|
-
type: 'suggestion',
|
19
|
-
docs: {
|
20
|
-
category: 'Style guide',
|
21
|
-
description: 'Enforce the maximum number of dependencies a module can have.',
|
22
|
-
url: (0, _docsUrl2['default'])('max-dependencies') },
|
23
|
-
|
24
|
-
|
25
|
-
schema: [
|
26
|
-
{
|
27
|
-
type: 'object',
|
28
|
-
properties: {
|
29
|
-
max: { type: 'number' },
|
30
|
-
ignoreTypeImports: { type: 'boolean' } },
|
31
|
-
|
32
|
-
additionalProperties: false }] },
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
create: function () {function create(context) {var _ref2 =
|
38
|
-
|
39
|
-
|
40
|
-
context.options[0] || {},_ref2$ignoreTypeImpor = _ref2.ignoreTypeImports,ignoreTypeImports = _ref2$ignoreTypeImpor === undefined ? DEFAULT_IGNORE_TYPE_IMPORTS : _ref2$ignoreTypeImpor;
|
41
|
-
|
42
|
-
var dependencies = new Set(); // keep track of dependencies
|
43
|
-
var lastNode = void 0; // keep track of the last node to report on
|
44
|
-
|
45
|
-
return Object.assign({
|
46
|
-
'Program:exit': function () {function ProgramExit() {
|
47
|
-
countDependencies(dependencies, lastNode, context);
|
48
|
-
}return ProgramExit;}() },
|
49
|
-
(0, _moduleVisitor2['default'])(
|
50
|
-
function (source, _ref3) {var importKind = _ref3.importKind;
|
51
|
-
if (importKind !== TYPE_IMPORT || !ignoreTypeImports) {
|
52
|
-
dependencies.add(source.value);
|
53
|
-
}
|
54
|
-
lastNode = source;
|
55
|
-
},
|
56
|
-
{ commonjs: true }));
|
57
|
-
|
58
|
-
|
59
|
-
}return create;}() };
|
60
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9tYXgtZGVwZW5kZW5jaWVzLmpzIl0sIm5hbWVzIjpbIkRFRkFVTFRfTUFYIiwiREVGQVVMVF9JR05PUkVfVFlQRV9JTVBPUlRTIiwiVFlQRV9JTVBPUlQiLCJjb3VudERlcGVuZGVuY2llcyIsImRlcGVuZGVuY2llc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