|
| 1 | +diff --git a/lib/importDeclaration.js b/lib/importDeclaration.js |
| 2 | +index afb4de779034cfea080825a5f4320661c48bee32..f10b0a11a39577fbd42569e6b0e768255c1ef276 100644 |
| 3 | +--- a/lib/importDeclaration.js |
| 4 | ++++ b/lib/importDeclaration.js |
| 5 | +@@ -1,5 +1,5 @@ |
| 6 | +-"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = importDeclaration;function importDeclaration(context) { |
| 7 | +- var ancestors = context.getAncestors(); |
| 8 | ++"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = importDeclaration;function importDeclaration(context, node) { |
| 9 | ++ var ancestors = context.getSourceCode().getAncestors(node); |
| 10 | + return ancestors[ancestors.length - 1]; |
| 11 | + } |
| 12 | + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbXBvcnREZWNsYXJhdGlvbi5qcyJdLCJuYW1lcyI6WyJpbXBvcnREZWNsYXJhdGlvbiIsImNvbnRleHQiLCJhbmNlc3RvcnMiLCJnZXRBbmNlc3RvcnMiLCJsZW5ndGgiXSwibWFwcGluZ3MiOiJnR0FBd0JBLGlCLENBQVQsU0FBU0EsaUJBQVQsQ0FBMkJDLE9BQTNCLEVBQW9DO0FBQ2pELE1BQU1DLFlBQVlELFFBQVFFLFlBQVIsRUFBbEI7QUFDQSxTQUFPRCxVQUFVQSxVQUFVRSxNQUFWLEdBQW1CLENBQTdCLENBQVA7QUFDRCIsImZpbGUiOiJpbXBvcnREZWNsYXJhdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGltcG9ydERlY2xhcmF0aW9uKGNvbnRleHQpIHtcbiAgY29uc3QgYW5jZXN0b3JzID0gY29udGV4dC5nZXRBbmNlc3RvcnMoKTtcbiAgcmV0dXJuIGFuY2VzdG9yc1thbmNlc3RvcnMubGVuZ3RoIC0gMV07XG59XG4iXX0= |
| 13 | +\ No newline at end of file |
| 14 | +diff --git a/lib/rules/first.js b/lib/rules/first.js |
| 15 | +index a77168660cf32c8c3e96f3ff4b8240a36d7de3a6..c0e00d75f9989916057fef3999eeee8d21820292 100644 |
| 16 | +--- a/lib/rules/first.js |
| 17 | ++++ b/lib/rules/first.js |
| 18 | +@@ -66,7 +66,7 @@ module.exports = { |
| 19 | + } |
| 20 | + } |
| 21 | + if (nonImportCount > 0) {var _iteratorNormalCompletion = true;var _didIteratorError = false;var _iteratorError = undefined;try { |
| 22 | +- for (var _iterator = context.getDeclaredVariables(node)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var variable = _step.value; |
| 23 | ++ for (var _iterator = sourceCode.getDeclaredVariables(node)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {var variable = _step.value; |
| 24 | + if (!shouldSort) {break;} |
| 25 | + var references = variable.references; |
| 26 | + if (references.length) {var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { |
| 27 | +diff --git a/lib/rules/namespace.js b/lib/rules/namespace.js |
| 28 | +index 574d89a60d15c7e0e712956ea6a3ad2d0eac7f08..82e7cb3cff4246592d762cce86323f2b72de92e4 100644 |
| 29 | +--- a/lib/rules/namespace.js |
| 30 | ++++ b/lib/rules/namespace.js |
| 31 | +@@ -86,7 +86,7 @@ module.exports = { |
| 32 | + |
| 33 | + // same as above, but does not add names to local map |
| 34 | + ExportNamespaceSpecifier: function () {function ExportNamespaceSpecifier(namespace) { |
| 35 | +- var declaration = (0, _importDeclaration2['default'])(context); |
| 36 | ++ var declaration = (0, _importDeclaration2['default'])(context, namespace); |
| 37 | + |
| 38 | + var imports = _ExportMap2['default'].get(declaration.source.value, context); |
| 39 | + if (imports == null) {return null;} |
| 40 | +diff --git a/lib/rules/newline-after-import.js b/lib/rules/newline-after-import.js |
| 41 | +index 6cc15686464a17803a0b976c35b99627cdbfabee..520eec6d9a375527ab72c459960fe4416c046c17 100644 |
| 42 | +--- a/lib/rules/newline-after-import.js |
| 43 | ++++ b/lib/rules/newline-after-import.js |
| 44 | +@@ -194,7 +194,7 @@ module.exports = { |
| 45 | + }return CallExpression;}(), |
| 46 | + 'Program:exit': function () {function ProgramExit() { |
| 47 | + log('exit processing for', context.getPhysicalFilename ? context.getPhysicalFilename() : context.getFilename()); |
| 48 | +- var scopeBody = getScopeBody(context.getScope()); |
| 49 | ++ var scopeBody = getScopeBody(context.getSourceCode().getScope(node)); |
| 50 | + log('got scope:', scopeBody); |
| 51 | + |
| 52 | + requireCalls.forEach(function (node, index) { |
| 53 | +diff --git a/lib/rules/no-amd.js b/lib/rules/no-amd.js |
| 54 | +index 7ac108bf812ca4f78bfa6fe5ae8b9cf38e2ff497..346c3105dc70f72c4d76fcc6b96b946d1d4ec6d5 100644 |
| 55 | +--- a/lib/rules/no-amd.js |
| 56 | ++++ b/lib/rules/no-amd.js |
| 57 | +@@ -23,7 +23,7 @@ module.exports = { |
| 58 | + create: function () {function create(context) { |
| 59 | + return { |
| 60 | + CallExpression: function () {function CallExpression(node) { |
| 61 | +- if (context.getScope().type !== 'module') {return;} |
| 62 | ++ if (context.getSourceCode().getScope(node).type !== 'module') {return;} |
| 63 | + |
| 64 | + if (node.callee.type !== 'Identifier') {return;} |
| 65 | + if (node.callee.name !== 'require' && node.callee.name !== 'define') {return;} |
| 66 | +diff --git a/lib/rules/no-commonjs.js b/lib/rules/no-commonjs.js |
| 67 | +index befeff0026d61d3ac1e6bbcea29f5c471dc1d353..e91c5ed34e968d5867e884ea800e166cda345aef 100644 |
| 68 | +--- a/lib/rules/no-commonjs.js |
| 69 | ++++ b/lib/rules/no-commonjs.js |
| 70 | +@@ -107,7 +107,7 @@ module.exports = { |
| 71 | + |
| 72 | + // exports. |
| 73 | + if (node.object.name === 'exports') { |
| 74 | +- var isInScope = context.getScope(). |
| 75 | ++ var isInScope = context.getSourceCode().getScope(node). |
| 76 | + variables. |
| 77 | + some(function (variable) {return variable.name === 'exports';}); |
| 78 | + if (!isInScope) { |
| 79 | +@@ -117,7 +117,7 @@ module.exports = { |
| 80 | + |
| 81 | + }return MemberExpression;}(), |
| 82 | + CallExpression: function () {function CallExpression(call) { |
| 83 | +- if (!validateScope(context.getScope())) {return;} |
| 84 | ++ if (!validateScope(context.getSourceCode().getScope(call))) {return;} |
| 85 | + |
| 86 | + if (call.callee.type !== 'Identifier') {return;} |
| 87 | + if (call.callee.name !== 'require') {return;} |
| 88 | +diff --git a/lib/rules/no-mutable-exports.js b/lib/rules/no-mutable-exports.js |
| 89 | +index 40bd1b4cfa95d41732bb13bba0ed1969a91cc7ff..8a25abfbfadb299204b36a6cbf283259bcc2e790 100644 |
| 90 | +--- a/lib/rules/no-mutable-exports.js |
| 91 | ++++ b/lib/rules/no-mutable-exports.js |
| 92 | +@@ -32,7 +32,7 @@ module.exports = { |
| 93 | + } |
| 94 | + |
| 95 | + function handleExportDefault(node) { |
| 96 | +- var scope = context.getScope(); |
| 97 | ++ var scope = context.getSourceCode().getScope(node); |
| 98 | + |
| 99 | + if (node.declaration.name) { |
| 100 | + checkDeclarationsInScope(scope, node.declaration.name); |
| 101 | +@@ -40,7 +40,7 @@ module.exports = { |
| 102 | + } |
| 103 | + |
| 104 | + function handleExportNamed(node) { |
| 105 | +- var scope = context.getScope(); |
| 106 | ++ var scope = context.getSourceCode().getScope(node); |
| 107 | + |
| 108 | + if (node.declaration) { |
| 109 | + checkDeclaration(node.declaration); |
| 110 | +diff --git a/lib/rules/no-named-as-default-member.js b/lib/rules/no-named-as-default-member.js |
| 111 | +index 0c15051e027ad7d1d45f1b51c20be1c000b0af01..5b3d6ba415511b7f9f83a52e1acfebe5a1045a7b 100644 |
| 112 | +--- a/lib/rules/no-named-as-default-member.js |
| 113 | ++++ b/lib/rules/no-named-as-default-member.js |
| 114 | +@@ -35,7 +35,7 @@ module.exports = { |
| 115 | + |
| 116 | + return { |
| 117 | + ImportDefaultSpecifier: function () {function ImportDefaultSpecifier(node) { |
| 118 | +- var declaration = (0, _importDeclaration2['default'])(context); |
| 119 | ++ var declaration = (0, _importDeclaration2['default'])(context, node); |
| 120 | + var exportMap = _ExportMap2['default'].get(declaration.source.value, context); |
| 121 | + if (exportMap == null) {return;} |
| 122 | + |
| 123 | +diff --git a/lib/rules/no-named-as-default.js b/lib/rules/no-named-as-default.js |
| 124 | +index 63378a33a1c7da004c57a524cec1a1cddf23e210..c81b1f93b11628676158b79f1c4015911943cc7d 100644 |
| 125 | +--- a/lib/rules/no-named-as-default.js |
| 126 | ++++ b/lib/rules/no-named-as-default.js |
| 127 | +@@ -18,7 +18,7 @@ module.exports = { |
| 128 | + // #566: default is a valid specifier |
| 129 | + if (defaultSpecifier[nameKey].name === 'default') {return;} |
| 130 | + |
| 131 | +- var declaration = (0, _importDeclaration2['default'])(context); |
| 132 | ++ var declaration = (0, _importDeclaration2['default'])(context, defaultSpecifier); |
| 133 | + |
| 134 | + var imports = _ExportMap2['default'].get(declaration.source.value, context); |
| 135 | + if (imports == null) {return;} |
| 136 | +diff --git a/lib/rules/no-namespace.js b/lib/rules/no-namespace.js |
| 137 | +index 2b0c783adea788101b779b17f977bbcb582cfd3f..a7f7b202ac7c4a342febef2a993586c4cc84fc7a 100644 |
| 138 | +--- a/lib/rules/no-namespace.js |
| 139 | ++++ b/lib/rules/no-namespace.js |
| 140 | +@@ -43,7 +43,7 @@ var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_doc |
| 141 | + return; |
| 142 | + } |
| 143 | + |
| 144 | +- var scopeVariables = context.getScope().variables; |
| 145 | ++ var scopeVariables = context.getSourceCode().getScope(node).variables; |
| 146 | + var namespaceVariable = scopeVariables.find(function (variable) {return variable.defs[0].node === node;}); |
| 147 | + var namespaceReferences = namespaceVariable.references; |
| 148 | + var namespaceIdentifiers = namespaceReferences.map(function (reference) {return reference.identifier;}); |
| 149 | +diff --git a/package.json b/package.json |
| 150 | +index 5c0af48543483a21791fa23a4a583071d3551772..5deeac3d0accc3878ef0fc93dfb52a8ca7c46e84 100644 |
| 151 | +--- a/package.json |
| 152 | ++++ b/package.json |
| 153 | +@@ -72,7 +72,7 @@ |
| 154 | + "chai": "^4.3.10", |
| 155 | + "cross-env": "^4.0.0", |
| 156 | + "escope": "^3.6.0", |
| 157 | +- "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8", |
| 158 | ++ "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9", |
| 159 | + "eslint-doc-generator": "^1.6.1", |
| 160 | + "eslint-import-resolver-node": "file:./resolvers/node", |
| 161 | + "eslint-import-resolver-typescript": "^1.0.2 || ^1.1.1", |
0 commit comments