eslint-plugin-ts-exports
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -32,20 +32,19 @@ "use strict"; | ||
.configFilePath; | ||
const analysis = ts_unused_exports_1.default(config); | ||
return { | ||
Program: (node) => { | ||
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); | ||
const analysis = ts_unused_exports_1.default(config, [tsNode.fileName]); | ||
const files = Object.values(analysis); | ||
files.forEach((file) => { | ||
file.forEach(({ exportName, location }) => { | ||
if (location) { | ||
context.report({ | ||
messageId: "UnusedExportsMessage", | ||
loc: { line: location.line, column: location.character }, | ||
data: { | ||
name: exportName, | ||
}, | ||
}); | ||
} | ||
const { fileName } = tsNode; | ||
const errors = analysis[fileName]; | ||
if (errors) { | ||
errors.forEach(({ exportName, location }) => { | ||
context.report({ | ||
messageId: "UnusedExportsMessage", | ||
loc: { line: location.line, column: location.character }, | ||
data: { | ||
name: exportName, | ||
}, | ||
}); | ||
}); | ||
}); | ||
} | ||
}, | ||
@@ -52,0 +51,0 @@ }; |
{ | ||
"name": "eslint-plugin-ts-exports", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
4445
70