passport.use(new Discord.Strategy({ passReqToCallback: true, ...config.discord }, (req, accessToken, refreshToken, profile, done) => {
r.table('users').insert(profile, { conflict: 'replace' }).run((error) => {
if (error) return done(error, null);
done(null, profile);
});
}));
/Users/jacobgunther/Documents/equinoxbot.xyz/src/auth.js
12:63 error Parsing error: Unexpected token ..
Just to let you know, this is what the spread operator is used for:
const object = {
a: 1,
b: 2,
c: 3
console.log({ d: 4, ...object }); // { a: 1, b: 2, c: 3, d: 4}
Hi, @platinumazure , Object Rest/Spread Properties
is a feature of ECMAScript 6.
Why setting { "env":{ "es6": true } }
can't support this?
A little confused, I'll be appreciated if you give me a hint.
Hi @mapleeit, ES6 introduced array spread and function rest parameters, but object rest/spread is not part of ES6. Object rest was introduced in ES2018.
Our parser has supported an experimental syntax for rest/spread since that proposal was in Stage 2. Also, I'm sure babel-eslint has supported it for a while. However, object rest/spread did not officially enter the language until ES2018.
Here https://eslint.org/docs/user-guide/configuring it's specified the following:
ecmaVersion - set to 3, 5 (default), 6, 7, 8, or 9 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), or 2018 (same as 9) to use the year-based naming.
Setting ecmaVersion to 9 or 2018 with ESLint 5.0.1 doesn't help:
"extends": [
"eslint:recommended",
"google"
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module"
provides:
6:47 error 'Set' is not defined no-undef
36:10 error Expected parentheses around arrow function argument arrow-parens
37:13 error Expected parentheses around arrow function argument arrow-parens
like 9 or 2018 versions are not recognized. What can be the reason?
UPD: Had to add env.eslint like so:
"env": {
"es6": true
"extends": [
"eslint:recommended",
"google"
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module"
and it helped.
archived due to age
This issue has been archived; please open a new issue for any further discussion
label
Oct 31, 2018
archived due to age
This issue has been archived; please open a new issue for any further discussion
question
This issue asks a question about ESLint