Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit 5653499

Browse files
Merge pull request #19 from strvcom/webstorm-autofix
Add WebStorm autofix on save tutorial
2 parents a681325 + 6f86c26 commit 5653499

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tutorial/editor-integrations.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,16 @@ WebStorm has built-in support for ESLint issue reporting. Auto fixing is only su
7373
To enable ESLint reporter, [follow the guide][webstorm-eslint] on WebStorm's support page.
7474
To use the new autofix feature, [read their blog post][webstorm-eslint-autofix] on the topic.
7575

76-
> The autofix feature must be manually triggered, ie. no autofix-on-save. However, this is still much better than fixing all the issues by hand... ✍️
77-
76+
To use autofix on save feature
77+
1. Go to `Preferences` -> `Tools` -> `File watchers`
78+
2. Click to add (plus) button and choose custom template
79+
3. Name it for example `eslint`
80+
4. File type `javascript`
81+
5. Program will be your path to eslint binary for example `/Users/[yourusername]/git/[yourproject]/node_modules/.bin/eslint`
82+
6. Arguments `--fix $FilePath$`
83+
7. Working directory `$ProjectFileDir$`
84+
8. Show console `never` (if you don't want to see console when --fix command find eslint errors)
85+
9. Check `Trigger watcher regardless of syntax errors` and uncheck `Immediate file synchronization`
7886

7987
[atom-linter]: https://atom.io/packages/linter
8088
[atom-linter-eslint]: https://atom.io/packages/linter-eslint

0 commit comments

Comments
 (0)