The following pattern is considered a warning:
// filename: MyComponent.js
function MyComponent() {
return <div />;
}
The following pattern is not considered a warning:
// filename: MyComponent.jsx
function MyComponent() {
return <div />;
}
The set of allowed extensions is configurable. By default '.jsx' is allowed. If you wanted to allow both '.jsx' and '.js', the configuration would be:
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
}
If you don't care about restricting the file extensions that may contain JSX.