Skip to content

Instantly share code, notes, and snippets.

@berkedel
Created April 4, 2016 05:02
Show Gist options
  • Save berkedel/0a9adc92f0673eb18cbe8110bb8b1eb8 to your computer and use it in GitHub Desktop.
Save berkedel/0a9adc92f0673eb18cbe8110bb8b1eb8 to your computer and use it in GitHub Desktop.
How to Configure Text Editors and IDEs for React.js

How to Configure Text Editors and IDEs for React.js img

Tips and tricks on how to configure your favorite text editor or IDE to work with React.js/ES6+/JSX.

WebStorm

Create a new project based on React Starter Kit template

react-project-template-in-webstorm

Make sure that JSX support is enabled in your project. This is set by default, if you create a new project based on React.js template.

jsx-support-in-webstorm

Configure JavaScript libraries for auto-complete

javascript-libraries-in-webstorm

Enable ESLint support

eslint-support-in-webstorm

Enable CSSComb by installing CSSReorder plug-in

csscomb-in-webstorm

If you have trouble with autoreloading try to disable "safe write" in File > Settings > System Settings > Use "safe write" (save chnages to a temporary file first)

Atom

Install atom packages

apm install linter linter-eslint react linter-stylelint

Install local npm packages

npm install --save-dev eslint babel-eslint eslint-plugin-react stylelint

You may need to restart atom for changes to take effect

SublimeText

Install SublimeText packages
Easiest with Package Control and then "Package Control: Install Package" (Ctrl+Shift+P)

You can also use SublimeLinter-contrib-eslint_d for faster linting.

Set Babel as default syntax for a particular extension:

  • Open a file with that extension,
  • Select View from the menu,
  • Then Syntax -> Open all with current extension as... -> Babel -> JavaScript (Babel).
  • Repeat this for each extension (e.g.: .js and .jsx).

Install local npm packages

npm install eslint@latest
npm install babel-eslint@latest
npm install eslint-plugin-react
npm install stylelint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment