Skip to content

Instantly share code, notes, and snippets.

@nnance
Last active April 26, 2020 14:48
Show Gist options
  • Save nnance/e9a7e62dd0b19b2524ca166c11e5e21b to your computer and use it in GitHub Desktop.
Save nnance/e9a7e62dd0b19b2524ca166c11e5e21b to your computer and use it in GitHub Desktop.
React TypeScript Bootstrap Parcel prototype template
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint"
]
}
/node_modules
/dist
/coverage
/.cache
git init && npm init -y
npm i -D @types/react @types/react-dom react react-dom typescript parcel-bundler react-bootstrap bootstrap @types/react-bootstrap eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser prettier eslint-plugin-prettier
./node_modules/.bin/tsc --init --jsx react --sourceMap --esModuleInterop --lib es6,dom
curl -fsSL https://gist.githubusercontent.com/nnance/e9a7e62dd0b19b2524ca166c11e5e21b/raw/.gitignore > .gitignore
curl -fsSL https://gist.githubusercontent.com/nnance/e9a7e62dd0b19b2524ca166c11e5e21b/raw/.eslint.json > .eslint.json
curl -fsSL https://gist.githubusercontent.com/nnance/e9a7e62dd0b19b2524ca166c11e5e21b/raw/index.html > index.html
curl -fsSL https://gist.githubusercontent.com/nnance/e9a7e62dd0b19b2524ca166c11e5e21b/raw/index.tsx > index.tsx
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<title>React TypeScript Bootstrap</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="./index.tsx"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
import React from "react";
import ReactDOM from "react-dom";
const App = () => <div>Hello World!</div>;
ReactDOM.render(<App />, document.querySelector("#root"));
@nnance
Copy link
Author

nnance commented Apr 26, 2020

Use to quickly create a react app for prototyping by running the following command

/bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/nnance/e9a7e62dd0b19b2524ca166c11e5e21b/raw/create-react-ts.sh)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment