JSX not allowed in files with extension '.tsx'eslint(react/jsx-filename-extension) JSX not allowed in files with extension '.tsx'eslint(react/jsx-filename-extension) typescript typescript

JSX not allowed in files with extension '.tsx'eslint(react/jsx-filename-extension)


You probably want to configure the react/jsx-filename-extension rule in your .eslintrc.js so that ESLint is happy about JSX inside your TypeScript files:

rules:  {  'react/jsx-filename-extension': [2, { 'extensions': ['.js', '.jsx', '.ts', '.tsx'] }],},


Add this rule under the rules section of your eslint configuration:

"rules": {  "react/jsx-filename-extension": [1, { "extensions": [".tsx", ".ts"] }]}