@bksp/style-guide
v0.8.0
Published
Reusable style guide configurations
Downloads
275
Readme
B4CKSP4CE Code Style Guide
Introduction
This repository is the home of B4CKSP4CE's style guide, which includes configs for popular linting and styling tools.
The following configs are available, and are designed to be used together.
Install the package using your package manager of choice:
# Using pnpm
pnpm install --save-dev @bksp/style-guide
Editorconfig
The .editorconfig
file is a simple way to enforce consistent coding styles across various editors and IDEs.
It is recommended to use the following configuration:
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.{js,jsx,cjs,mjs,ts,tsx,json,yml,yaml,env}]
charset = utf-8
indent_style = space
indent_size = 2
ESLint
Note: ESLint is a peer-dependency of this package, and should be installed at the root of your project.
# Install ESLint and TypeScript ESLint parser required for the shared config
pnpm install --save-dev eslint typescript-eslint
There are two ESLint configurations available:
@bksp/style-guide/eslint/node
- for generic Node.js projects@bksp/style-guide/eslint/next
- for Next.js projects
Re-export the desired configuration in your project's eslint.config.mjs
file:
// eslint.config.mjs
import next from '@bksp/style-guide/eslint/next'
export default next;
You can extend this configuration to add project-specific rules. Read more about it in Configuring ESLint documentation.
TypeScript
Please use @tsconfig/strictest
directly in your projects:
{
"extends": "@tsconfig/strictest"
}
Commitlint
[!NOTE] Use whatever style you prefer, but be consistent. We may suggest using Conventional Commits.
Previously, we enforced Conventional Commits with hooks and commitlint. This are long gone.
Credits
This project was initially inspired by Vercel Style Guide. Thanks for sharing this amazing piece of work!