when extending airbnb's eslint plugin along with prettier eslint and running it on this code:
const foo = (paramA, paramB, paramC) => {
return Object.keys(paramB.prop.nestedProp[0])
.filter(attribute => paramC.includes(attribute))
.map(attribute => {
return Object.keys(paramB.prop.nestedProp[0][attribute]).map(
attributeKey => {
return {
key: `${paramA.name} ${paramB.type} ${attribute} ${attributeKey}`,
value: paramB.prop.nestedProp[0][attribute][attributeKey],
}
}
)
})
}
which is ugly but working
I obtain this code:
const foo = (paramA, paramB, paramC) =>
Object.keys(paramB.prop.nestedProp[0])
.filter(attribute => paramC.includes(attribute))
.map(attribute =>
Object.keys(paramB.prop.nestedProp[0][attribute]).map(attributeKey => ({
key: `${paramA.name} ${paramB.type} ${attribute} ${attributeKey}`,
value: paramB.prop.nestedProp[0][attribute][attributeKey],
})
)
which is missing a ) at the end.
my eslint config is this
{
"parser": "babel-eslint",
"plugins": ["prettier", "react", "jest"],
"env": {
"browser": true,
"node": true,
"jasmine": true,
"jest/globals": true
},
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"import/resolver": {
"webpack": {
"config": "webpack.common.js"
}
}
},
"rules": {},
"extends": ["airbnb", "plugin:prettier/recommended"]
}
Now this may have nothing to do with airbnb (if so feel free to close) but I thought this would be of interest to you.
when extending airbnb's eslint plugin along with prettier eslint and running it on this code:
which is ugly but working
I obtain this code:
which is missing a
)at the end.my eslint config is this
{ "parser": "babel-eslint", "plugins": ["prettier", "react", "jest"], "env": { "browser": true, "node": true, "jasmine": true, "jest/globals": true }, "parserOptions": { "ecmaVersion": 2017, "sourceType": "module", "ecmaFeatures": { "jsx": true } }, "settings": { "import/resolver": { "webpack": { "config": "webpack.common.js" } } }, "rules": {}, "extends": ["airbnb", "plugin:prettier/recommended"] }Now this may have nothing to do with airbnb (if so feel free to close) but I thought this would be of interest to you.