This repository is the home of an based on Vercel's style guide, which includes configs for popular linting and styling tools.
The following configs are available, and are designed to be used together.
All of our configs are contained in one package, @swrlab/style-guide
. To install:
# If you use Bun
bun add --dev @swrlab/style-guide
# If you use Yarn
yarn add --dev @swrlab/style-guide
# If you use npm
npm i --save-dev @swrlab/style-guide
# If you use pmpm
pnpm i --save-dev @swrlab/style-guide
Some of our ESLint configs require peer dependencies. We'll note those alongside the available configs in the ESLint section.
Note: Prettier is a peer-dependency of this package, and should be installed at the root of your project.
To use the shared Prettier config, set the following in package.json
.
{
"prettier": "@swrlab/style-guide/prettier"
}
Note: ESLint is a peer-dependency of this package, and should be installed at the root of your project.
See: https://eslint.org/docs/user-guide/getting-started#installation-and-usage
Usage:
// eslint.config.mjs
import { audiolab } from '@swrlab/style-guide/eslint/presets.js'
export default audiolab(
[
/* your custom ESLint config */
],
{
prettier: true,
vue: true,
}
)
You can also import and compose individual presets. However, it is recommended that you use the factory function above.
// eslint.config.js
import { presetAll, presetBasic } from '@swrlab/style-guide/eslint/presets.js'
export default presetBasic
To use the shared Biome config, set the following in biome.json
:
{
"extends": ["@swrlab/style-guide/biome"]
}
This config is inspired by the work of The Vercel Style Guide and is further based on
After cloning, you can run bun install
(or npm install
) to install the npm dependencies.
ISC