Skip to content

Instantly share code, notes, and snippets.

@cosemansp
Last active August 2, 2017 08:27
Show Gist options
  • Save cosemansp/76494e56b6717a037b4e034af40cedfc to your computer and use it in GitHub Desktop.
Save cosemansp/76494e56b6717a037b4e034af40cedfc to your computer and use it in GitHub Desktop.

install babel-eslint

npm i babel-eslint --save-dev

.eslintrc

{
  "parser": "babel-eslint",
  "ecmaFeatures": {
      "modules": true,
      "experimentalDecorators": true
  }
}

jsconfig.json

{
  
  "compilerOptions": {
  	"target": "es6",
  	"experimentalDecorators": true
  },
  "exclude": [
  	"node_modules",
  	"bower_components",
  	"jspm_packages",
  	"tmp",
  	"temp"
  ]
}

add airbnb style guide

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

{
  "parser": "babel-eslint",
  "env": {
      "browser": true,
      "node": true
  },
  "extends": "airbnb/base",
  "ecmaFeatures": {
      "modules": true,
      "experimentalDecorators": true
  },
  "rules": {
      "new-cap": 1
  }
}

eslint disable

/* eslint-disable */
var obj = { key: 'value', }; // I don't care about IE8
/* eslint-enable */

/*eslint-disable no-alert */
alert('doing awful things');
/* eslint-enable no-alert */

additional information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment