1.0.0 • Published 9 months ago

@pazetal/eslint-config v1.0.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
9 months ago

ESLint Config

Shared ESLint config file. To use this in other packages

  1. Add the following to your package.json
{
  "prettier": "@pazetal/prettier-config",
  "scripts" : {
    "build": "<enter your build commands> && npm run build:lint",
    "build:lint": "eslint .",
    "fix": "eslint . --fix"
  },
  "devDependencies": {
    "@pazetal/eslint-config": "*",
    "@pazetal/prettier-config": "*"
  }
}

2 Extend the ESLint config file 1. If you do not need to extend the configurations with your own rules, you can add the following to the package.json file

{
  "eslintConfig": {"extends":  "@pazetal/eslint-config"}
}
  1. Make a file titled .eslintrc.cjs at the root of your code package and put the following inside:
/** @type {import('@typescript-eslint/utils').TSELint.Linter.Config} */
module.exports = {
  "extends": [
    /** 
    * Pick one of the following cofig files. Choode the base broser if your package needs to work for both
    * browser and Node environments.
    */
    "@pazetal/eslint-config"
    "@pazetal/eslint-config/browser"
    "@pazetal/eslint-config/node"
  ]
}

This package should not need to be invoked directly. Prettier should be invoked via ESLint using the eslint-config package.