@blgc/config
v0.0.27
Published
Builder.Group's engineering style guide
Downloads
712
Readme
@blgc/config
is a collection of configurations for popular linting and styling tools.
The following configs are available, and are designed to be used together.
📖 Usage
Prettier
Note: Prettier is a peer-dependency of this package, and should be installed at the root of your project.
See: https://prettier.io/docs/en/install.html
To use the shared Prettier config, set the following in package.json
:
{
"prettier": "@blgc/config/prettier"
}
Typescript
Note: Typescript is a peer-dependency of this package, and should be installed at the root of your project.
To use the shared Typescript config, set the following in tsconfig.json
:
{
"extends": "@blgc/config/typescript/library",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"declarationDir": "./dist/types"
},
"include": ["src"]
}
ESLint
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
To use the shared ESLint config, set the following in eslint.config.js
:
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = [
...require('@blgc/config/eslint/library'),
{
// Any additional custom rules
}
];
Vitest
To use the shared Vitest config, set the following in vitest.config.js
:
const { defineConfig, mergeConfig } = require('vitest/config');
const { nodeConfig } = require('@blgc/config/vite/node');
module.exports = mergeConfig(nodeConfig, defineConfig({}));
🙏 Contribution
Debugging ESLint Configuration
If you are encountering issues or unexpected behavior with ESLint, you can use the following command to output the final configuration.
npx eslint --print-config ./some/file/to/test/on.ts
🌟 Credits
turbo-basic
- Base configuration from Vercel's official starter template for optimal Next.js settingstsconfig/bases
- TypeScript configuration best practices and recommendations