@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.
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": "@blgc/config/prettier"
}
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"]
}
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
}
];
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({}));
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
turbo-basic
- Base configuration from Vercel's official starter template for optimal Next.js settingstsconfig/bases
- TypeScript configuration best practices and recommendations