@miraclesoft/linter

0.0.5 • Public • Published

@miraclesoft/linter

version license

ESLint based Command Line Utility for usage within JavaScript based projects

Note: This is a beta version of this formatter created for internal use by Miracle Apps, Miracle Software Systems, Inc.'s internal app development wing. Please submit any issues (or) feedback here.

Usage

Install as a dev-dependency with npm (or) yarn,

npm install @miraclesoft/linter --save-dev

(or)

yarn install @miraclesoft/linter --save-dev

You can then use the tool from the command line. Alternatively you can install the linter globally, but it is not advised at this point of time.

Note : The linter cli will look for a eslint config file and if running with --staged option will look for a git repository to be initialized

Run with --staged

Running with --staged will only run the linter on .js files that are staged for a git commit.

./node_modules/.bin/linter --staged

When run with --staged all auto-fixed files will be re-staged by git as well

./node_modules/.bin/linter --staged fix

Adding the fix option in the command will use eslint with auto-fix mode

Run with --all

Running with --all will run the linter on all .js files in the project.

./node_modules/.bin/linter --all

./node_modules/.bin/linter --all fix

Adding the fix option in the command will use eslint with auto-fix mode

Usage with Husky

If you are using Husky in your projects for pre-commit git hooks, then you can use this linter as a single command in your configuration.

"husky": {
    "hooks": {
      "pre-commit": "./node_modules/.bin/linter --staged fix"
    }
  }

Lint Report

When run, the formatter will output a HTML report in /reports/lint-report.html

Here is a preview for the HTML Report

The report is generated using the @miraclesoft/eslint-formatter-html custom formatter - read more.

Contributors

  • Chanakya Lokam - Director Innovation | Miracle Software Systems, Inc.
  • Geetha Krishan Adhikari - Sr. Full Stack Engineer | Miracle Software Systems, Inc.

License

© 2020 Miracle Software Systems, Inc.

Licensed under the MIT License.

Package Sidebar

Install

npm i @miraclesoft/linter

Weekly Downloads

66

Version

0.0.5

License

MIT

Unpacked Size

15.2 kB

Total Files

9

Last publish

Collaborators

  • sbendalam
  • clokam