cra-template-ts-eslint-prettier
React template in TypeScript preconfigured with Eslint and Prettier. The base project was created with create-react-app
using the typescript template using the command npx create-react-app my-app --template typescript
.
Install
npx create-react-app my-app --template @dany-eduard/cra-template-ts-eslint-prettier
You must install the packages after installing. Use
npm i
oryarn install
Git Clone
git clone https://github.com/dany-eduard/cra-template-ts-eslint-prettier.git
Eslint Rules
import/extensions
: Ensure consistent use of file extension within the import pathimport/no-extraneous-dependencies
: Forbid the use of extraneous packagesreact/jsx-filename-extension
: Restrict file extensions that may contain JSXreact/jsx-props-no-spreading
: Disallow JSX props spreadingreact/function-component-definition
: Enforce a specific function type for function componentsno-use-before-define
: Disallow the use of variables before they are defined@typescript-eslint/no-use-before-define
: Disallow the use of variables before they are definedreact/react-in-jsx-scope
: Prevent missing React when using JSX
Prettier Rules
-
printWidth
:120
-
semi
:false
-
singleQuote
:true
-
tabWidth
:2
-
trailingComma
:es5
-
useTabs
:false
Learn More
You can learn more about Custom Templates in the Create React App dev documentation.