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

[Bug] jsx-no-constructed-context-values empty schema is incorrect #3580

Closed
Dimava opened this issue May 19, 2023 · 1 comment
Closed

[Bug] jsx-no-constructed-context-values empty schema is incorrect #3580

Dimava opened this issue May 19, 2023 · 1 comment

Comments

@Dimava
Copy link

Dimava commented May 19, 2023

https://github.com/jsx-eslint/eslint-plugin-react/blob/747fad0e06e73155616df62575626f7953260dec/lib/rules/jsx-no-constructed-context-values.js#LL141C13-L141C15

jsx-no-constructed-context-values empty schema should be [], but it's {}

This leads to incorrect rule type generation by https://github.com/Shinigami92/eslint-define-config

export interface JsxNoConstructedContextValuesRule {
  /**
   * Disallows JSX context provider values from taking values that will cause needless rerenders.
   *
   * @see [jsx-no-constructed-context-values](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-constructed-context-values.md)
   */
  'react/jsx-no-constructed-context-values': Rule<
    [
      RuleLevel,
      ...{
        [k: string]: any; // <-- `...{}`, explected `...[]` (i.e. no settings)
      },
    ]
  >;
}
@ljharb
Copy link
Member

ljharb commented May 19, 2023

I'm not familiar with that tool, but #3106 fixes that - it'd be a breaking change tho, so it's unlikely we'll ever do it.

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2023
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

2 participants