Understanding wrapping of method arguments (object)
gkatsanos opened this issue · 1 comments
gkatsanos commented
Versions:
├─ prettier-eslint@9.0.0
│ └─ prettier@1.18.2
└─ prettier@1.16.3
node: v12.6.0
yarn: 1.17.3
Relevant code or config
{
"printWidth": 130,
"trailingComma": "es5",
"singleQuote": true
}
{
"plugins": [
"vue"
],
"extends": [
"plugin:vue/recommended",
"airbnb-base",
"plugin:prettier/recommended"
],
"env": {
"jest": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018
},
"globals": {
"App": true
},
"settings": {
"import/extensions": [
".vue"
],
"import/resolver": {
"node": {
"paths": ["app/javascript"],
"extensions": [".js", ".vue"]
}
}
},
"rules": {
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"no-underscore-dangle": ["error", { "allow": ["_underlying_vm_", "_componentTag"] }],
"object-shorthand": ["error", "always"],
"no-return-assign": ["error", "except-parens"],
"no-restricted-properties": "off",
"import/prefer-default-export": "off",
"no-shadow": "off",
"no-unused-expressions": "off",
"no-param-reassign": ["error", { "props": false }],
"quotes": ["error", "single"],
"max-len": ["error", {
"code": 130,
"ignoreComments": true,
"ignoreUrls": true
}],
"vue/max-attributes-per-line": [
2,
{
"singleline": 20,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}
]
}
}
What I did:
return new Promise((resolve, reject) => {
response.then(({
data, errors, meta, links,
}) => {
commit(`SET_${storePluralName}`, { resources: data });
if (!pagination && links && links.next) {
dispatch(`FETCH_NEXT_${storePluralName}`, {
nextLink: links.next,
relationships,
}).then(() => resolve({
data, errors, meta, links,
}));
} else {
endLoading(dispatch, `fetch ${resourcePluralName}`);
resolve({
data, errors, meta, links,
});
}
}).catch((error) => {
commit('ADD_API_ERROR', error);
endLoading(dispatch, `fetch ${resourcePluralName}`);
reject(error);
});
});
What happened:
return new Promise((resolve, reject) => {
response
.then(({ data, errors, meta, links }) => {
commit(`SET_${storePluralName}`, { resources: data });
if (!pagination && links && links.next) {
dispatch(`FETCH_NEXT_${storePluralName}`, {
nextLink: links.next,
relationships,
}).then(() =>
resolve({
data,
errors,
meta,
links,
})
);
} else {
endLoading(dispatch, `fetch ${resourcePluralName}`);
resolve({
data,
errors,
meta,
links,
});
}
})
.catch(error => {
commit('ADD_API_ERROR', error);
endLoading(dispatch, `fetch ${resourcePluralName}`);
reject(error);
});
});
Problem description:
Is there a way to tell prettier to not wrap those resolve arguments? I even pushed the printWidth to 1000+ but it's not that.
github-actions commented
Stale issue