Giter VIP home page Giter VIP logo

Comments (10)

supasate avatar supasate commented on August 18, 2024 1

@iswanj Go for it

from youpin-bot.

supasate avatar supasate commented on August 18, 2024 1

This repo still uses console a lot. So, I think you can disable it in .eslintrc for now. We may refactor it later.

from youpin-bot.

iswanj avatar iswanj commented on August 18, 2024

@supasate I'll take this

from youpin-bot.

iswanj avatar iswanj commented on August 18, 2024

@supasate I found lint issue in messenger.js. There is lint rule for no-console, so I can dissable lint warn for these specific lines. or is there any other solution ?

if (!error && response.statusCode === 200) {
    console.log('Successfully sent generic message ' +
            `with id ${body.message_id} to recipient ${body
body.recipient_id}`);
} else {
    console.error('Unable to send message.');
    console.error(response);
    console.error(error);
}

from youpin-bot.

iswanj avatar iswanj commented on August 18, 2024

@supasate

refreshToken() {
    // TO-DO: Call /token/auth/refresh instead
    const app = feathers()
      .configure(hooks())
      .configure(rest(this.uri).superagent(request))
      .configure(authentication());

    new Promise((resolve, reject) => {
      app.authenticate({
        type: 'local',
        'email': this.username,
        'password': this.password
      }).then(result => {
        this.token = app.get('token');
        resolve(this);
      }).catch(error => {
        console.log(error);
        reject(error);
      });
    });
  }

Inside refreshToken function, getting an eslint warn for "no-new" ( Do not use new for side effects ). So I'm gonna ignore "no-new" rull, any thoughts...?

from youpin-bot.

iswanj avatar iswanj commented on August 18, 2024

Also found another error "Fatal Parsing error: Unexpected token" on
let context = await (conversation.getContext(userid));
on this line

from youpin-bot.

ephys avatar ephys commented on August 18, 2024

@iswanj The "no new for side effect" warning is there because wrapping the call to app.authenticate in a promise is useless (as app.authenticate already returns a Promise, plus the resulting promise is unused). The code could be written like this:

app.authenticate({
  type: 'local',
  'email': this.username,
  'password': this.password
}).then(result => {
  this.token = app.get('token');
}).catch(error => {
  console.log(error);
});

from youpin-bot.

supasate avatar supasate commented on August 18, 2024

@iswanj For parsing error of await, you can eslint-disable-line.

The reason is we use asyncawait which async and await are functions that take another functions as arguments. (They just make them look alike keywords but they are, literally, functions).

That's different from async and await in ES7 which are keywords.

Therefore, eslint expects the following ES7 format:

onMessaged: async (event) => {
  ...
  await conversation.getContext(userid)
}

We may refactor it later when we move to ES7.

from youpin-bot.

iswanj avatar iswanj commented on August 18, 2024

@supasate I think eslint-disable-line is working for the rules only.

from youpin-bot.

supasate avatar supasate commented on August 18, 2024

You're right. So, I think we can left it unless we find a workaround.

from youpin-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.