Rule Change: validate `@property` descriptors in `no-invalid-at-rules`
@electrohyun is already working on this.
Since Aug 30, 2026.
Assessment
This issue has not been assessed yet.
Description
What rule do you want to change?
no-invalid-at-rules
What change do you want to make?
Generate more warnings
How do you think the change should be implemented?
A new default behavior
Example code
@property --size {
syntax: "<length>";
inherits: false;
initial-value: red;
}
@property --theme {
syntax: "<not-a-type-name>";
inherits: false;
initial-value: red;
}
What does the rule currently do for this code?
The rule does not report either example.
First example
The rule checks each value separately:
"<length>"is a string, sosyntaxpasses.redis a CSS value, soinitial-valuepasses.- The rule does not check whether
redmatches<length>.
Second example
The rule handles it as follows:
"<not-a-type-name>"is a string, sosyntaxpasses.- The rule does not check the syntax definition inside the string.
What will the rule do after it's changed?
The rule will perform two additional checks.
- Check whether the value inside
syntaxis a valid registered custom property syntax definition. - Check whether a specified
initial-valuematches that syntax.
The first example will report red because a color does not match <length>.
The second example will report "<not-a-type-name>" because that type does not exist.
The rule should not report missing descriptors. In the current specification, all @property descriptors are optional:
syntaxdefaults to"*".inheritsdefaults totrue.initial-valuedefaults to the guaranteed-invalid value.
These examples should remain valid:
@property --anything {
initial-value: red;
}
@property --size {
syntax: "<length>";
}
Participation
- I am willing to submit a pull request to implement this change.
AI acknowledgment
- I did not use AI to generate this issue report.
- (If the above is not checked) I have reviewed the AI-generated content before submitting.
Additional comments
There are existing implementations.
- Stylelint
syntax-string-no-invalidchecks the syntax definition inside the string. - Biome
noInvalidPropertyInitValuechecks whetherinitial-valuematchessyntax.
Disclosure: I'm a participant of open source contribution program OSSCA
- Dominant language
- JavaScript
- Stars
- 308
- Forks
- 44
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 18
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eslint/css
-
accepted enhancement
-
enhancement
-
feature
-
feature
-
feature
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·