Unexpected token ) for function call #13708
-
Tell us about your environment Node version: v10.17.0 What parser (default, Please show your full configuration: Configurationmodule.exports = {
env: {
commonjs: true,
es6: true,
node: true
},
extends: [
'eslint:recommended'
],
parserOptions: {
ecmaVersion: 6,
sourceType: "script",
},
rules: {
'no-console': 'warn',
'no-debugger': 'warn',
'block-scoped-var': "warn",
'no-multi-spaces': "warn",
'array-bracket-newline': ["warn", "consistent"],
'block-spacing': "warn",
'brace-style': ["warn", "1tbs"],
'comma-dangle': ["warn", "always-multiline"],
'comma-spacing': ["warn", {before: false, after: true}],
'comma-style': ["warn", "last"],
'eol-last': ["warn", "always"],
'func-call-spacing': ["warn", "never"],
'indent': ["error", 4],
'key-spacing': ["warn", {mode: "minimum", afterColon: true}],
'keyword-spacing': ["warn", {before: true, after: true}],
'linebreak-style': ["warn", "unix"],
'new-parens': ["warn", "always"],
'newline-per-chained-call': ["warn", {ignoreChainWithDepth: 3}],
'no-lonely-if': "warn",
'no-trailing-spaces': "warn",
'no-unneeded-ternary': "warn",
'no-whitespace-before-property': "warn",
'semi-spacing': ["warn", {before: false, after: true}],
'space-before-blocks': "warn",
'space-before-function-paren': ["warn", {anonymous: "never", named: "never", asyncArrow: "always"}],
'space-infix-ops': ["warn", {"int32Hint": true}],
'space-unary-ops': ["warn", {words: true, nonwords: false}],
'spaced-comment': ["warn", "always"],
}
} What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint. exports.updateActions = function(req, res) {
/* Must have only the changed actions in parameters to be performant TODO IN FRONT*/
const promises = []
for (const action of req.body) {
promises.push(
models.Action.update(action, {
where: {
actionId: action.actionId,
},
}), // Problem is here
)
}
Promise.all(promises).then(() => {
return res.sendStatus(200);
}, err => {
logger.error('%o', err);
res.sendStatus(500);
})
} eslint app/ --ext .js What did you expect to happen? What actually happened? Please include the actual, raw output from ESLint.
/home/simonc/projects/sx-projects-back/app/controllers/actionController.js ✖ 1 problem (1 error, 0 warnings) If I remove the comma (see line "Problem is here") the error disappear but I would like to keep this comma because node understand it correctly and it give better commits (like comma-dangle rule) Are you willing to submit a pull request to fix this bug? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thanks for the issue. Use |
Beta Was this translation helpful? Give feedback.
-
@SimonChaumet
so it can help you |
Beta Was this translation helpful? Give feedback.
Thanks for the issue.
Use
ecmaversion : 2017
or higher.