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

readonly-array ignore-local doesn't work well #45

Closed
NN--- opened this issue Sep 20, 2017 · 4 comments
Closed

readonly-array ignore-local doesn't work well #45

NN--- opened this issue Sep 20, 2017 · 4 comments

Comments

@NN---
Copy link

NN--- commented Sep 20, 2017

I expect no errors here, but it still complains.

function f() {
const test: number[] = [];
}
@jonaskello
Copy link
Owner

I added a test to try to reproduce this, see this line. However it did not fail. I also tried your code directly as a separate test-case but no failure.

Not sure why it does not work in your case. Do you have something more in your file?

If you like you can clone the repo and add more tests to the file I referenced above. Then just run yarn test.

@NN---
Copy link
Author

NN--- commented Sep 20, 2017

I'll try to make a minimal sample later today.

I use arrays inside class function. Can this be the trigger?

class A {
  f() {
    const x: number[] = [];
  }
}

jonaskello added a commit that referenced this issue Sep 20, 2017
@jonaskello
Copy link
Owner

Yes, that was indeed it. I use the no-class rule myself so that is why I have not seen this :-).

I have added tests to reproduce and will try to fix this.

@jonaskello
Copy link
Owner

Released in v4.2.1.

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