Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while parsing TS file with mixin #422

Closed
adros opened this issue Oct 5, 2017 · 2 comments
Closed

Error while parsing TS file with mixin #422

adros opened this issue Oct 5, 2017 · 2 comments

Comments

@adros
Copy link

adros commented Oct 5, 2017

I get this error,

TypeError: Cannot read property 'text' of undefined at /home/UX/arakovskyux/workspaces/pvzp-clfe/node_modules/codelyzer/noAttributeParameterDecoratorRule.js:52:42
    at /home/UX/arakovskyux/workspaces/pvzp-clfe/node_modules/codelyzer/util/function.js:26:59
    at Maybe.bind (/home/UX/arakovskyux/workspaces/pvzp-clfe/node_modules/codelyzer/util/function.js:21:20)
    at Maybe.fmap (/home/UX/arakovskyux/workspaces/pvzp-clfe/node_modules/codelyzer/util/function.js:26:21)
    at /home/UX/arakovskyux/workspaces/pvzp-clfe/node_modules/codelyzer/noAttributeParameterDecoratorRule.js:50:14
    at Object.validate (/home/UX/arakovskyux/workspaces/pvzp-clfe/node_modules/codelyzer/walkerFactory/walkerFn.js:18:82)
    at /home/UX/arakovskyux/workspaces/pvzp-clfe/node_modules/codelyzer/walkerFactory/walkerFn.js:53:27
    at Array.forEach (native)
    at class_1.visitNode (/home/UX/arakovskyux/workspaces/pvzp-clfe/node_modules/codelyzer/walkerFactory/walkerFn.js:51:28)
    at /home/UX/arakovskyux/workspaces/pvzp-clfe/node_modules/tslint/lib/language/walker/syntaxWalker.js:535:63`

when my code contains declaration of a mixin
(https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#typescript-22)

E.g. something like this

type Constructor<T> = new (...args: any[]) => T;

export function MyUtils<T extends Constructor<{}>>(Base: T) {
  return class extends Base {
    public myMethod(a, b): boolean {
      ....
    }
  };
}

It may be related to issue #28.

I am using latest version 3.2.0

@mgechev
Copy link
Owner

mgechev commented Oct 5, 2017

@adros thanks for sharing the issue. I'll take a look at it today.

@mgechev
Copy link
Owner

mgechev commented Oct 5, 2017

The issue is fixed. The PR should be merged soon #423.

mgechev added a commit that referenced this issue Oct 5, 2017
* fix(rules): handle anonymous class

Fix #422

* style: add missing semicolon
@mgechev mgechev added this to the 3.2.1 - Ada Lovelace milestone Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants