4

I am trying to write a server and I keeping typescript error that I cannot supress:

enter image description here

As you can see I already try to use ts-ignore but it does not supress the error, what am I doing wrong?

enter image description here

Here is my code:

// @ts-ignore
const ⛄ = (fn) => {
  return (req, res, next) => {
    return fn(req, res, next).catch((err) => {
      return next(err);
    });
  };
};

EDIT: Yes, this Unicode is valid Javascript variable name: EDIT 2: Apparently ⛄ is not valid, alrighty then.

Bill Software Engineer
  • 7,362
  • 23
  • 91
  • 174

2 Answers2

1

According to the JavaScript variable name validator it's an invalid identifier:

enter image description here

If you still think it should be valid, then maybe a defect report is the next step.

1

"That’s an invalid identifier according to ECMAScript 6 / Unicode 8.0.0."

You are getting a javascript error, not a typescript one.

Also.. I don't think naming variables with emojis is good coding practice.

https://mothereff.in/js-variables#%E2%9B%84

kess
  • 1,204
  • 8
  • 19