Skip to content

Latest commit

 

History

History
107 lines (80 loc) · 3.16 KB

README.md

File metadata and controls

107 lines (80 loc) · 3.16 KB

@blgc/config banner

GitHub License NPM total downloads Join Discord

@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

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"
}

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({}));

🙏 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 settings
  • tsconfig/bases - TypeScript configuration best practices and recommendations