eslint-config-fixable-all

5.16.0 • Public • Published

eslint-config-fixable-all

Build Status

This is a list of eslint rules which can be fixed automatically by eslint --fix. This configuration specifies all fixable rules as 'error'. So all the fixable rules violation causes linter error and we need to fix them. With this configuration it ensures all the fixable problems should be fixed.

Installation

$ npm install --save-dev eslint eslint-config-fixable-all

Usage

At first, extend this config to your .eslintrc

 {
-    "extends": ["eslint:recommended"]
+    "extends": ["eslint:recommended", "fixable-all"]
 }

And then, after adding your changes, try eslint command

$ git add -A
"$(npm bin)/eslint" .

If some error occurred, try eslint --fix to fix code and see the result

"$(npm bin)/eslint" --fix .
$ git diff

If you don't want to fix or change the fixing behavior, please overwrite the rule in your configuration. For example, if you don't want to add semicolon, overwrite the configuration.

 {
     "extends": ["eslint:recommended", "fixable"],
+    "rules": {
+        "semi": ["error", "never"]
+    }
 }

Or if you don't want to fix semicolon, you can off the configuration.

 {
     "extends": ["eslint:recommended", "fixable"],
+    "rules": {
+        "semi": "off"
+    }
 }

When you want to rollback the fixes, you can simply git checkout.

$ git checkout . # Rollback all fixes in current directory 

After you can accept the fixes, git add -A to add them to Git index.

Versioning

Major version and minor version are synchronized with eslint. For example, eslint-config-fixable-all v3.9.x is compatible with eslint v3.9.x. eslint-config-fixable-all's patch version is not compatible with eslint. But you need not to care about it because eslint follows semantic versioning.

License

MIT License

Package Sidebar

Install

npm i eslint-config-fixable-all

Weekly Downloads

37

Version

5.16.0

License

MIT

Unpacked Size

7.48 kB

Total Files

5

Last publish

Collaborators

  • rhysd