React, Emmet, ESLint, Babel Packages

First make sure you have the following packages added to your project:

npm install --save-dev babel-eslint eslint eslint-config-airbnb eslint-plugin-react eslint-plugin-jsx-a11y eslint-plugin-import mocha

On a fresh instal of Sublime text install the following with package control.

  • Babel
  • Emmet
  • SublimeLinter
  • SublimeLinter-contrib-eslint

After installation restart Sublime.  Now your files will have linting on them so you can see how nasty your code is. 😉

Sample .eslintrc for refference

{
  "parser": "babel-eslint",
  "extends": "airbnb",
  "env": {
    "browser": true,
    "node": true,
    "mocha": true
  },
 "parserOptions": {
    "ecmaVersion": 6,
    "sourceType": "module",
    "ecmaFeatures": {
      "forOf": true,
      "jsx": true,
      "es6": true,
      "experimentalObjectRestSpread" : true
    }
  },
  "rules": {
    "comma-dangle": 0,
    "indent": 0,
    "react/prop-types": 0,
    "react/jsx-indent-props" : 0,
    "linebreak-style": 0,
    "react/jsx-closing-bracket-location" : 0,
    "object-curly-spacing" : 0,
    "arrow-body-style": 0,
    "no-console": 0,
    "max-len": 0,
    "prefer-template": 0,
    "import/no-unresolved": 0,
    "global-require": 0,
    "no-underscore-dangle": 0
  },
  "plugins": [
    "react"
  ],
  "globals": {
    "__DEVSERVER__": true,
    "__DEVCLIENT__": true
  }
}

 

Tell me what you REALLY think...

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>