Skip to content

Commit

Permalink
Merge pull request #124 from alexandr-g/bug/123
Browse files Browse the repository at this point in the history
#123 TypeError: Cannot add property noFallthroughCasesInSwitch, object is not extensible
alexandr-g authored Oct 26, 2020
2 parents 2e9caa2 + 6045822 commit 7014386
Showing 3 changed files with 17 additions and 19 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ yarn create react-app your-project-name --template typescript-redux

## Motivation

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.
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.

## Available Scripts

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

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

## Testing template locally

To test the output of your template locally run

```bash
npx create-react-app my-app --template file:/\path\to\file
```

## How to create custom Create React App (CRA) templates

I created a step by step guide on how to create your own templates.
13 changes: 4 additions & 9 deletions template/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
@@ -17,9 +13,8 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
"jsx": "react",
"noFallthroughCasesInSwitch": true
},
"include": [
"src"
]
"include": ["src"]
}
13 changes: 4 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
@@ -17,9 +13,8 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
"jsx": "react",
"noFallthroughCasesInSwitch": true
},
"include": [
"src"
]
"include": ["src"]
}

1 comment on commit 7014386

@vercel
Copy link

@vercel vercel bot commented on 7014386 Oct 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.