@merrywhether/config
Common config files for @merrywhether projects
Usage
Installation:
pnpm add -D @merrywhether/config
Use this is via invoking its executable from the root of your app (or the directory where you want the config files created):
pnpm mw-config
This will generate your config files for you, with support for the following options with corresponding effects:
option | alias | default set | Δ eslintrc | Δ prettier.config | Δ tsconfig |
---|---|---|---|---|---|
eslint | e | ✅ | ✅ | ||
prettier | p | ✅ | ✅ | ✅ | |
react | r | ✅ | |||
renovate | ✅ | ||||
solid | ✅ | ✅ | |||
styled | ✅ | ||||
typescript | t | ✅ | ✅ | ✅ |
The defaults are controlled by the --default
/-d
flag.
Configuration Details
ESLint
The base ESLint configuration includes the following plugins/configs:
-
eslint
(recommended++) import
-
prettier
(recommended) sort-destructure-keys
sort-keys-fix
When the typescript
option is selected, the following are added:
-
@typescript-eslint
(recommended++, including type-aware)
When the react
option is selected, the following are added:
-
react
(recommended++, jsx-runtime) -
react-hooks
(recommended++) -
typescript-sort-keys
(recommended)
When the solid
option is selected, the following are added:
Prettier
Uses the default Prettier settings with the following changes:
-
singleQuote: true
(because this is JS! 😛) -
trailingComma: all
(embrace the future) -
proseWrap: always
(wrapping Markdown).
Typescript
The base configuration has all of the strictest settings enabled and targets
esnext
.
When the styled
option is selected,
@styled/typescript-styled-plugin
is added.
When the solid
option is selected, the jsxImportSource
is appropriately
updated.