Skip to content

Commit dbf9c9a

Browse files
committed
Format everything with Prettier
1 parent 18be3fc commit dbf9c9a

14 files changed

+86
-59
lines changed

.prettierignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

craco.config.js

+24-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
module.exports = {
22
webpack: {
3-
configure: (webpackConfig, {env, paths}) => {
4-
return {
5-
...webpackConfig,
6-
entry: {
7-
main: [env === 'development' && require.resolve('react-dev-utils/webpackHotDevClient'),paths.appIndexJs].filter(Boolean),
8-
background: './src/scripts/background.ts',
9-
content: './src/scripts/content.ts',
10-
},
11-
output: {
12-
...webpackConfig.output,
13-
filename: 'static/js/[name].js',
14-
},
15-
optimization: {
16-
...webpackConfig.optimization,
17-
runtimeChunk: false,
18-
}
19-
}
20-
},
21-
}
22-
}
3+
configure: (webpackConfig, { env, paths }) => {
4+
return {
5+
...webpackConfig,
6+
entry: {
7+
main: [
8+
env === "development" &&
9+
require.resolve("react-dev-utils/webpackHotDevClient"),
10+
paths.appIndexJs,
11+
].filter(Boolean),
12+
background: "./src/scripts/background.ts",
13+
content: "./src/scripts/content.ts",
14+
},
15+
output: {
16+
...webpackConfig.output,
17+
filename: "static/js/[name].js",
18+
},
19+
optimization: {
20+
...webpackConfig.optimization,
21+
runtimeChunk: false,
22+
},
23+
};
24+
},
25+
},
26+
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@types/node": "^16.7.13",
1313
"@types/react": "^17.0.20",
1414
"@types/react-dom": "^17.0.9",
15+
"prettier": "^2.5.1",
1516
"react": "^17.0.2",
1617
"react-dom": "^17.0.2",
1718
"react-scripts": "5.0.0",

public/manifest.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"name": "React Typescript Chrome Extension Boilerplate",
44
"description": "Minimal boilerplate for making chrome extensions using React and TypeScript",
55
"version": "1.0.0",
6-
6+
77
"action": {
8-
"default_popup": "index.html",
9-
"default_title": "Open the popup"
8+
"default_popup": "index.html",
9+
"default_title": "Open the popup"
1010
},
1111

1212
"background": {
@@ -15,13 +15,13 @@
1515

1616
"content_scripts": [
1717
{
18-
"matches": ["http://*/*", "https://*/*"],
19-
"js": ["./static/js/content.js"]
18+
"matches": ["http://*/*", "https://*/*"],
19+
"js": ["./static/js/content.js"]
2020
}
21-
],
21+
],
2222
"icons": {
23-
"16": "logo192.png",
24-
"48": "logo192.png",
25-
"128": "logo192.png"
23+
"16": "logo192.png",
24+
"48": "logo192.png",
25+
"128": "logo192.png"
2626
}
27-
}
27+
}

src/App.test.tsx

+4-4
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

55
function App() {
66
return (

src/index.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
3+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
4+
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
55
sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
88
}
99

1010
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
11+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
1212
monospace;
1313
}

src/index.tsx

+6-6
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

+2-2
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

33
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
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/scripts/background.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
console.log("yo");
22

3-
export {};
3+
export {};

src/scripts/content.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
console.log("yo");
22

3-
export {};
3+
export {};

src/setupTests.ts

+1-1
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";

tsconfig.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"esModuleInterop": true,
@@ -20,7 +16,5 @@
2016
"noEmit": true,
2117
"jsx": "react-jsx"
2218
},
23-
"include": [
24-
"src"
25-
]
19+
"include": ["src"]
2620
}

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -6848,6 +6848,11 @@ prelude-ls@~1.1.2:
68486848
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
68496849
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
68506850

6851+
prettier@^2.5.1:
6852+
version "2.5.1"
6853+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a"
6854+
integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==
6855+
68516856
pretty-bytes@^5.3.0, pretty-bytes@^5.4.1:
68526857
version "5.6.0"
68536858
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"

0 commit comments

Comments
 (0)