The setup CLI automatically sets up a prettier and typescript config.
Short flag | Long flag | Default | Description |
---|---|---|---|
-d | --dir | Current Directory | Where the directory and package.json is located |
-t | --template | See below | Prettier config template located on your system |
None | --typescript | None | If you want to use Typescript, it installs typescript if you didn't before and adds the default config |
None | --typescript-template | None | Location of your tsconfig.json template, same as --typescript flag, just uses your custom template |
Prettier config:
{
"prettier": {
"tabWidth": 4,
"printWidth": 80,
"semi": true,
"quoteProps": "consistent",
"bracketSpacing": true,
"bracketSameLine": true,
"singleQuote": true,
"jsxSingleQuote": true,
"jsxBracketSameLine": true,
"arrowParens": "avoid"
}
}
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"jsx": "react-jsx"
},
"include": [
"./src/"
]
}