-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Add warnings for various unbound attributes in Razor #84760
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
Merged
davidwengier
merged 10 commits into
dotnet:main
from
davidwengier:combined-razor-warnings
Aug 7, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
976f185
Warn for unknown component parameters
davidwengier 951d52a
Test unknown component parameter warnings
davidwengier b6bf351
Warn for invalid component bind parameters
davidwengier 48ca0c0
Test invalid component bind warnings
davidwengier c42a12d
Warn for unbound directive attributes
davidwengier 57af91d
Test unbound directive attribute warnings
davidwengier fa9bbf0
Document Razor warning levels
davidwengier 329e4da
Address unknown component parameter review feedback
davidwengier 5c2ea02
Merge branch 'main' into combined-razor-warnings
davidwengier 042ba7e
Preserve directive attribute candidates when cloning
davidwengier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Razor warning levels | ||
|
|
||
| Razor diagnostics introduced in warning waves are assigned a non-zero warning level. A diagnostic | ||
| is reported when its level is less than or equal to the configured `RazorWarningLevel`. See the | ||
| [warning levels proposal](WarningWavesProposal.md) for the design and configuration details. | ||
|
|
||
| ## Warnings | ||
|
|
||
| | Diagnostic | Warning level | Message | When reported | | ||
| |------------|---------------|---------|---------------| | ||
| | `RZ3907` | 11 | `The '@model' directive is not applied to the generated base class because the '@inherits' directive does not contain '<TModel>'.` | An MVC view has an explicit `@model` directive and an `@inherits` directive without the literal `<TModel>` placeholder. | | ||
| | `RZ10025` | 11 | `The component '{0}' does not have a parameter named '{1}'.` | An explicit attribute on a resolved component does not bind to a known component parameter, and no valid capture-unmatched-values parameter can accept it. | | ||
| | `RZ10026` | 11 | `The bind attribute '{0}' does not match any parameter on component '{1}'.` | A component `@bind-*` attribute has a statically known target name that does not match a component parameter. | | ||
| | `RZ10027` | 11 | `The bind attribute '{0}' requires a matching change parameter named '{1}' on component '{2}'.` | A component bind target exists, but its statically known companion change parameter does not. | | ||
| | `RZ10028` | 11 | `The attribute '{0}' could not be bound to any directive attribute.` | A parser-recognized directive attribute in a component document reaches tag-helper resolution without any semantic bound-attribute match. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.