native and have a problem with configuring eslint. This is my .eslintrc.js.
module.exports = {
"extends": "airbnb",
"parser": "babel-eslint",
"env": {
"jest": true,
},
"plugins": [
"react",
"node"
],
"rules": {
"no-use-before-define": "off",
"react/jsx-filename-extension": "off",
"node/no-unsupported-features/es-syntax": ["error", {
"version": ">=6.0.0",
"ignores": ["modules", "destructuring"]
}],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/prop-types": "off",
}
};
In App.js,
const { navigation } = this.props;
I got the eslint error.
[eslint] Destructuring are not supported yet on Node 4.0.0. (node/no-unsupported-features)
[eslint] 'navigation' is missing in props validation (react/prop-types)
And also in In App.js,
<View style={styles.container}>
<UpArrow title="cancel" />
<SecondsSpinner seconds={this.state.imageTime} changeImageTime={this.changeImageTime} />
<DownArrow title="save" />
</View>
I got error
[eslint] JSX not allowed in files with extension '.js' (react/jsx-filename-extension)
So I
But they dosen't work. I don't know why and how to solve this. Is there any other file to config eslint? Thanks in advance.
EDIT1) "ignores": ["modules"] works. so weird.
EDIT2) I am using vscode and got errors on the editor on and on, so I thought because of .eslintrc file. But now I think it's problem of vscode. I set
"eslint.options": { "configFile": "/Users/com/vscode/AwesomeProject/.eslintrc.js" }
in Workspace Settings then it works
Try:
module.exports = {
"extends": "airbnb",
"parser": "babel-eslint",
"env": {
"jest": true,
},
"plugins": [
"react",
"node"
],
"rules": {
"no-use-before-define": 0,
"react/jsx-filename-extension": 0,
"node/no-unsupported-features/es-syntax": ["error", {
"version": ">=6.0.0",
"ignores": ["modules", "destructuring"]
}],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/prop-types": 0,
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With