Skip to content

Commit 3833d55

Browse files
committed
fix(rule): use node.lang for linting
1 parent 35a89da commit 3833d55

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/textlint-rule-eslint.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const reporter = (context, options) => {
1717
const filePath = context.getFilePath();
1818
const textlintRcFilePath = context.config ? context.config.configFile : null;
1919
const textlintRCDir = textlintRcFilePath ? path.dirname(textlintRcFilePath) : process.cwd();
20-
const extname = filePath ? path.extname(filePath) : undefined;
2120
const ESLintOptions = {
2221
configFile: path.resolve(textlintRCDir, options.configFile)
2322
};
@@ -29,7 +28,7 @@ const reporter = (context, options) => {
2928
}
3029
const raw = getSource(node);
3130
const code = node.value;
32-
const resultLinting = engine.executeOnText(code, extname);
31+
const resultLinting = engine.executeOnText(code, node.lang);
3332
if (resultLinting.errorCount === 0) {
3433
return;
3534
}

0 commit comments

Comments
 (0)