eslint-config-phuocdt

1.0.6 • Public • Published

eslint-config-phuocdt

ESLint shareable config based on JavaScript convention at phuocdt

NPM Build Status

Usage

In order to use this shareable config you have to install the package "eslint-config-phuocdt" into your project:

npm install --save-dev eslint-config-phuocdt

Then, create ESLint config file named ".eslintrc.json" (or edit if it exists). The content is short as below:

.eslintrc.json

{
  "extends": "eslint-config-phuocdt"
}

or

{
  "extends": "phuocdt"
}

That's all. It will works.

Sometimes the rules we shared may be not enough for you. Just add more or overwrite them with your own rules by modifying ".eslintrc.json". For example:

.eslintrc.json

{
  "env": {
    "browser": false,
    "node": true,
    "es6": true
  },

  "globals": {
    "goog": true,
    "mocha": true,
    "Polymer": true
  },

  "plugins": [
    "fp"
  ],

  "extends": "eslint-config-phuocdt",

  rules: {
    "fp/no-arguments": "error",
    "fp/no-class": "error",
    "max-lines": 400,
    "semi": [2, "always"]
  }
}

You will often want to add the commands to package.json, here is a sample:

{
  "name": "sample",
  "version": "0.0.1",
  "description": "A sample for using eslint and eslint-config-phuocdt",
  "engines": {
    "node": ">= 10.15.0"
  },
  "scripts": {
    "lint": "eslint ./src"
  },
  "devDependencies": {
    "eslint": "latest",
    "eslint-config-phuocdt": "latest"
  },
  "license": "MIT"
}

As you can see, we need 2 packages "eslint" and "eslint-config-phuocdt". After installing them with "npm install", you can check your convention with "npm run lint" command.

References:

License

The MIT License (MIT)

Package Sidebar

Install

npm i eslint-config-phuocdt

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

72.1 kB

Total Files

9

Last publish

Collaborators

  • repo-phuocdt