Skip to content

Commit 044531c

Browse files
Initial commit
0 parents  commit 044531c

24 files changed

+8679
-0
lines changed

.babelrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react",
5+
"@babel/preset-typescript"
6+
],
7+
"plugins": [
8+
"@babel/plugin-proposal-class-properties",
9+
"@babel/plugin-proposal-object-rest-spread",
10+
"@babel/plugin-syntax-dynamic-import"
11+
]
12+
}

.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": [
4+
"jest.config.js",
5+
"webpack.config.js"
6+
],
7+
"parser": "@typescript-eslint/parser",
8+
"plugins": [
9+
"@typescript-eslint",
10+
"react",
11+
"prettier"
12+
],
13+
"extends": [
14+
"eslint:recommended",
15+
"plugin:@typescript-eslint/eslint-recommended",
16+
"plugin:@typescript-eslint/recommended",
17+
"prettier"
18+
],
19+
"rules": {
20+
"@typescript-eslint/ban-ts-comment": "off",
21+
"prettier/prettier": ["error"]
22+
}
23+
}

.gitignore

Lines changed: 23 additions & 0 deletions
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+
/dist
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*

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"singleQuote": true,
3+
"bracketSpacing": true,
4+
"endOfLine": "lf",
5+
"jsxBracketSameLine": true,
6+
"trailingComma": "none",
7+
"quoteProps": "consistent",
8+
"jsxSingleQuote": true,
9+
"tabWidth": 4
10+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 janeksmielowski
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# React Typescript Template
2+
3+
This project contains a basic [React](https://github.com/facebook/react) application template configuration with the following extensions:
4+
- [TypeScript](https://github.com/microsoft/TypeScript)
5+
- [Webpack](https://github.com/webpack/webpack)
6+
- [Babel](https://github.com/babel/babel)
7+
- [ESLint](https://github.com/eslint/eslint)
8+
- [Prettier](https://github.com/prettier/prettier)
9+
- [Jest](https://github.com/facebook/jest)
10+
- [Styled Components](https://github.com/styled-components/styled-components)
11+
12+
## Available Scripts
13+
14+
In the project directory, you can run:
15+
16+
### `yarn start`
17+
18+
Runs the app in the development mode.\
19+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
20+
21+
The page will reload if you make edits.\
22+
You will also see any lint errors in the console.
23+
24+
### `yarn test`
25+
26+
Launches the test runner in the interactive watch mode.
27+
28+
### `yarn build`
29+
30+
Builds the app for production to the `dist` folder.\
31+
It correctly bundles React in production mode and optimizes the build for the best performance.
32+
33+
The build is minified and the filenames include the hashes.\
34+
Your app is ready to be deployed!
35+
36+
## Learn More
37+
38+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
39+
40+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
41+
42+
To learn React, check out the [React documentation](https://reactjs.org/).

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

index.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# React Typescript Template
2+
3+
This project contains a basic [React](https://github.com/facebook/react) application template configuration with the following extensions:
4+
- [TypeScript](https://github.com/microsoft/TypeScript)
5+
- [Webpack](https://github.com/webpack/webpack)
6+
- [Babel](https://github.com/babel/babel)
7+
- [ESLint](https://github.com/eslint/eslint)
8+
- [Prettier](https://github.com/prettier/prettier)
9+
- [Jest](https://github.com/facebook/jest)
10+
- [Styled Components](https://github.com/styled-components/styled-components)
11+
12+
## Available Scripts
13+
14+
In the project directory, you can run:
15+
16+
### `yarn start`
17+
18+
Runs the app in the development mode.\
19+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
20+
21+
The page will reload if you make edits.\
22+
You will also see any lint errors in the console.
23+
24+
### `yarn test`
25+
26+
Launches the test runner in the interactive watch mode.
27+
28+
### `yarn build`
29+
30+
Builds the app for production to the `dist` folder.\
31+
It correctly bundles React in production mode and optimizes the build for the best performance.
32+
33+
The build is minified and the filenames include the hashes.\
34+
Your app is ready to be deployed!
35+
36+
## Learn More
37+
38+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
39+
40+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
41+
42+
To learn React, check out the [React documentation](https://reactjs.org/).

jest.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
roots: ['<rootDir>/src'],
3+
moduleNameMapper: {
4+
"@root/(.*)$": "<rootDir>/src/$1",
5+
},
6+
setupFilesAfterEnv: [
7+
"<rootDir>/src/tests/setuptests.ts"
8+
],
9+
testMatch: [
10+
'**/__tests__/**/*.+(ts|tsx|js|jsx)',
11+
'**/?(*.)+(spec|test).+(ts|tsx|js|jsx)'
12+
],
13+
transform: {
14+
'^.+\\.(ts|tsx)$': 'ts-jest'
15+
}
16+
};

package.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"name": "react-ts-template",
3+
"description": "React Typescript application template, with Babel, Webpack and ESLint configuration",
4+
"license": "MIT",
5+
"version": "0.1.0",
6+
"private": true,
7+
"author": "janeksmielowski",
8+
"repository": "https://github.com/janeksmielowski/react-ts-template",
9+
"main": "dist/index.js",
10+
"dependencies": {
11+
"react": "17.0.1",
12+
"react-dom": "17.0.1",
13+
"styled-components": "5.2.1",
14+
"typescript": "4.1.2",
15+
"web-vitals": "1.0.1"
16+
},
17+
"devDependencies": {
18+
"@babel/cli": "7.12.8",
19+
"@babel/core": "7.12.9",
20+
"@babel/plugin-proposal-class-properties": "7.12.1",
21+
"@babel/plugin-proposal-object-rest-spread": "7.12.1",
22+
"@babel/plugin-syntax-dynamic-import": "7.8.3",
23+
"@babel/preset-env": "7.12.7",
24+
"@babel/preset-react": "7.12.7",
25+
"@babel/preset-typescript": "7.12.7",
26+
"@testing-library/jest-dom": "5.11.6",
27+
"@testing-library/react": "11.2.2",
28+
"@types/jest": "26.0.15",
29+
"@types/node": "12.0.0",
30+
"@types/react": "16.9.53",
31+
"@types/react-dom": "16.9.8",
32+
"@types/styled-components": "5.1.4",
33+
"@typescript-eslint/eslint-plugin": "4.8.2",
34+
"@typescript-eslint/parser": "4.8.2",
35+
"babel-loader": "8.2.2",
36+
"clean-webpack-plugin": "3.0.0",
37+
"copy-webpack-plugin": "6.3.2",
38+
"eslint": "7.14.0",
39+
"eslint-config-prettier": "6.15.0",
40+
"eslint-plugin-prettier": "3.1.4",
41+
"eslint-plugin-react": "7.21.5",
42+
"eslint-webpack-plugin": "2.4.0",
43+
"file-loader": "6.2.0",
44+
"html-webpack-plugin": "4.5.0",
45+
"jest": "26.6.3",
46+
"prettier": "2.2.1",
47+
"terser-webpack-plugin": "5.0.3",
48+
"ts-jest": "26.4.4",
49+
"webpack": "5.9.0",
50+
"webpack-cli": "4.2.0",
51+
"webpack-dev-server": "3.11.0"
52+
},
53+
"scripts": {
54+
"build": "yarn test && yarn build:prod",
55+
"build:dev": "webpack --mode=development",
56+
"build:prod": "webpack --mode=production",
57+
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
58+
"lint:fix": "yarn lint --fix",
59+
"start": "webpack serve --mode=development",
60+
"test": "jest"
61+
},
62+
"eslintConfig": {
63+
"extends": [
64+
"react-app"
65+
]
66+
},
67+
"browserslist": {
68+
"production": [
69+
">0.2%",
70+
"not dead",
71+
"not op_mini all"
72+
],
73+
"development": [
74+
"last 1 chrome version",
75+
"last 1 firefox version",
76+
"last 1 safari version"
77+
]
78+
}
79+
}

0 commit comments

Comments
 (0)