@kard/esfix
Eslint CLI default configuration and fix utility.
Last updated 2 years ago by kard .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @kard/esfix 
SYNC missed versions from official npm registry.

Esfix

Build Status codecov

Table of Content

Installation

npm i --dev @kard/esfix

Or with yarn

yarn add --dev @kard/esfix

Configuration exaple

In the package.json:

  "scripts": {
    "esfix": "esfix"
  },
  "eslintConfig": {
    "files": [ "src/**/*.js", "src/**/*.jsx" ],
    "fix": true
  }

Notes:

  • The eslintConfig section can be used to rewrite all of the eslint options. Please refer to the Configuration File Formats and Rules pages of eslint documentation.

Command line options

--nolocals - Ignore any local configurations of the analyzed projects. Whet this key is presents, the only internal configuration of the package is using.

--dryrun - No fixes are carried out linting is performed and all of its messages are shown. It's like to run eslint without --fix.

--showconfig - Show summarized config. No checks or fixes are carried out in this case.

Troubleshooting

Different indent sizes

It is especially painful when only indent is rewritten in a separate file (for instance: the main configuration is inside .eslintrc.json while rewrite is placed inside package.json)

Error pattern

error: Expected indentation of ... space characters but found ... (react/jsx-indent-props) at ...

...

11 errors and 1 warning found.
11 errors potentially fixable with the `--fix` option.

Solution: make sure that these rules are in sync.

  "rules": {
    "indent": ["error", 2],
    "react/jsx-indent": [ "error", 2 ],
    "react/jsx-indent-props": [ "error", 2 ]
  }

Current Tags

  • 1.0.2                                ...           latest (2 years ago)

3 Versions

  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 7
Last Day 0
Last Week 1
Last Month 1
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |