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

eslint-disable-line doesn't work in JSX #841

Closed
hibikine opened this issue Aug 13, 2019 · 3 comments · Fixed by #703
Closed

eslint-disable-line doesn't work in JSX #841

hibikine opened this issue Aug 13, 2019 · 3 comments · Fixed by #703
Labels
bug Something isn't working has pr there is a PR raised to close this package: parser Issues related to @typescript-eslint/parser

Comments

@hibikine
Copy link

hibikine commented Aug 13, 2019

What code were you trying to parse?

.eslintrc

{
  "parser": "@typescript-eslint/parser",
  "parserOptions": { "sourceType": "module" },
  "plugins": ["react"],
  "rules": {
    "react/no-array-index-key": 2
  }
}

index.tsx

import * as React from 'react';

export default () =>
  [1, 2, 3].map((v, i) => (
    <p
      key={i} // eslint-disable-line react/no-array-index-key
    >
      {v}
    </p>
  ));

The sample project is https://github.com/hibikine/typescript-test .

What did you expect to happen?
No error.

What actually happened?
react/no-array-index-key error happen.

Versions

package version
@typescript-eslint/parser 1.13.0 (1.10.3-alpha.9 and above confirmed)
TypeScript 3.5.3
ESLint 5.16.0
node 10.16.0
npm 6.9.0
@hibikine hibikine added package: parser Issues related to @typescript-eslint/parser triage Waiting for maintainers to take a look labels Aug 13, 2019
@hibikine hibikine changed the title eslint-disable-line doesn't work in JSX [react/no-array-index-key]eslint-disable-line doesn't work in JSX Aug 13, 2019
@hibikine hibikine changed the title [react/no-array-index-key]eslint-disable-line doesn't work in JSX [react/no-array-index-key] eslint-disable-line doesn't work in JSX Aug 13, 2019
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels Aug 13, 2019
@bradzacher bradzacher changed the title [react/no-array-index-key] eslint-disable-line doesn't work in JSX eslint-disable-line doesn't work in JSX Aug 13, 2019
@bradzacher bradzacher added the has pr there is a PR raised to close this label Aug 13, 2019
@bradzacher
Copy link
Member

Known issue, will be fixed by #703

@hibikine
Copy link
Author

OK, Thanks @bradzacher!

@bradzacher
Copy link
Member

#703 has been merged into master. Closing this (I put the wrong issue num into the Fixes comment >.<)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working has pr there is a PR raised to close this package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants