eslint auto fixes

This commit is contained in:
SpikeHD
2022-05-08 16:49:26 -07:00
parent 725bc1a994
commit e700cb17ce
6 changed files with 32 additions and 33 deletions

View File

@@ -1,19 +1,20 @@
import React from 'react'; import React from 'react'
import ReactDOM from 'react-dom/client'; import ReactDOM from 'react-dom/client'
import './index.css'; import './index.css'
import reportWebVitals from "./utils/reportWebVitals"; import reportWebVitals from './utils/reportWebVitals'
import App from "./ui/App"; import App from './ui/App'
const root = ReactDOM.createRoot( const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement document.getElementById('root') as HTMLElement
); )
root.render( root.render(
<React.StrictMode> <React.StrictMode>
<App /> <App />
</React.StrictMode> </React.StrictMode>
); )
// If you want to start measuring performance in your app, pass a function // If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log)) // to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals(); reportWebVitals()

View File

@@ -1,9 +1,7 @@
import React from 'react'; import React from 'react'
import { render, screen } from '@testing-library/react'; import { render, screen } from '@testing-library/react'
import App from './App'; import App from './App'
test('renders learn react link', () => { test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i); })
expect(linkElement).toBeInTheDocument();
});

View File

@@ -1,6 +1,6 @@
import React from 'react'; import React from 'react'
import logo from './logo.svg'; import logo from './logo.svg'
import './App.css'; import './App.css'
// Major Components // Major Components
import Topbar from './components/TopBar' import Topbar from './components/TopBar'
@@ -9,9 +9,9 @@ function App() {
return ( return (
<div className="App"> <div className="App">
<Topbar /> <Topbar />
<button onClick={() => console.log("cum")}>Cool button</button> <button onClick={() => console.log('cum')}>Cool button</button>
</div> </div>
); )
} }
export default App; export default App

View File

@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react'
import './TopBar.css'; import './TopBar.css'
export default class TopBar extends React.Component { export default class TopBar extends React.Component {
constructor(props: unknown[]) { constructor(props: unknown[]) {

View File

@@ -1,15 +1,15 @@
import { ReportHandler } from 'web-vitals'; import { ReportHandler } from 'web-vitals'
const reportWebVitals = (onPerfEntry?: ReportHandler) => { const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (onPerfEntry && onPerfEntry instanceof Function) { if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry); getCLS(onPerfEntry)
getFID(onPerfEntry); getFID(onPerfEntry)
getFCP(onPerfEntry); getFCP(onPerfEntry)
getLCP(onPerfEntry); getLCP(onPerfEntry)
getTTFB(onPerfEntry); getTTFB(onPerfEntry)
}); })
} }
}; }
export default reportWebVitals; export default reportWebVitals

View File

@@ -2,4 +2,4 @@
// allows you to do things like: // allows you to do things like:
// expect(element).toHaveTextContent(/react/i) // expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom // learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom'; import '@testing-library/jest-dom'