no-unused-modules.js 106 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  1. 'use strict';var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};
  2. var _ignore = require('eslint-module-utils/ignore');
  3. var _resolve = require('eslint-module-utils/resolve');var _resolve2 = _interopRequireDefault(_resolve);
  4. var _visit = require('eslint-module-utils/visit');var _visit2 = _interopRequireDefault(_visit);
  5. var _path = require('path');
  6. var _readPkgUp2 = require('eslint-module-utils/readPkgUp');var _readPkgUp3 = _interopRequireDefault(_readPkgUp2);
  7. var _object = require('object.values');var _object2 = _interopRequireDefault(_object);
  8. var _arrayIncludes = require('array-includes');var _arrayIncludes2 = _interopRequireDefault(_arrayIncludes);
  9. var _arrayPrototype = require('array.prototype.flatmap');var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);
  10. var _ExportMap = require('../ExportMap');var _ExportMap2 = _interopRequireDefault(_ExportMap);
  11. var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _toConsumableArray(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {arr2[i] = arr[i];}return arr2;} else {return Array.from(arr);}} /**
  12. * @fileOverview Ensures that modules contain exports and/or all
  13. * modules are consumed within other modules.
  14. * @author René Fermann
  15. */var FileEnumerator = void 0;var listFilesToProcess = void 0;
  16. try {var _require =
  17. require('eslint/use-at-your-own-risk');FileEnumerator = _require.FileEnumerator;
  18. } catch (e) {
  19. try {var _require2 =
  20. require('eslint/lib/cli-engine/file-enumerator'); // has been moved to eslint/lib/cli-engine/file-enumerator in version 6
  21. FileEnumerator = _require2.FileEnumerator;} catch (e) {
  22. try {
  23. // eslint/lib/util/glob-util has been moved to eslint/lib/util/glob-utils with version 5.3
  24. var _require3 = require('eslint/lib/util/glob-utils'),originalListFilesToProcess = _require3.listFilesToProcess;
  25. // Prevent passing invalid options (extensions array) to old versions of the function.
  26. // https://github.com/eslint/eslint/blob/v5.16.0/lib/util/glob-utils.js#L178-L280
  27. // https://github.com/eslint/eslint/blob/v5.2.0/lib/util/glob-util.js#L174-L269
  28. listFilesToProcess = function listFilesToProcess(src, extensions) {
  29. return originalListFilesToProcess(src, {
  30. extensions: extensions });
  31. };
  32. } catch (e) {var _require4 =
  33. require('eslint/lib/util/glob-util'),_originalListFilesToProcess = _require4.listFilesToProcess;
  34. listFilesToProcess = function listFilesToProcess(src, extensions) {
  35. var patterns = src.concat((0, _arrayPrototype2['default'])(src, function (pattern) {return extensions.map(function (extension) {return (/\*\*|\*\./.test(pattern) ? pattern : String(pattern) + '/**/*' + String(extension));});}));
  36. return _originalListFilesToProcess(patterns);
  37. };
  38. }
  39. }
  40. }
  41. if (FileEnumerator) {
  42. listFilesToProcess = function listFilesToProcess(src, extensions) {
  43. var e = new FileEnumerator({
  44. extensions: extensions });
  45. return Array.from(e.iterateFiles(src), function (_ref) {var filePath = _ref.filePath,ignored = _ref.ignored;return {
  46. ignored: ignored,
  47. filename: filePath };});
  48. };
  49. }
  50. var EXPORT_DEFAULT_DECLARATION = 'ExportDefaultDeclaration';
  51. var EXPORT_NAMED_DECLARATION = 'ExportNamedDeclaration';
  52. var EXPORT_ALL_DECLARATION = 'ExportAllDeclaration';
  53. var IMPORT_DECLARATION = 'ImportDeclaration';
  54. var IMPORT_NAMESPACE_SPECIFIER = 'ImportNamespaceSpecifier';
  55. var IMPORT_DEFAULT_SPECIFIER = 'ImportDefaultSpecifier';
  56. var VARIABLE_DECLARATION = 'VariableDeclaration';
  57. var FUNCTION_DECLARATION = 'FunctionDeclaration';
  58. var CLASS_DECLARATION = 'ClassDeclaration';
  59. var IDENTIFIER = 'Identifier';
  60. var OBJECT_PATTERN = 'ObjectPattern';
  61. var TS_INTERFACE_DECLARATION = 'TSInterfaceDeclaration';
  62. var TS_TYPE_ALIAS_DECLARATION = 'TSTypeAliasDeclaration';
  63. var TS_ENUM_DECLARATION = 'TSEnumDeclaration';
  64. var DEFAULT = 'default';
  65. function forEachDeclarationIdentifier(declaration, cb) {
  66. if (declaration) {
  67. if (
  68. declaration.type === FUNCTION_DECLARATION ||
  69. declaration.type === CLASS_DECLARATION ||
  70. declaration.type === TS_INTERFACE_DECLARATION ||
  71. declaration.type === TS_TYPE_ALIAS_DECLARATION ||
  72. declaration.type === TS_ENUM_DECLARATION)
  73. {
  74. cb(declaration.id.name);
  75. } else if (declaration.type === VARIABLE_DECLARATION) {
  76. declaration.declarations.forEach(function (_ref2) {var id = _ref2.id;
  77. if (id.type === OBJECT_PATTERN) {
  78. (0, _ExportMap.recursivePatternCapture)(id, function (pattern) {
  79. if (pattern.type === IDENTIFIER) {
  80. cb(pattern.name);
  81. }
  82. });
  83. } else {
  84. cb(id.name);
  85. }
  86. });
  87. }
  88. }
  89. }
  90. /**
  91. * List of imports per file.
  92. *
  93. * Represented by a two-level Map to a Set of identifiers. The upper-level Map
  94. * keys are the paths to the modules containing the imports, while the
  95. * lower-level Map keys are the paths to the files which are being imported
  96. * from. Lastly, the Set of identifiers contains either names being imported
  97. * or a special AST node name listed above (e.g ImportDefaultSpecifier).
  98. *
  99. * For example, if we have a file named foo.js containing:
  100. *
  101. * import { o2 } from './bar.js';
  102. *
  103. * Then we will have a structure that looks like:
  104. *
  105. * Map { 'foo.js' => Map { 'bar.js' => Set { 'o2' } } }
  106. *
  107. * @type {Map<string, Map<string, Set<string>>>}
  108. */
  109. var importList = new Map();
  110. /**
  111. * List of exports per file.
  112. *
  113. * Represented by a two-level Map to an object of metadata. The upper-level Map
  114. * keys are the paths to the modules containing the exports, while the
  115. * lower-level Map keys are the specific identifiers or special AST node names
  116. * being exported. The leaf-level metadata object at the moment only contains a
  117. * `whereUsed` property, which contains a Set of paths to modules that import
  118. * the name.
  119. *
  120. * For example, if we have a file named bar.js containing the following exports:
  121. *
  122. * const o2 = 'bar';
  123. * export { o2 };
  124. *
  125. * And a file named foo.js containing the following import:
  126. *
  127. * import { o2 } from './bar.js';
  128. *
  129. * Then we will have a structure that looks like:
  130. *
  131. * Map { 'bar.js' => Map { 'o2' => { whereUsed: Set { 'foo.js' } } } }
  132. *
  133. * @type {Map<string, Map<string, object>>}
  134. */
  135. var exportList = new Map();
  136. var visitorKeyMap = new Map();
  137. var ignoredFiles = new Set();
  138. var filesOutsideSrc = new Set();
  139. var isNodeModule = function isNodeModule(path) {return (/\/(node_modules)\//.test(path));};
  140. /**
  141. * read all files matching the patterns in src and ignoreExports
  142. *
  143. * return all files matching src pattern, which are not matching the ignoreExports pattern
  144. */
  145. var resolveFiles = function resolveFiles(src, ignoreExports, context) {
  146. var extensions = Array.from((0, _ignore.getFileExtensions)(context.settings));
  147. var srcFileList = listFilesToProcess(src, extensions);
  148. // prepare list of ignored files
  149. var ignoredFilesList = listFilesToProcess(ignoreExports, extensions);
  150. ignoredFilesList.forEach(function (_ref3) {var filename = _ref3.filename;return ignoredFiles.add(filename);});
  151. // prepare list of source files, don't consider files from node_modules
  152. return new Set(
  153. (0, _arrayPrototype2['default'])(srcFileList, function (_ref4) {var filename = _ref4.filename;return isNodeModule(filename) ? [] : filename;}));
  154. };
  155. /**
  156. * parse all source files and build up 2 maps containing the existing imports and exports
  157. */
  158. var prepareImportsAndExports = function prepareImportsAndExports(srcFiles, context) {
  159. var exportAll = new Map();
  160. srcFiles.forEach(function (file) {
  161. var exports = new Map();
  162. var imports = new Map();
  163. var currentExports = _ExportMap2['default'].get(file, context);
  164. if (currentExports) {var
  165. dependencies =
  166. currentExports.dependencies,reexports = currentExports.reexports,localImportList = currentExports.imports,namespace = currentExports.namespace,visitorKeys = currentExports.visitorKeys;
  167. visitorKeyMap.set(file, visitorKeys);
  168. // dependencies === export * from
  169. var currentExportAll = new Set();
  170. dependencies.forEach(function (getDependency) {
  171. var dependency = getDependency();
  172. if (dependency === null) {
  173. return;
  174. }
  175. currentExportAll.add(dependency.path);
  176. });
  177. exportAll.set(file, currentExportAll);
  178. reexports.forEach(function (value, key) {
  179. if (key === DEFAULT) {
  180. exports.set(IMPORT_DEFAULT_SPECIFIER, { whereUsed: new Set() });
  181. } else {
  182. exports.set(key, { whereUsed: new Set() });
  183. }
  184. var reexport = value.getImport();
  185. if (!reexport) {
  186. return;
  187. }
  188. var localImport = imports.get(reexport.path);
  189. var currentValue = void 0;
  190. if (value.local === DEFAULT) {
  191. currentValue = IMPORT_DEFAULT_SPECIFIER;
  192. } else {
  193. currentValue = value.local;
  194. }
  195. if (typeof localImport !== 'undefined') {
  196. localImport = new Set([].concat(_toConsumableArray(localImport), [currentValue]));
  197. } else {
  198. localImport = new Set([currentValue]);
  199. }
  200. imports.set(reexport.path, localImport);
  201. });
  202. localImportList.forEach(function (value, key) {
  203. if (isNodeModule(key)) {
  204. return;
  205. }
  206. var localImport = imports.get(key) || new Set();
  207. value.declarations.forEach(function (_ref5) {var importedSpecifiers = _ref5.importedSpecifiers;
  208. importedSpecifiers.forEach(function (specifier) {
  209. localImport.add(specifier);
  210. });
  211. });
  212. imports.set(key, localImport);
  213. });
  214. importList.set(file, imports);
  215. // build up export list only, if file is not ignored
  216. if (ignoredFiles.has(file)) {
  217. return;
  218. }
  219. namespace.forEach(function (value, key) {
  220. if (key === DEFAULT) {
  221. exports.set(IMPORT_DEFAULT_SPECIFIER, { whereUsed: new Set() });
  222. } else {
  223. exports.set(key, { whereUsed: new Set() });
  224. }
  225. });
  226. }
  227. exports.set(EXPORT_ALL_DECLARATION, { whereUsed: new Set() });
  228. exports.set(IMPORT_NAMESPACE_SPECIFIER, { whereUsed: new Set() });
  229. exportList.set(file, exports);
  230. });
  231. exportAll.forEach(function (value, key) {
  232. value.forEach(function (val) {
  233. var currentExports = exportList.get(val);
  234. if (currentExports) {
  235. var currentExport = currentExports.get(EXPORT_ALL_DECLARATION);
  236. currentExport.whereUsed.add(key);
  237. }
  238. });
  239. });
  240. };
  241. /**
  242. * traverse through all imports and add the respective path to the whereUsed-list
  243. * of the corresponding export
  244. */
  245. var determineUsage = function determineUsage() {
  246. importList.forEach(function (listValue, listKey) {
  247. listValue.forEach(function (value, key) {
  248. var exports = exportList.get(key);
  249. if (typeof exports !== 'undefined') {
  250. value.forEach(function (currentImport) {
  251. var specifier = void 0;
  252. if (currentImport === IMPORT_NAMESPACE_SPECIFIER) {
  253. specifier = IMPORT_NAMESPACE_SPECIFIER;
  254. } else if (currentImport === IMPORT_DEFAULT_SPECIFIER) {
  255. specifier = IMPORT_DEFAULT_SPECIFIER;
  256. } else {
  257. specifier = currentImport;
  258. }
  259. if (typeof specifier !== 'undefined') {
  260. var exportStatement = exports.get(specifier);
  261. if (typeof exportStatement !== 'undefined') {var
  262. whereUsed = exportStatement.whereUsed;
  263. whereUsed.add(listKey);
  264. exports.set(specifier, { whereUsed: whereUsed });
  265. }
  266. }
  267. });
  268. }
  269. });
  270. });
  271. };
  272. var getSrc = function getSrc(src) {
  273. if (src) {
  274. return src;
  275. }
  276. return [process.cwd()];
  277. };
  278. /**
  279. * prepare the lists of existing imports and exports - should only be executed once at
  280. * the start of a new eslint run
  281. */
  282. var srcFiles = void 0;
  283. var lastPrepareKey = void 0;
  284. var doPreparation = function doPreparation(src, ignoreExports, context) {
  285. var prepareKey = JSON.stringify({
  286. src: (src || []).sort(),
  287. ignoreExports: (ignoreExports || []).sort(),
  288. extensions: Array.from((0, _ignore.getFileExtensions)(context.settings)).sort() });
  289. if (prepareKey === lastPrepareKey) {
  290. return;
  291. }
  292. importList.clear();
  293. exportList.clear();
  294. ignoredFiles.clear();
  295. filesOutsideSrc.clear();
  296. srcFiles = resolveFiles(getSrc(src), ignoreExports, context);
  297. prepareImportsAndExports(srcFiles, context);
  298. determineUsage();
  299. lastPrepareKey = prepareKey;
  300. };
  301. var newNamespaceImportExists = function newNamespaceImportExists(specifiers) {return specifiers.some(function (_ref6) {var type = _ref6.type;return type === IMPORT_NAMESPACE_SPECIFIER;});};
  302. var newDefaultImportExists = function newDefaultImportExists(specifiers) {return specifiers.some(function (_ref7) {var type = _ref7.type;return type === IMPORT_DEFAULT_SPECIFIER;});};
  303. var fileIsInPkg = function fileIsInPkg(file) {var _readPkgUp =
  304. (0, _readPkgUp3['default'])({ cwd: file }),path = _readPkgUp.path,pkg = _readPkgUp.pkg;
  305. var basePath = (0, _path.dirname)(path);
  306. var checkPkgFieldString = function checkPkgFieldString(pkgField) {
  307. if ((0, _path.join)(basePath, pkgField) === file) {
  308. return true;
  309. }
  310. };
  311. var checkPkgFieldObject = function checkPkgFieldObject(pkgField) {
  312. var pkgFieldFiles = (0, _arrayPrototype2['default'])((0, _object2['default'])(pkgField), function (value) {return typeof value === 'boolean' ? [] : (0, _path.join)(basePath, value);});
  313. if ((0, _arrayIncludes2['default'])(pkgFieldFiles, file)) {
  314. return true;
  315. }
  316. };
  317. var checkPkgField = function checkPkgField(pkgField) {
  318. if (typeof pkgField === 'string') {
  319. return checkPkgFieldString(pkgField);
  320. }
  321. if ((typeof pkgField === 'undefined' ? 'undefined' : _typeof(pkgField)) === 'object') {
  322. return checkPkgFieldObject(pkgField);
  323. }
  324. };
  325. if (pkg['private'] === true) {
  326. return false;
  327. }
  328. if (pkg.bin) {
  329. if (checkPkgField(pkg.bin)) {
  330. return true;
  331. }
  332. }
  333. if (pkg.browser) {
  334. if (checkPkgField(pkg.browser)) {
  335. return true;
  336. }
  337. }
  338. if (pkg.main) {
  339. if (checkPkgFieldString(pkg.main)) {
  340. return true;
  341. }
  342. }
  343. return false;
  344. };
  345. module.exports = {
  346. meta: {
  347. type: 'suggestion',
  348. docs: {
  349. category: 'Helpful warnings',
  350. description: 'Forbid modules without exports, or exports without matching import in another module.',
  351. url: (0, _docsUrl2['default'])('no-unused-modules') },
  352. schema: [{
  353. properties: {
  354. src: {
  355. description: 'files/paths to be analyzed (only for unused exports)',
  356. type: 'array',
  357. uniqueItems: true,
  358. items: {
  359. type: 'string',
  360. minLength: 1 } },
  361. ignoreExports: {
  362. description: 'files/paths for which unused exports will not be reported (e.g module entry points)',
  363. type: 'array',
  364. uniqueItems: true,
  365. items: {
  366. type: 'string',
  367. minLength: 1 } },
  368. missingExports: {
  369. description: 'report modules without any exports',
  370. type: 'boolean' },
  371. unusedExports: {
  372. description: 'report exports without any usage',
  373. type: 'boolean' } },
  374. anyOf: [
  375. {
  376. properties: {
  377. unusedExports: { 'enum': [true] },
  378. src: {
  379. minItems: 1 } },
  380. required: ['unusedExports'] },
  381. {
  382. properties: {
  383. missingExports: { 'enum': [true] } },
  384. required: ['missingExports'] }] }] },
  385. create: function () {function create(context) {var _ref8 =
  386. context.options[0] || {},src = _ref8.src,_ref8$ignoreExports = _ref8.ignoreExports,ignoreExports = _ref8$ignoreExports === undefined ? [] : _ref8$ignoreExports,missingExports = _ref8.missingExports,unusedExports = _ref8.unusedExports;
  387. if (unusedExports) {
  388. doPreparation(src, ignoreExports, context);
  389. }
  390. var file = context.getPhysicalFilename ? context.getPhysicalFilename() : context.getFilename();
  391. var checkExportPresence = function () {function checkExportPresence(node) {
  392. if (!missingExports) {
  393. return;
  394. }
  395. if (ignoredFiles.has(file)) {
  396. return;
  397. }
  398. var exportCount = exportList.get(file);
  399. var exportAll = exportCount.get(EXPORT_ALL_DECLARATION);
  400. var namespaceImports = exportCount.get(IMPORT_NAMESPACE_SPECIFIER);
  401. exportCount['delete'](EXPORT_ALL_DECLARATION);
  402. exportCount['delete'](IMPORT_NAMESPACE_SPECIFIER);
  403. if (exportCount.size < 1) {
  404. // node.body[0] === 'undefined' only happens, if everything is commented out in the file
  405. // being linted
  406. context.report(node.body[0] ? node.body[0] : node, 'No exports found');
  407. }
  408. exportCount.set(EXPORT_ALL_DECLARATION, exportAll);
  409. exportCount.set(IMPORT_NAMESPACE_SPECIFIER, namespaceImports);
  410. }return checkExportPresence;}();
  411. var checkUsage = function () {function checkUsage(node, exportedValue) {
  412. if (!unusedExports) {
  413. return;
  414. }
  415. if (ignoredFiles.has(file)) {
  416. return;
  417. }
  418. if (fileIsInPkg(file)) {
  419. return;
  420. }
  421. if (filesOutsideSrc.has(file)) {
  422. return;
  423. }
  424. // make sure file to be linted is included in source files
  425. if (!srcFiles.has(file)) {
  426. srcFiles = resolveFiles(getSrc(src), ignoreExports, context);
  427. if (!srcFiles.has(file)) {
  428. filesOutsideSrc.add(file);
  429. return;
  430. }
  431. }
  432. exports = exportList.get(file);
  433. // special case: export * from
  434. var exportAll = exports.get(EXPORT_ALL_DECLARATION);
  435. if (typeof exportAll !== 'undefined' && exportedValue !== IMPORT_DEFAULT_SPECIFIER) {
  436. if (exportAll.whereUsed.size > 0) {
  437. return;
  438. }
  439. }
  440. // special case: namespace import
  441. var namespaceImports = exports.get(IMPORT_NAMESPACE_SPECIFIER);
  442. if (typeof namespaceImports !== 'undefined') {
  443. if (namespaceImports.whereUsed.size > 0) {
  444. return;
  445. }
  446. }
  447. // exportsList will always map any imported value of 'default' to 'ImportDefaultSpecifier'
  448. var exportsKey = exportedValue === DEFAULT ? IMPORT_DEFAULT_SPECIFIER : exportedValue;
  449. var exportStatement = exports.get(exportsKey);
  450. var value = exportsKey === IMPORT_DEFAULT_SPECIFIER ? DEFAULT : exportsKey;
  451. if (typeof exportStatement !== 'undefined') {
  452. if (exportStatement.whereUsed.size < 1) {
  453. context.report(
  454. node, 'exported declaration \'' +
  455. value + '\' not used within other modules');
  456. }
  457. } else {
  458. context.report(
  459. node, 'exported declaration \'' +
  460. value + '\' not used within other modules');
  461. }
  462. }return checkUsage;}();
  463. /**
  464. * only useful for tools like vscode-eslint
  465. *
  466. * update lists of existing exports during runtime
  467. */
  468. var updateExportUsage = function () {function updateExportUsage(node) {
  469. if (ignoredFiles.has(file)) {
  470. return;
  471. }
  472. var exports = exportList.get(file);
  473. // new module has been created during runtime
  474. // include it in further processing
  475. if (typeof exports === 'undefined') {
  476. exports = new Map();
  477. }
  478. var newExports = new Map();
  479. var newExportIdentifiers = new Set();
  480. node.body.forEach(function (_ref9) {var type = _ref9.type,declaration = _ref9.declaration,specifiers = _ref9.specifiers;
  481. if (type === EXPORT_DEFAULT_DECLARATION) {
  482. newExportIdentifiers.add(IMPORT_DEFAULT_SPECIFIER);
  483. }
  484. if (type === EXPORT_NAMED_DECLARATION) {
  485. if (specifiers.length > 0) {
  486. specifiers.forEach(function (specifier) {
  487. if (specifier.exported) {
  488. newExportIdentifiers.add(specifier.exported.name || specifier.exported.value);
  489. }
  490. });
  491. }
  492. forEachDeclarationIdentifier(declaration, function (name) {
  493. newExportIdentifiers.add(name);
  494. });
  495. }
  496. });
  497. // old exports exist within list of new exports identifiers: add to map of new exports
  498. exports.forEach(function (value, key) {
  499. if (newExportIdentifiers.has(key)) {
  500. newExports.set(key, value);
  501. }
  502. });
  503. // new export identifiers added: add to map of new exports
  504. newExportIdentifiers.forEach(function (key) {
  505. if (!exports.has(key)) {
  506. newExports.set(key, { whereUsed: new Set() });
  507. }
  508. });
  509. // preserve information about namespace imports
  510. var exportAll = exports.get(EXPORT_ALL_DECLARATION);
  511. var namespaceImports = exports.get(IMPORT_NAMESPACE_SPECIFIER);
  512. if (typeof namespaceImports === 'undefined') {
  513. namespaceImports = { whereUsed: new Set() };
  514. }
  515. newExports.set(EXPORT_ALL_DECLARATION, exportAll);
  516. newExports.set(IMPORT_NAMESPACE_SPECIFIER, namespaceImports);
  517. exportList.set(file, newExports);
  518. }return updateExportUsage;}();
  519. /**
  520. * only useful for tools like vscode-eslint
  521. *
  522. * update lists of existing imports during runtime
  523. */
  524. var updateImportUsage = function () {function updateImportUsage(node) {
  525. if (!unusedExports) {
  526. return;
  527. }
  528. var oldImportPaths = importList.get(file);
  529. if (typeof oldImportPaths === 'undefined') {
  530. oldImportPaths = new Map();
  531. }
  532. var oldNamespaceImports = new Set();
  533. var newNamespaceImports = new Set();
  534. var oldExportAll = new Set();
  535. var newExportAll = new Set();
  536. var oldDefaultImports = new Set();
  537. var newDefaultImports = new Set();
  538. var oldImports = new Map();
  539. var newImports = new Map();
  540. oldImportPaths.forEach(function (value, key) {
  541. if (value.has(EXPORT_ALL_DECLARATION)) {
  542. oldExportAll.add(key);
  543. }
  544. if (value.has(IMPORT_NAMESPACE_SPECIFIER)) {
  545. oldNamespaceImports.add(key);
  546. }
  547. if (value.has(IMPORT_DEFAULT_SPECIFIER)) {
  548. oldDefaultImports.add(key);
  549. }
  550. value.forEach(function (val) {
  551. if (
  552. val !== IMPORT_NAMESPACE_SPECIFIER &&
  553. val !== IMPORT_DEFAULT_SPECIFIER)
  554. {
  555. oldImports.set(val, key);
  556. }
  557. });
  558. });
  559. function processDynamicImport(source) {
  560. if (source.type !== 'Literal') {
  561. return null;
  562. }
  563. var p = (0, _resolve2['default'])(source.value, context);
  564. if (p == null) {
  565. return null;
  566. }
  567. newNamespaceImports.add(p);
  568. }
  569. (0, _visit2['default'])(node, visitorKeyMap.get(file), {
  570. ImportExpression: function () {function ImportExpression(child) {
  571. processDynamicImport(child.source);
  572. }return ImportExpression;}(),
  573. CallExpression: function () {function CallExpression(child) {
  574. if (child.callee.type === 'Import') {
  575. processDynamicImport(child.arguments[0]);
  576. }
  577. }return CallExpression;}() });
  578. node.body.forEach(function (astNode) {
  579. var resolvedPath = void 0;
  580. // support for export { value } from 'module'
  581. if (astNode.type === EXPORT_NAMED_DECLARATION) {
  582. if (astNode.source) {
  583. resolvedPath = (0, _resolve2['default'])(astNode.source.raw.replace(/('|")/g, ''), context);
  584. astNode.specifiers.forEach(function (specifier) {
  585. var name = specifier.local.name || specifier.local.value;
  586. if (name === DEFAULT) {
  587. newDefaultImports.add(resolvedPath);
  588. } else {
  589. newImports.set(name, resolvedPath);
  590. }
  591. });
  592. }
  593. }
  594. if (astNode.type === EXPORT_ALL_DECLARATION) {
  595. resolvedPath = (0, _resolve2['default'])(astNode.source.raw.replace(/('|")/g, ''), context);
  596. newExportAll.add(resolvedPath);
  597. }
  598. if (astNode.type === IMPORT_DECLARATION) {
  599. resolvedPath = (0, _resolve2['default'])(astNode.source.raw.replace(/('|")/g, ''), context);
  600. if (!resolvedPath) {
  601. return;
  602. }
  603. if (isNodeModule(resolvedPath)) {
  604. return;
  605. }
  606. if (newNamespaceImportExists(astNode.specifiers)) {
  607. newNamespaceImports.add(resolvedPath);
  608. }
  609. if (newDefaultImportExists(astNode.specifiers)) {
  610. newDefaultImports.add(resolvedPath);
  611. }
  612. astNode.specifiers.
  613. filter(function (specifier) {return specifier.type !== IMPORT_DEFAULT_SPECIFIER && specifier.type !== IMPORT_NAMESPACE_SPECIFIER;}).
  614. forEach(function (specifier) {
  615. newImports.set(specifier.imported.name || specifier.imported.value, resolvedPath);
  616. });
  617. }
  618. });
  619. newExportAll.forEach(function (value) {
  620. if (!oldExportAll.has(value)) {
  621. var imports = oldImportPaths.get(value);
  622. if (typeof imports === 'undefined') {
  623. imports = new Set();
  624. }
  625. imports.add(EXPORT_ALL_DECLARATION);
  626. oldImportPaths.set(value, imports);
  627. var _exports = exportList.get(value);
  628. var currentExport = void 0;
  629. if (typeof _exports !== 'undefined') {
  630. currentExport = _exports.get(EXPORT_ALL_DECLARATION);
  631. } else {
  632. _exports = new Map();
  633. exportList.set(value, _exports);
  634. }
  635. if (typeof currentExport !== 'undefined') {
  636. currentExport.whereUsed.add(file);
  637. } else {
  638. var whereUsed = new Set();
  639. whereUsed.add(file);
  640. _exports.set(EXPORT_ALL_DECLARATION, { whereUsed: whereUsed });
  641. }
  642. }
  643. });
  644. oldExportAll.forEach(function (value) {
  645. if (!newExportAll.has(value)) {
  646. var imports = oldImportPaths.get(value);
  647. imports['delete'](EXPORT_ALL_DECLARATION);
  648. var _exports2 = exportList.get(value);
  649. if (typeof _exports2 !== 'undefined') {
  650. var currentExport = _exports2.get(EXPORT_ALL_DECLARATION);
  651. if (typeof currentExport !== 'undefined') {
  652. currentExport.whereUsed['delete'](file);
  653. }
  654. }
  655. }
  656. });
  657. newDefaultImports.forEach(function (value) {
  658. if (!oldDefaultImports.has(value)) {
  659. var imports = oldImportPaths.get(value);
  660. if (typeof imports === 'undefined') {
  661. imports = new Set();
  662. }
  663. imports.add(IMPORT_DEFAULT_SPECIFIER);
  664. oldImportPaths.set(value, imports);
  665. var _exports3 = exportList.get(value);
  666. var currentExport = void 0;
  667. if (typeof _exports3 !== 'undefined') {
  668. currentExport = _exports3.get(IMPORT_DEFAULT_SPECIFIER);
  669. } else {
  670. _exports3 = new Map();
  671. exportList.set(value, _exports3);
  672. }
  673. if (typeof currentExport !== 'undefined') {
  674. currentExport.whereUsed.add(file);
  675. } else {
  676. var whereUsed = new Set();
  677. whereUsed.add(file);
  678. _exports3.set(IMPORT_DEFAULT_SPECIFIER, { whereUsed: whereUsed });
  679. }
  680. }
  681. });
  682. oldDefaultImports.forEach(function (value) {
  683. if (!newDefaultImports.has(value)) {
  684. var imports = oldImportPaths.get(value);
  685. imports['delete'](IMPORT_DEFAULT_SPECIFIER);
  686. var _exports4 = exportList.get(value);
  687. if (typeof _exports4 !== 'undefined') {
  688. var currentExport = _exports4.get(IMPORT_DEFAULT_SPECIFIER);
  689. if (typeof currentExport !== 'undefined') {
  690. currentExport.whereUsed['delete'](file);
  691. }
  692. }
  693. }
  694. });
  695. newNamespaceImports.forEach(function (value) {
  696. if (!oldNamespaceImports.has(value)) {
  697. var imports = oldImportPaths.get(value);
  698. if (typeof imports === 'undefined') {
  699. imports = new Set();
  700. }
  701. imports.add(IMPORT_NAMESPACE_SPECIFIER);
  702. oldImportPaths.set(value, imports);
  703. var _exports5 = exportList.get(value);
  704. var currentExport = void 0;
  705. if (typeof _exports5 !== 'undefined') {
  706. currentExport = _exports5.get(IMPORT_NAMESPACE_SPECIFIER);
  707. } else {
  708. _exports5 = new Map();
  709. exportList.set(value, _exports5);
  710. }
  711. if (typeof currentExport !== 'undefined') {
  712. currentExport.whereUsed.add(file);
  713. } else {
  714. var whereUsed = new Set();
  715. whereUsed.add(file);
  716. _exports5.set(IMPORT_NAMESPACE_SPECIFIER, { whereUsed: whereUsed });
  717. }
  718. }
  719. });
  720. oldNamespaceImports.forEach(function (value) {
  721. if (!newNamespaceImports.has(value)) {
  722. var imports = oldImportPaths.get(value);
  723. imports['delete'](IMPORT_NAMESPACE_SPECIFIER);
  724. var _exports6 = exportList.get(value);
  725. if (typeof _exports6 !== 'undefined') {
  726. var currentExport = _exports6.get(IMPORT_NAMESPACE_SPECIFIER);
  727. if (typeof currentExport !== 'undefined') {
  728. currentExport.whereUsed['delete'](file);
  729. }
  730. }
  731. }
  732. });
  733. newImports.forEach(function (value, key) {
  734. if (!oldImports.has(key)) {
  735. var imports = oldImportPaths.get(value);
  736. if (typeof imports === 'undefined') {
  737. imports = new Set();
  738. }
  739. imports.add(key);
  740. oldImportPaths.set(value, imports);
  741. var _exports7 = exportList.get(value);
  742. var currentExport = void 0;
  743. if (typeof _exports7 !== 'undefined') {
  744. currentExport = _exports7.get(key);
  745. } else {
  746. _exports7 = new Map();
  747. exportList.set(value, _exports7);
  748. }
  749. if (typeof currentExport !== 'undefined') {
  750. currentExport.whereUsed.add(file);
  751. } else {
  752. var whereUsed = new Set();
  753. whereUsed.add(file);
  754. _exports7.set(key, { whereUsed: whereUsed });
  755. }
  756. }
  757. });
  758. oldImports.forEach(function (value, key) {
  759. if (!newImports.has(key)) {
  760. var imports = oldImportPaths.get(value);
  761. imports['delete'](key);
  762. var _exports8 = exportList.get(value);
  763. if (typeof _exports8 !== 'undefined') {
  764. var currentExport = _exports8.get(key);
  765. if (typeof currentExport !== 'undefined') {
  766. currentExport.whereUsed['delete'](file);
  767. }
  768. }
  769. }
  770. });
  771. }return updateImportUsage;}();
  772. return {
  773. 'Program:exit': function () {function ProgramExit(node) {
  774. updateExportUsage(node);
  775. updateImportUsage(node);
  776. checkExportPresence(node);
  777. }return ProgramExit;}(),
  778. ExportDefaultDeclaration: function () {function ExportDefaultDeclaration(node) {
  779. checkUsage(node, IMPORT_DEFAULT_SPECIFIER);
  780. }return ExportDefaultDeclaration;}(),
  781. ExportNamedDeclaration: function () {function ExportNamedDeclaration(node) {
  782. node.specifiers.forEach(function (specifier) {
  783. checkUsage(specifier, specifier.exported.name || specifier.exported.value);
  784. });
  785. forEachDeclarationIdentifier(node.declaration, function (name) {
  786. checkUsage(node, name);
  787. });
  788. }return ExportNamedDeclaration;}() };
  789. }return create;}() };
  790. //# sourceMappingURL=data:application/json;charset=utf-8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b2xlYW4nLFxuICAgICAgICB9LFxuICAgICAgICB1bnVzZWRFeHBvcnRzOiB7XG4gICAgICAgICAgZGVzY3JpcHRpb246ICdyZXBvcnQgZXhwb3J0cyB3aXRob3V0IGFueSB1c2FnZScsXG4gICAgICAgICAgdHlwZTogJ2Jvb2xlYW4nLFxuICAgICAgICB9LFxuICAgICAgfSxcbiAgICAgIGFueU9mOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICAgICAgICB1bnVzZWRFeHBvcnRzOiB7IGVudW06IFt0cnVlXSB9LFxuICAgICAgICAgICAgc3JjOiB7XG4gICAgICAgICAgICAgIG1pbkl0ZW1zOiAxLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIHJlcXVpcmVkOiBbJ3VudXNlZEV4cG9ydHMnXSxcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIHByb3BlcnRpZXM6IHtcbiAgICAgICAgICAgIG1pc3NpbmdFeHBvcnRzOiB7IGVudW06IFt0cnVlXSB9LFxuICAgICAgICAgIH0sXG4gICAgICAgICAgcmVxdWlyZWQ6IFsnbWlzc2luZ0V4cG9ydHMnXSxcbiAgICAgICAgfSxcbiAgICAgIF0sXG4gICAgfV0sXG4gIH0sXG5cbiAgY3JlYXRlKGNvbnRleHQpIHtcbiAgICBjb25zdCB7XG4gICAgICBzcmMsXG4gICAgICBpZ25vcmVFeHBvcnRzID0gW10sXG4gICAgICBtaXNzaW5nRXhwb3J0cyxcbiAgICAgIHVudXNlZEV4cG9ydHMsXG4gICAgfSA9IGNvbnRleHQub3B0aW9uc1swXSB8fCB7fTtcblxuICAgIGlmICh1bnVzZWRFeHBvcnRzKSB7XG4gICAgICBkb1ByZXBhcmF0aW9uKHNyYywgaWdub3JlRXhwb3J0cywgY29udGV4dCk7XG4gICAgfVxuXG4gICAgY29uc3QgZmlsZSA9IGNvbnRleHQuZ2V0UGh5c2ljYWxGaWxlbmF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tleSkgPT4ge1xuICAgICAgICBpZiAodmFsdWUuaGFzKEVYUE9SVF9BTExfREVDTEFSQVRJT04pKSB7XG4gICAgICAgICAgb2xkRXhwb3J0QWxsLmFkZChrZXkpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2YWx1ZS5oYXMoSU1QT1JUX05BTUVTUEFDRV9TUEVDSUZJRVIpKSB7XG4gICAgICAgICAgb2xkTmFtZXNwYWNlSW1wb3J0cy5hZGQoa2V5KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmFsdWUuaGFzKElNUE9SVF9ERUZBVUxUX1NQRUNJRklFUikpIHtcbiAgICAgICAgICBvbGREZWZhdWx0SW1wb3J0cy5hZGQoa2V5KTtcbiAgICAgICAgfVxuICAgICAgICB2YWx1ZS5mb3JFYWNoKCh2YWwpID0+IHtcbiAgICAgICAgICBpZiAoXG4gICAgICAgICAgICB2YWwgIT09IElNUE9SVF9OQU1FU1BBQ0VfU1BFQ0lGSUVSXG4gICAgICAgICAgICAmJiB2YWwgIT09IElNUE9SVF9ERUZBVUxUX1NQRUNJRklFUlxuICAgICAgICAgICkge1xuICAgICAgICAgICAgb2xkSW1wb3J0cy5zZXQodmFsLCBrZXkpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9KTtcblxuICAgICAgZnVuY3Rpb24gcHJvY2Vzc0R5bmFtaWNJbXBvcnQoc291cmNlKSB7XG4gICAgICAgIGlmIChzb3VyY2UudHlwZSAhPT0gJ0xpdGVyYWwnKSB7XG4gICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgcCA9IHJlc29sdmUoc291cmNlLnZhbHVlLCBjb250ZXh0KTtcbiAgICAgICAgaWYgKHAgPT0gbnVsbCkge1xuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIG5ld05hbWVzcGFjZUltcG9ydHMuYWRkKHApO1xuICAgICAgfVxuXG4gICAgICB2aXNpdChub2R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gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5ld0ltcG9ydHMuc2V0KG5hbWUsIHJlc29sdmVkUGF0aCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChhc3ROb2RlLnR5cGUgPT09IEVYUE9SVF9BTExfREVDTEFSQVRJT04pIHtcbiAgICAgICAgICByZXNvbHZlZFBhdGggPSByZXNvbHZlKGFzdE5vZGUuc291cmNlLnJhdy5yZXBsYWNlKC8oJ3xcIikvZywgJycpLCBjb250ZXh0KTtcbiAgICAgICAgICBuZXdFeHBvcnRBbGwuYWRkKHJlc29sdmVkUGF0aCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYXN0Tm9kZS50eXBlID09PSBJTVBPUlRfREVDTEFSQVRJT04pIHtcbiAgICAgICAgICByZXNvbHZlZFBhdGggPSByZXNvbHZlKGFzdE5vZGUuc291cmNlLnJhdy5yZXBsYWNlKC8oJ3xcIikvZywgJycpLCBjb250ZXh0KTtcbiAgICAgICAgICBpZiAoIXJlc29sdmVkUGF0aCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChpc05vZGVNb2R1bGUocmVzb2x2ZWRQYXRoKSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChuZXdOYW1lc3BhY2VJbXBvcnRFeGlzdHMoYXN0Tm9kZS5zcGVjaWZpZXJzKSkge1xuICAgICAgICAgICAgbmV3TmFtZXNwYWNlSW1wb3J0cy5hZGQocmVzb2x2ZWRQYXRoKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAobmV3RGVmYXVsdEltcG9ydEV4aXN0cyhhc3ROb2RlLnNwZWNpZmllcnMpKSB7XG4gICAgICAgICAgICBuZXdEZWZhdWx0SW1wb3J0cy5hZGQocmVzb2x2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