diff --git a/.eslintrc.js b/.eslintrc.js index 34d3af270c..6cd0e1015e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,6 +13,7 @@ module.exports = { plugins: [ "react", "flowtype", + "babel" ], env: { es6: true, @@ -23,6 +24,11 @@ module.exports = { } }, rules: { + // eslint's built in no-invalid-this rule breaks with class properties + "no-invalid-this": "off", + // so we replace it with a version that is class property aware + "babel/no-invalid-this": "error", + /** react **/ // This just uses the react plugin to help eslint known when // variables have been used in JSX diff --git a/package.json b/package.json index 6e7013fb93..a07e2236aa 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ "babel-preset-react": "^6.11.1", "eslint": "^3.13.1", "eslint-config-google": "^0.7.1", + "eslint-plugin-babel": "^4.0.1", "eslint-plugin-flowtype": "^2.30.0", "eslint-plugin-react": "^6.9.0", "expect": "^1.16.0",