JetBrains / JetBrains/web-types

Add attribute to existing tag

Open
#77 1 comment 0 reactions 1 assignee Claimed by @piotrtomiak View on GitHub
tracked in YouTrack
Dominant language
TypeScript
Stars
306
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Is it possible to add a new attribute to an existing HTML tag?

I have tried the following:
```json
{
"$schema": "https://json.schemastore.org/web-types",
"name": "Foo attribute",
"version": "0.0.1",
"contributions": {
"html": {
"elements": [
{
"name": "Foo attribute on script tag",
"extension": true,
"pattern": {
"or": ["script"]
},
"attributes": [
{
"name": "foo",
"value": {
"required": false
}
}
]
}
]
}
}
}
```

`foo` attribute are now allowed on `script` tags, but existing attributes (e.g. `defer`, `src` etc.) are now marked as errors (in IntelliJ IDEA 2023.3.1 - Build #IU-233.11799.300):

![image](https://github.com/JetBrains/web-types/assets/26788919/c4933185-5fee-4243-b859-af1c3aac2d22)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.