Skip to content

Commit 7014386

Browse files
authored
Merge pull request #124 from alexandr-g/bug/123
#123 TypeError: Cannot add property noFallthroughCasesInSwitch, object is not extensible
2 parents 2e9caa2 + 6045822 commit 7014386

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ yarn create react-app your-project-name --template typescript-redux
2727

2828
## Motivation
2929

30-
You know the pain. You start a new project from scratch and need to configure it again and again. It needs routing, ok you setup Router, then you need Redux - ok, oh 😩Redux boilerplate is taking so much time to type. Wait... what if you could have all the tools you want just from the beginning? I want to focus on building amazing projects and not spending hours configuring. That's why I've created this template. It's here for you to use.
30+
You know the pain. You start a new project from scratch and need to configure it again and again. It needs routing, ok you setup Router, then you need Redux - ok, oh 😩 Redux boilerplate is taking so much time to type. Wait... what if you could have all the tools you want just from the beginning? I want to focus on building amazing projects and not spending hours configuring. That's why I've created this template. It's here for you to use.
3131

3232
## Available Scripts
3333

@@ -83,6 +83,14 @@ The template extends CRA ESLint rules with a custom set, tailored for the reason
8383

8484
Eslint rules are commented for your convenience feel free to tweak or remove them inside `.eslintrc`. No judgment.
8585

86+
## Testing template locally
87+
88+
To test the output of your template locally run
89+
90+
```bash
91+
npx create-react-app my-app --template file:/\path\to\file
92+
```
93+
8694
## How to create custom Create React App (CRA) templates
8795

8896
I created a step by step guide on how to create your own templates.

template/tsconfig.json

+4-9
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,
@@ -17,9 +13,8 @@
1713
"resolveJsonModule": true,
1814
"isolatedModules": true,
1915
"noEmit": true,
20-
"jsx": "react"
16+
"jsx": "react",
17+
"noFallthroughCasesInSwitch": true
2118
},
22-
"include": [
23-
"src"
24-
]
19+
"include": ["src"]
2520
}

tsconfig.json

+4-9
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,
@@ -17,9 +13,8 @@
1713
"resolveJsonModule": true,
1814
"isolatedModules": true,
1915
"noEmit": true,
20-
"jsx": "react"
16+
"jsx": "react",
17+
"noFallthroughCasesInSwitch": true
2118
},
22-
"include": [
23-
"src"
24-
]
19+
"include": ["src"]
2520
}

0 commit comments

Comments
 (0)