@pixpilot/dev-config
Modern, opinionated configurations for TypeScript projects.
Note: These configurations are designed for our organization's projects but are adaptable for your needs. Settings may evolve to enhance our codebase.
🚀 Installation
Getting started is simple. Your project needs to have prettier
and typescript
installed, as they are peer dependencies.
-
Install the necessary packages:
npm install -D @pixpilot/dev-config
-
Install Jest (Optional):
If your project uses Jest for testing, install it separately.
npm install -D jest ts-jest
⚙️ Usage
All the required Prettier plugins are bundled in this package. The easiest way to get started is to use the shared Prettier setup and TypeScript base config.
Prettier Usage
Create prettier.config.js
to use the shared Prettier setup.
import config from '@pixpilot/dev-config/prettier';
export default config;
TypeScript
Create tsconfig.json
to extend the base configuration.
{
"extends": "@pixpilot/dev-config/typescript",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
Jest
If you are using Jest, you must install both jest
and ts-jest
:
npm install -D jest ts-jest
Create a jest.config.js
file:
import config from '@pixpilot/dev-config/jest';
export default config;
MarkdownLint
-
Install: npm install -D markdownlint-cli
-
Create .markdownlint.json
:
{
"extends": "@pixpilot/dev-config/markdownlint"
}
Commitlint
-
Install: npm install -D @commitlint/cli @commitlint/config-conventional
-
Create commitlint.config.mjs
in your project root:
import config from '@pixpilot/dev-config/commitlint';
export default config;
Vitest
-
Install:
npm install -D vitest @vitest/coverage-v8
-
Create vitest.config.ts
in your project root:
import defineConfig from '@pixpilot/dev-config/vitest';
export default defineConfig();
Coverage is enabled by default. Reports are generated in text, JSON, and HTML formats.