-
-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Closed
Description
Describe the bug
Setup:
npx create-react-app example --template typescript
cd example
npm i eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react
With .eslintrc.js:
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended'
],
'settings': {
'react': {
'version': 'detect'
},
}
};
Expected behavior
No errors.
Actual behavior
Error: Missing return type on function.
Shown below:
Suggested fix:
Change function App() { to const App: React.FC = () => {
| function App() { |
bluefire2121 and anthonyalayo
