Skip to content

[Bug]: react/no-unknown-property doesn't recognize <template shadowrootmode=...> #3912

Closed
@alexeyr-ci2

Description

@alexeyr-ci2

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

shadowrootmode attribute of <template> is in Baseline 2024, so I expected eslint-plugin-react to recognize it.

Code:

package.json:

{
  "type": "module",
  "devDependencies": {
    "@eslint/js": "9.23.0",
    "eslint": "9.23.0",
    "eslint-plugin-react": "7.37.4",
    "react": "19.0.0"
  }
}

eslint.config.js:

import js from "@eslint/js";
import react from "eslint-plugin-react";
export default [
  js.configs.recommended,
  react.configs.flat.recommended,
  react.configs.flat['jsx-runtime'],
  {
    files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
    rules: {
      'react/no-unknown-property': 'error',
     },
  },
];

src/example.jsx:

export const Template = () => (
  <template shadowrootmode="open"></template>
);

results in

Unknown property 'shadowrootmode' found
(react/no-unknown-property)
[2:13-34]

Playground: https://eslint-online-playground.netlify.app/#eNqNUctugzAQ/JWVLyQRjztNoh76Cb3FOSBYUgheI9s0RBH/3rUDkVpFVSSwLc/Mznr2JqwpMxwL1XeYtnYUucCx18ZBqck6+ERGCoewg9UadntYSQLYuuXafhWVvhitndIV7qTQPZIU+222UPaS1m+SRCzQdg25lAvXzYnN2KtRwau1UButQIr3OylrrRSsmnGDRekWyp2R9N1waigJUODOfVdYF0Pn4OAbbe1sZ1ODpVYKqcIq9lAQPtCaW32Bcog4o8QM5BqF0TGwbn4BqJsObQ6HaLPJNumttTFTY8V7yb/z3zjNEi49BPasBYiCV0Y6GehM+kJJbzhK465RDhEao000S2EKB78e78H2RXkuTn5+mjjUUFQKd+1RipxPPBq2kyLopKjw+wN5TBVS2SAH/ejjd/5e6idoOd/Ze0n/X/DPaJ4yn2DhUZImMf0AvA3e4w==

Expected Behavior

shadowrootmode, shadowrootclonable, and shadowrootdelegatesfocus should be recognized (but probably not experimental shadowrootserializable).

eslint-plugin-react version

7.37.4

eslint version

9.23.0

node version

20.16.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions