no-unused-modules.js 98 KB

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