-
Notifications
You must be signed in to change notification settings - Fork 1
feat(lint): improve deprecated api migration rules #58
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| <template name="Page Header" prefix="page-header" description="Basic page-header layout." type="pattern"> | ||||||
| <nve-page-header slot="header"> | ||||||
| <nve-logo slot="prefix" size="sm"></nve-logo> | ||||||
| <nve-logo slot="prefix" size="sm">NV</nve-logo> | ||||||
| <h2 slot="prefix">${1:NVIDIA}</h2> | ||||||
| </nve-page-header> | ||||||
| </template> | ||||||
|
|
@@ -11,7 +11,7 @@ <h2 slot="prefix">${1:NVIDIA}</h2> | |||||
| description="Basic page-header layout with links." | ||||||
| type="pattern"> | ||||||
| <nve-page-header slot="header"> | ||||||
| <nve-logo slot="prefix" size="sm"></nve-logo> | ||||||
| <nve-logo slot="prefix" size="sm">NV</nve-logo> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding aria-label to the snippet template. Since these snippets establish patterns for developers, including ♿ Suggested accessibility improvement- <nve-logo slot="prefix" size="sm">NV</nve-logo>
+ <nve-logo slot="prefix" size="sm" aria-label="NVIDIA">NV</nve-logo>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| <h2 slot="prefix">${1:NVIDIA}</h2> | ||||||
| <nve-button selected container="flat"><a href="#">${2:Link 1}</a></nve-button> | ||||||
| <nve-button container="flat"><a href="#">${3:Link 2}</a></nve-button> | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -55,6 +55,10 @@ describe('noMissingSlottedElements', () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `<nve-button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| button | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </nve-button>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `<nve-logo> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <img src="./logo.svg" alt="NVIDIA" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </nve-logo>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `<nve-logo>NV</nve-logo>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `<nve-input>\${}</nve-input>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `<nve-input>{{ }}</nve-input>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `<nve-input>{% %}</nve-input>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -139,6 +143,22 @@ describe('noMissingSlottedElements', () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it('should report logos missing default slot content', () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tester.run('logos missing default slot content', rule, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| valid: [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| invalid: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| code: `<nve-logo></nve-logo>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| errors: [{ messageId: 'missing-default-slot-content', data: { tagName: 'nve-logo' } }] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| code: `<nve-logo><span slot="prefix">NV</span></nve-logo>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| errors: [{ messageId: 'missing-default-slot-content', data: { tagName: 'nve-logo' } }] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+146
to
+160
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a whitespace-only You already enforce this for Proposed test diff it('should report logos missing default slot content', () => {
tester.run('logos missing default slot content', rule, {
valid: [],
invalid: [
{
code: `<nve-logo></nve-logo>`,
errors: [{ messageId: 'missing-default-slot-content', data: { tagName: 'nve-logo' } }]
},
+ {
+ code: `<nve-logo> </nve-logo>`,
+ errors: [{ messageId: 'missing-default-slot-content', data: { tagName: 'nve-logo' } }]
+ },
{
code: `<nve-logo><span slot="prefix">NV</span></nve-logo>`,
errors: [{ messageId: 'missing-default-slot-content', data: { tagName: 'nve-logo' } }]
}
]
});
});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it('should report custom required elements', () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tester.run('unexpected use of missing slotted elements', rule, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| valid: [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding aria-label to the snippet template.
Since these snippets establish patterns for developers, including
aria-label="NVIDIA"would promote accessible implementations.♿ Suggested accessibility improvement
📝 Committable suggestion
🤖 Prompt for AI Agents