We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using the JS API for eslint, I'm getting jsx-filename-extension errors.
import { CLIEngine } from 'eslint'; const cli = new CLIEngine({ useEslintrc: false, plugins: ['react'], parserOptions: { ecmaFeatures: { jsx: true, }, }, ecmaFeatures: { jsx: true }, rules: { 'react/jsx-filename-extension': 2, }, }); const { results } = cli.executeOnText(` var React = require('react'); module.exports = function SFC() { return <div />; }; `);
I would expect results[0].messages to be an empty array, since results[0].filePath is <text>.
results[0].messages
results[0].filePath
<text>
However, I get:
{ filePath: '<text>', messages: [ { ruleId: 'react/jsx-filename-extension', severity: 2, message: 'JSX not allowed in files with extension \'\'', line: 3, column: 42, nodeType: 'JSXElement', source: 'module.exports = function SFC() { return <div />; };' } ], errorCount: 1, warningCount: 0 }
The text was updated successfully, but these errors were encountered:
[Fix] Don’t check filenames on text input.
e53fccf
Fixes jsx-eslint#662.
Fix jsx-filename-extension to not check filenames on text input (fixes …
f235b84
…#662)
No branches or pull requests
When using the JS API for eslint, I'm getting jsx-filename-extension errors.
I would expect
results[0].messages
to be an empty array, sinceresults[0].filePath
is<text>
.However, I get:
The text was updated successfully, but these errors were encountered: