diff --git a/README.md b/README.md index 068c5f077..e2eb4d909 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,13 @@ For automatic formatting, install **[vscode-standard-format][vscode-2]**. [vscode-1]: https://marketplace.visualstudio.com/items/chenxsan.vscode-standardjs [vscode-2]: https://marketplace.visualstudio.com/items/chenxsan.vscode-standard-format +#### [WebStorm/PhpStorm][webstorm-1] + +Both WebStorm and PhpStorm can be [configured for Standard Style][webstorm-2]. + +[webstorm-1]: https://www.jetbrains.com/webstorm/ +[webstorm-2]: docs/webstorm.md + ### What you might do if you're clever 1. Add it to `package.json` diff --git a/docs/webstorm.md b/docs/webstorm.md new file mode 100644 index 000000000..6d15ece51 --- /dev/null +++ b/docs/webstorm.md @@ -0,0 +1,44 @@ +# [WebStorm/PhpStorm][webstorm-1] configuration for Standard Style + +1. Turn off your IDE +2. [Figure out where your configuration lives][webstorm-2] (_IDE Settings_ section) +3. Navigate to `your-config-dir/codestyles` +4. Create a `Standard.xml` file: + + ```xml + + + + + + + + + ``` + +5. If you don't want to clutter your project with extra dependencies and config files, then go global: + + - `npm install -g eslint eslint-config-standard eslint-plugin-standard` (`sudo` might be required) + - `echo '{"extends": ["standard"]}' > ~/.eslintrc` (be warned: it overrides an existing file) + +6. If you're OK with local dependencies and config, do (5) without `-g` and `~/` +7. Fire up the IDE and open a _Settings_/_Preferences_ screen (choose between project and default settings accordingly to your preference) +8. Under `Editor > Code Style > JavaScript` change `Scheme` to `Standard` +9. Under `Editor > Inspections > JavaScript > Code style issues` untick `Unterminated statement` +10. Under `Languages & Frameworks > JavaScript > Code Quality Tools > ESLint` just select `Enable`, only in rare cases you'll have to configure `ESLint package` path + +[webstorm-1]: https://www.jetbrains.com/webstorm/ +[webstorm-2]: https://www.jetbrains.com/webstorm/help/project-and-ide-settings.html