@agnostopia/core-dev v0.0.6
Core Dev Configuration (opinionated)
What does it include?
- Basic
.gitignoreand.editorconfigfiles - ESLint + Prettier with suppport to TypeScript thanks to typescript-eslint + XO preset
- Packaging
tsconfig.jsonfiles 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-devCopy .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 typescriptThen 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-stagedThen 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-nodeThen add the files:
ava.config.cjs or copy from node_modules/@agnostopia/core-dev/configs folder.
module.exports = require("@agnostopia/core-dev").avanyc.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"
}
}