@agnostopia/core-dev
v0.0.6
Published
core dev configs
Downloads
9
Maintainers
Readme
Core Dev Configuration (opinionated)
What does it include?
- Basic
.gitignore
and.editorconfig
files - ESLint + Prettier with suppport to TypeScript thanks to typescript-eslint + XO preset
- Packaging
tsconfig.json
files for dev/test and packing with @pika/pack - [optional] Pre-commit validation configurations for Husky + lint-staged
- [optional] Testing configuration for AVA + nyc reports
powered by pnpm
Basics
Install this package
pnpm i -D @agnostopia/core-dev
Copy .gitignore
and .editorconfig
files from node_modules/@agnostopia/core-dev/configs
folder.
Format and linting
Install dependencies
pnpm i -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-config-xo eslint-config-xo-typescript eslint-plugin-prettier prettier typescript
Then add the files:
.eslintrc.js
or copy from node_modules/@agnostopia/core-dev/configs
folder.
module.exports = require("@agnostopia/core-dev").eslint;
.prettierrc.js
or copy from node_modules/@agnostopia/core-dev/configs
folder.
module.exports = require("@agnostopia/core-dev").prettier;
TypeScript config
Easily extends basic tsconfig files. Or copy from node_modules/@agnostopia/core-dev/configs
folder.
use dev.json
for development purpose
{
"extends": "./node_modules/@agnostopia/core-dev/tsconfigs/dev.json"
}
Or pack.json
to use with @pika/pack with TypeScript package
{
"extends": "./node_modules/@agnostopia/core-dev/tsconfigs/pack.json",
"include": [
"./src/**/*.ts"
]
}
Husky & lint staged
Install dependencies
pnpm i -D husky lint-staged
Then add the files:
.huskyrc.js
or copy from node_modules/@agnostopia/core-dev/configs
folder.
module.exports = require("@agnostopia/core-dev").husky;
lint-staged.config.js
or copy from node_modules/@agnostopia/core-dev/configs
folder.
module.exports = require("@agnostopia/core-dev").lintStaged;
AVA & nyc
Install dependencies
pnpm i -D ava esm nyc ts-node
Then add the files:
ava.config.cjs
or copy from node_modules/@agnostopia/core-dev/configs
folder.
module.exports = require("@agnostopia/core-dev").ava
nyc.config.js
or copy from node_modules/@agnostopia/core-dev/configs
folder.
module.exports = require("@agnostopia/core-dev").nyc;
Finally, add Test and Test Coverage scripts to package.json
scripts.
{
"scripts": {
"test": "ava -t",
"test-cov": "nyc ava"
}
}