Skip to content

Commit bbaa20f

Browse files
committed
refactor: 💡 follow eslint
1 parent 752f6c9 commit bbaa20f

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

‎.eslintrc.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ module.exports = {
3333
{ devDependencies: ["**/*.test.{ts,tsx}"] },
3434
],
3535
"import/prefer-default-export": "off",
36+
"no-use-before-define": "off", // leave it to tsc
3637
},
3738
};

‎src/App.test.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react';
2-
import { render, screen } from '@testing-library/react';
3-
import App from './App';
1+
import React from "react";
2+
import { render, screen } from "@testing-library/react";
3+
import App from "./App";
44

5-
test('renders learn react link', () => {
5+
test("renders learn react link", () => {
66
render(<App />);
77
const linkElement = screen.getByText(/learn react/i);
88
expect(linkElement).toBeInTheDocument();

‎src/App.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react';
2-
import logo from './logo.svg';
3-
import './App.css';
1+
import React from "react";
2+
import logo from "./logo.svg";
3+
import "./App.css";
44

5-
function App() {
5+
const App: React.FC = () => {
66
return (
77
<div className="App">
88
<header className="App-header">
@@ -21,6 +21,6 @@ function App() {
2121
</header>
2222
</div>
2323
);
24-
}
24+
};
2525

2626
export default App;

‎src/index.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import './index.css';
4-
import App from './App';
5-
import reportWebVitals from './reportWebVitals';
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import "./index.css";
4+
import App from "./App";
5+
import reportWebVitals from "./reportWebVitals";
66

77
ReactDOM.render(
88
<React.StrictMode>
99
<App />
1010
</React.StrictMode>,
11-
document.getElementById('root')
11+
document.getElementById("root")
1212
);
1313

1414
// If you want to start measuring performance in your app, pass a function

‎src/reportWebVitals.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { ReportHandler } from 'web-vitals';
1+
import { ReportHandler } from "web-vitals";
22

3-
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
3+
const reportWebVitals = (onPerfEntry?: ReportHandler): void => {
44
if (onPerfEntry && onPerfEntry instanceof Function) {
5-
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
5+
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
66
getCLS(onPerfEntry);
77
getFID(onPerfEntry);
88
getFCP(onPerfEntry);

‎src/setupTests.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// allows you to do things like:
33
// expect(element).toHaveTextContent(/react/i)
44
// learn more: https://github.com/testing-library/jest-dom
5-
import '@testing-library/jest-dom';
5+
import "@testing-library/jest-dom";

0 commit comments

Comments
 (0)