hd-scripts

9.1.0 • Public • Published

hd-scripts NPM Version NPM License tests

My personal config and scripts for projects

Install

pnpm install hd-scripts

Usage

package.json

{
  "main": "src/index.js",
  "types": "dist/src/index.d.ts",
  "files": ["dist/src", "src", "index.js", "cli.js"],
  "scripts": {
    "lint": "eslint . && prettier --check **/*.{js,ts,yml,json} --ignore-path .gitignore && tsc"
  },
  "simple-git-hooks": {
    "pre-commit": "npx lint-staged"
  },
  "lint-staged": {
    "*.{js,ts,md,yml,json}": "prettier --write",
    "*": "eslint --fix"
  },
  "eslintConfig": {
    "extends": "./node_modules/hd-scripts/eslint/index.js",
    "ignorePatterns": ["node_modules", "coverage", "dist", "docs"],
    // for preact
    "rules": {
      "react/no-unknown-property": "off",
      "react/prop-types": "off"
    },
    "settings": {
      "react": {
        "pragma": "h",
        "version": "18.0"
      }
    }
  },
  "prettier": "hd-scripts/prettier.config.js"
}

tsconfig.json

{
  "extends": "hd-scripts/tsconfig.json",
  "compilerOptions": {
    "outDir": "dist",
    "emitDeclarationOnly": true
  },
  "include": ["src", "test.js", "cli.js", "package.json"]
}

For typescript code bases:

{
  "extends": "hd-scripts/tsconfig.json",
  "compilerOptions": {
    "outDir": "dist",
    "module": "NodeNext",
    "moduleResolution": "NodeNext"
  },
  "include": ["src", "test.js", "cli.js", "package.json"]
}

In monorepos you can install hd-scripts only in the root and extends the root tsconfig.json in the packages.

License

MIT © Hugo Dias

Readme

Keywords

Package Sidebar

Install

npm i hd-scripts

Weekly Downloads

96

Version

9.1.0

License

MIT

Unpacked Size

27.1 kB

Total Files

16

Last publish

Collaborators

  • hugomrdias