Skip to content

Commit

Permalink
Reproduce issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vinassefranche committed May 3, 2021
1 parent 022ecec commit 9129f1e
Show file tree
Hide file tree
Showing 9 changed files with 387 additions and 49 deletions.
25 changes: 25 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"react-hooks"
],
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"react-hooks/rules-of-hooks": "error",
"react/prop-types": "off"
},
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
}
}
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"styled-components": "^5.2.3",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
},
Expand All @@ -39,5 +40,13 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/styled-components": "^5.1.9",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"eslint": "^7.25.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0"
}
}
9 changes: 0 additions & 9 deletions src/App.test.tsx

This file was deleted.

4 changes: 1 addition & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import logo from './logo.svg';
import './App.css';

function App() {
export const App = (): JSX.Element => {
return (
<div className="App">
<header className="App-header">
Expand All @@ -22,5 +22,3 @@ function App() {
</div>
);
}

export default App;
23 changes: 23 additions & 0 deletions src/Test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { useState } from 'react';
import styled from 'styled-components';

export const WorkingLint: React.FunctionComponent<{prop?: string}> = ({prop}) => {
if(!prop) {
return null;
}
const [] = useState(false);
return (
<div> Lint on hook is working </div>
);
};

export const NotWorkingLint = styled(({prop}:{prop?: string}) => {
if(!prop) {
return null;
}
const [] = useState(false);
return (
<div> Lint on hook is working </div>
);
})``;

8 changes: 1 addition & 7 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import {App} from './App';

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
15 changes: 0 additions & 15 deletions src/reportWebVitals.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/setupTests.ts

This file was deleted.

Loading

0 comments on commit 9129f1e

Please sign in to comment.