Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 5d85618

Browse files
committed
fix problem with usage of ESLint plugins - fixes #10
1 parent cb82a7d commit 5d85618

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ function lint(textEditor) {
1313
const filePath = textEditor.getPath();
1414
let report;
1515

16+
// ugly hack to workaround ESLint's lack of a `cwd` option
17+
const defaultCwd = process.cwd();
18+
process.chdir(path.dirname(filePath));
19+
1620
allowUnsafeNewFunction(() => {
1721
report = lintText(textEditor.getText(), {cwd: path.dirname(filePath)});
1822
});
1923

24+
process.chdir(defaultCwd);
25+
2026
const ret = [];
2127

2228
report.results.forEach(result => {

0 commit comments

Comments
 (0)