From 3833d55d07febaec7ff46b71e1d889d81e45f047 Mon Sep 17 00:00:00 2001 From: azu Date: Wed, 20 Jul 2016 00:01:08 +0900 Subject: [PATCH] fix(rule): use `node.lang` for linting --- src/textlint-rule-eslint.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/textlint-rule-eslint.js b/src/textlint-rule-eslint.js index 44e0de8..05af06d 100644 --- a/src/textlint-rule-eslint.js +++ b/src/textlint-rule-eslint.js @@ -17,7 +17,6 @@ const reporter = (context, options) => { const filePath = context.getFilePath(); const textlintRcFilePath = context.config ? context.config.configFile : null; const textlintRCDir = textlintRcFilePath ? path.dirname(textlintRcFilePath) : process.cwd(); - const extname = filePath ? path.extname(filePath) : undefined; const ESLintOptions = { configFile: path.resolve(textlintRCDir, options.configFile) }; @@ -29,7 +28,7 @@ const reporter = (context, options) => { } const raw = getSource(node); const code = node.value; - const resultLinting = engine.executeOnText(code, extname); + const resultLinting = engine.executeOnText(code, node.lang); if (resultLinting.errorCount === 0) { return; }