1.0.2 • Published 8 years ago
@kard/esfix v1.0.2
Esfix
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 
eslintConfigsection 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 ]
  }