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

The prop value with an expression type of TSPrivateIdentifier could not be resolved. #112

Open
AriPerkkio opened this issue Sep 15, 2021 · 5 comments

Comments

@AriPerkkio
Copy link
Contributor

I'm seeing some logging related to TSPrivateIdentifier while testing eslint-plugin-jsx-a11y.

https://github.com/AriPerkkio/eslint-remote-tester/actions/workflows/lint-eslint-plugin-jsx-a11y.yml

2021-09-09T05:45:12.5777054Z The prop value with an expression type of TSPrivateIdentifier could not be resolved. Please file issue to get this fixed immediately.
2021-09-09T05:45:13.4113986Z The prop value with an expression type of TSPrivateIdentifier could not be resolved. Please file issue to get this fixed immediately.

Minimal repro:

import React from "react";

export class MyLink extends React.Component {
  #urls = { submit: "/submit" };

  render() {
    return <a href={this.#urls.submit}>Submit</a>;
  }
}
{
  "root": true,
  "env": {
    "es6": true
  },
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": 2020,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true
    }
  },
  "settings": {
    "react": {
      "version": "16.13.1"
    }
  },
  "extends": ["plugin:jsx-a11y/recommended"]
}
{
  "scripts": {
    "lint": "eslint index.tsx"
  },
  "devDependencies": {
    "@typescript-eslint/parser": "^4.31.1",
    "eslint": "7.32.0",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "7.21.5",
    "react": "16",
    "typescript": "^4.4.3"
  }
}
@ljharb
Copy link
Member

ljharb commented Sep 15, 2021

oof, why would they use a different node type for a standard thing? thanks, i'll take a look

@ljharb
Copy link
Member

ljharb commented Sep 15, 2021

Unfortunately this repo doesn't have any TS testing yet, so I'm not sure how easy it'll be to reproduce.

@ljharb
Copy link
Member

ljharb commented Sep 15, 2021

Seems like maybe the TS eslint parser doesn't yet support class private fields? typescript-eslint/typescript-eslint#1666 cc @bradzacher

The implication is that it shouldn't work until v5 is released (eslint's default parser won't support it until eslint v8)

@bradzacher
Copy link

bradzacher commented Sep 15, 2021

Yup - v5 of ts-eslint will support it fully, but that won't be released until ESLint v8 releases (as we're waiting until all of the v8 breaking changes have settled so we don't have to do multiple majors).

Also (as you mentioned) ESLint v8 will also come with support private fields.

Relevant issue is typescript-eslint/typescript-eslint#3430

@jessebeach jessebeach added this to the 2021 Fixing Spree milestone Dec 5, 2021
@jdeniau
Copy link

jdeniau commented May 13, 2022

Same here, but without "TS":

The prop value with an expression type of PrivateIdentifier could not be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants