@agnostopia/core-dev

core dev configs

Usage no npm install needed!

<script type="module">
  import agnostopiaCoreDev from 'https://cdn.skypack.dev/@agnostopia/core-dev';
</script>

README

Core Dev Configuration (opinionated)

What does it include?

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