|
1 | 1 | # Setup CLI |
| 2 | + |
| 3 | +The setup CLI automatically sets up a [prettier](https://www.npmjs.com/package/prettier) and [typescript](https://www.npmjs.com/package/typescript) config. |
| 4 | + |
| 5 | +## API |
| 6 | + |
| 7 | +<table> |
| 8 | + <thead> |
| 9 | + <th>Short flag</th> |
| 10 | + <th>Long flag</th> |
| 11 | + <th>Default</th> |
| 12 | + <th>Description</th> |
| 13 | + </thead> |
| 14 | +<tbody> |
| 15 | + <tr> |
| 16 | + <td>-d</td> |
| 17 | + <td>--dir</td> |
| 18 | + <td><i>Current Directory</i></td> |
| 19 | + <td>Where the directory and package.json is located</td> |
| 20 | + </tr> |
| 21 | + <tr> |
| 22 | + <td>-t</td> |
| 23 | + <td>--template</td> |
| 24 | + <td><i>See below</i></td> |
| 25 | + <td>Prettier config template located on your system</td> |
| 26 | + </tr> |
| 27 | + <tr> |
| 28 | + <td><i>None</i></td> |
| 29 | + <td>--typescript</td> |
| 30 | + <td><i>None</i></td> |
| 31 | + <td>If you want to use Typescript, it installs typescript if you didn't before and adds the default config</td> |
| 32 | + </tr> |
| 33 | + <tr> |
| 34 | + <td><i>None</i></td> |
| 35 | + <td>--typescript-template</td> |
| 36 | + <td><i>None</i></td> |
| 37 | + <td>Location of your tsconfig.json template, same as <code>--typescript</code> flag, just uses your custom template</td> |
| 38 | + </tr> |
| 39 | +</tbody> |
| 40 | +</table> |
| 41 | + |
| 42 | +## Default Values |
| 43 | + |
| 44 | +Prettier config: |
| 45 | +```json |
| 46 | +{ |
| 47 | + "prettier": { |
| 48 | + "tabWidth": 4, |
| 49 | + "printWidth": 80, |
| 50 | + "semi": true, |
| 51 | + "quoteProps": "consistent", |
| 52 | + "bracketSpacing": true, |
| 53 | + "bracketSameLine": true, |
| 54 | + "singleQuote": true, |
| 55 | + "jsxSingleQuote": true, |
| 56 | + "jsxBracketSameLine": true, |
| 57 | + "arrowParens": "avoid" |
| 58 | + } |
| 59 | +} |
| 60 | +``` |
| 61 | + |
| 62 | +tsconfig.json |
| 63 | +```json |
| 64 | +{ |
| 65 | + "compilerOptions": { |
| 66 | + "target": "es5", |
| 67 | + "lib": [ |
| 68 | + "dom", |
| 69 | + "dom.iterable", |
| 70 | + "esnext" |
| 71 | + ], |
| 72 | + "allowJs": true, |
| 73 | + "skipLibCheck": true, |
| 74 | + "esModuleInterop": true, |
| 75 | + "allowSyntheticDefaultImports": true, |
| 76 | + "strict": true, |
| 77 | + "forceConsistentCasingInFileNames": true, |
| 78 | + "noFallthroughCasesInSwitch": true, |
| 79 | + "module": "esnext", |
| 80 | + "moduleResolution": "node", |
| 81 | + "resolveJsonModule": true, |
| 82 | + "isolatedModules": true, |
| 83 | + "noEmit": true, |
| 84 | + "noImplicitAny": true, |
| 85 | + "noImplicitReturns": true, |
| 86 | + "jsx": "react-jsx" |
| 87 | + }, |
| 88 | + "include": [ |
| 89 | + "./src/" |
| 90 | + ] |
| 91 | +} |
| 92 | +``` |
0 commit comments