1.0.54 • Published 1 day ago

@onidivo/eslint-config v1.0.54

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 day ago

onidivo/eslint-config

Installation

Install our configuration and its peer dependencies.

yarn add --dev @onidivo/eslint-config
OR
npm install --save-dev eslint @onidivo/eslint-config
npx install-peerdeps --dev @onidivo/eslint-config

Create a .eslintrc.json file in your root with the following content:

{
  "extends": [
    "@onidivo/eslint-config",
  ]
}

Add a linter script to your package.json. In the following example, all files in the src and test folder (and their subfolders) are checked:

{
  "scripts": {
    "lint": "eslint \"+(src|test)/**/*.js\" --fix"
  }
}

Watcher task

You can use chokidar-cli to add a task that lints your files on save. First install it:

yarn add --dev chokidar-cli
OR
npm install --save-dev chokidar-cli

Then add a watch script to your package.json. In the following example, chokidar will look for changes in any files in the src and test folder (and their subfolders):

{
  "scripts": {
    "lint": "eslint \"+(src|test)/**/*.js\" --fix",
    "lint:watch": "npm run watch:js -- -c \"npm run lint\"",
    "watch:js": "chokidar \"+(src|test)/**/*.js\" --initial"
  }
}

Usage with WebStorm

  • Import webstorm-code-style.xml in preferences Editor › Code Style › JavaScript.
  • Deactivate Unterminated statement inspection in preferences Editor › Inspections
1.0.54

1 day ago

1.0.53

2 days ago

1.0.49

2 days ago

1.0.51

2 days ago

1.0.50

2 days ago

1.0.52

2 days ago

1.0.48

4 days ago

1.0.47

4 days ago

1.0.46

4 days ago

1.0.45

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago