Wondergrauf
Wondergrauf

Reputation: 168

IntelliJ WebStorm Angular animation highlight

I've a trouble with WebStorm syntax highlight. Now it shows an error and I don't really know why. You can see error text on attached screenshot.

Trouble screenshot

Angular animation function which one cause this error here:

export function SwipeAnimation(axis: 'x' | 'y', time: string) {
  switch (axis) {
    case 'x': {
      return trigger('Swipe', [
        transition(':enter', [
          style({
            width: 0
          }),
          animate(`${time} ease-in`)
        ]),
        transition(':leave', [
          animate(`${time} ease-out`, style({width: 0}))
        ])
      ]);
    }
    case 'y': {
      return trigger('Swipe', [
        transition(':enter', [
          style({
            height: 0
          }),
          animate(`${time} ease-in`)
        ]),
        transition(':leave', [
          animate(`${time} ease-out`, style({height: 0}))
        ])
      ]);
    }
    default: {
      break;
    }
  }
}

Yes, this function works fine. But this error annoys me. Also I've another animation in this project which ones function looks same but there is no error when I use it (as you can see on attached screenshot).

Any ideas for fix this trouble?

Upvotes: 1

Views: 82

Answers (1)

lena
lena

Reputation: 93728

The error comes from Angular language service. The actual error must be Function calls are not supported in decorators but 'SwipeAnimation' was called. Not sure why it's displayed this way - must be an issue with Angular/TypeScript/WebStorm integration. You can get rid of the error by turning the service off in Settings | Languages & Frameworks | TypeScript, Angular language service

Upvotes: 1

Related Questions