fix eslint's no-invalid-this rule for class properties

This commit is contained in:
Aviral Dasgupta 2017-02-16 16:49:00 +05:30
parent 1f77534b32
commit 0e66b370d4
No known key found for this signature in database
GPG key ID: 5FD1E9F4FFD3DA80
2 changed files with 7 additions and 0 deletions

View file

@ -13,6 +13,7 @@ module.exports = {
plugins: [ plugins: [
"react", "react",
"flowtype", "flowtype",
"babel"
], ],
env: { env: {
es6: true, es6: true,
@ -23,6 +24,11 @@ module.exports = {
} }
}, },
rules: { 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 **/ /** react **/
// This just uses the react plugin to help eslint known when // This just uses the react plugin to help eslint known when
// variables have been used in JSX // variables have been used in JSX

View file

@ -90,6 +90,7 @@
"babel-preset-react": "^6.11.1", "babel-preset-react": "^6.11.1",
"eslint": "^3.13.1", "eslint": "^3.13.1",
"eslint-config-google": "^0.7.1", "eslint-config-google": "^0.7.1",
"eslint-plugin-babel": "^4.0.1",
"eslint-plugin-flowtype": "^2.30.0", "eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-react": "^6.9.0", "eslint-plugin-react": "^6.9.0",
"expect": "^1.16.0", "expect": "^1.16.0",