eslint-plugin-ts-exports
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -12,2 +12,3 @@ "use strict"; | ||
const UnusedExportsMessage = "{{name}} is unused"; | ||
let analysis = null; | ||
exports.default = createRule({ | ||
@@ -33,3 +34,5 @@ name: "js-function-in-worklet", | ||
.configFilePath; | ||
const analysis = ts_unused_exports_1.default(config); | ||
if (!analysis) { | ||
analysis = ts_unused_exports_1.default(config); | ||
} | ||
return { | ||
@@ -39,12 +42,14 @@ Program: (node) => { | ||
const { fileName } = tsNode; | ||
if (!analysis) { | ||
return; | ||
} | ||
const errors = analysis[fileName]; | ||
if (errors) { | ||
errors.forEach(({ exportName, location }) => { | ||
context.report({ | ||
messageId: "UnusedExportsMessage", | ||
loc: { line: location.line, column: location.character }, | ||
data: { | ||
const nodeOrLoc = location | ||
? { loc: { line: location.line, column: location.character } } | ||
: node; | ||
context.report(Object.assign(Object.assign({ messageId: "UnusedExportsMessage" }, nodeOrLoc), { data: { | ||
name: exportName, | ||
}, | ||
}); | ||
} })); | ||
}); | ||
@@ -51,0 +56,0 @@ } |
{ | ||
"name": "eslint-plugin-ts-exports", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4634
75