1.0.7 • Published 2 years ago
@vaishnavthakur/node-js-build v1.0.7
@vaishnavthakur/node-js-build
Base ES lint, TS Lints, Prettier Config for NODE JS-based packages.
Usage
Step 1: Installation - Install the package in your dev dependencies from NPM using
npm install @vaishnavthakur/node-js-build --save-dev
Step 2: Configure ESLint and/or Prettier
- For ES-Lint, add the .eslintrc.js file in the root of your package with the following content.
const config = {
root:true,
extends: ['./src/eslint-base.js']
}
module.exports = config;
- For Prettier, add the .prettierrc.js file in the root of your package with the following content.
cmodule.exports = require('./src/prettier-base');
Step 3: Configure Build Scripts
To run ESLint and Prettier with every package build, update your build scripts in your package.json to include the following build scripts.
"scripts": {
"format": "prettier --config .prettierrc.js --list-different src/**/*.js",
"format:fix": "prettier --config .prettierrc.js --write src/**/*.js",
"lint": "eslint src/**/*.js --ext .js",
"lint:fix": "eslint src/**/*.js --ext .js --fix",
"release": "npm run lint && npm run format && <other scipts>",
...otherscripts
},