Skip to content

Commit

Permalink
fix codegen GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vasucp1207 authored and Conaclos committed Nov 13, 2023
1 parent 7205568 commit 1a4c382
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 47 deletions.
1 change: 1 addition & 0 deletions crates/biome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ define_categories! {
"lint/nursery/useGroupedTypeImport": "https://biomejs.dev/linter/rules/use-grouped-type-import",
"lint/nursery/useImportRestrictions": "https://biomejs.dev/linter/rules/use-import-restrictions",
"lint/nursery/useShorthandAssign": "https://biomejs.dev/linter/rules/use-shorthand-assign",
"lint/nursery/useValidAriaRole": "https://biomejs.dev/lint/rules/use-valid-aria-role",
"lint/performance/noAccumulatingSpread": "https://biomejs.dev/linter/rules/no-accumulating-spread",
"lint/performance/noDelete": "https://biomejs.dev/linter/rules/no-delete",
"lint/security/noDangerouslySetInnerHtml": "https://biomejs.dev/linter/rules/no-dangerously-set-inner-html",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,24 @@ declare_rule! {
///
/// Source: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-role.md
///
///
/// ## Examples
///
/// ### Invalid
///
/// ```js,expect_diagnostic
/// <div role="datepicker"></div>
/// ```
/// ```js,expect_diagnostic
/// <div role="datepicker"></div>
/// ```
///
/// ```js,expect_diagnostic
/// <div role="range"></div>
/// ```
/// ```js,expect_diagnostic
/// <div role="range"></div>
/// ```
///
/// ```js,expect_diagnostic
/// <div role=""></div>
/// ```js,expect_diagnostic
/// <div role=""></div>
/// ```
///
/// ```js,expect_diagnostic
/// <Foo role="foo"></Foo>
/// <Foo role="foo"></Foo>
/// ```
///
/// ### Valid
Expand All @@ -56,16 +55,18 @@ declare_rule! {
/// {
/// "//": "...",
/// "options": {
/// "allowInvalidRoles": ["invalid", "text"],
/// "allowInvalidRoles": ["invalid-role", "text"],
/// "nonIgnoreDom": true
/// }
/// }
/// ```
///
/// ## Accessibility guidelines
///
/// - [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
///
/// ## Resources
///
/// - [Chrome Audit Rules, AX_ARIA_01](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_01)
/// - [DPUB-ARIA roles](https://www.w3.org/TR/dpub-aria-1.0/)
/// - [MDN: Using ARIA: Roles, states, and properties](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques)
Expand Down Expand Up @@ -146,7 +147,6 @@ impl Rule for UseValidAriaRole {
}

let role_attribute = node.find_attribute_by_name("role")?;

let role_attribute_static_value = role_attribute.as_static_value()?;
let role_attribute_value = role_attribute_static_value.text();
let mut role_attribute_value = role_attribute_value.split(' ');
Expand All @@ -165,7 +165,6 @@ impl Rule for UseValidAriaRole {

fn diagnostic(ctx: &RuleContext<Self>, _: &Self::State) -> Option<RuleDiagnostic> {
let node = ctx.query();

Some(
RuleDiagnostic::new(
rule_category!(),
Expand All @@ -184,9 +183,7 @@ impl Rule for UseValidAriaRole {
let node = ctx.query();
let mut mutation = ctx.root().begin();
let role_attribute = node.find_attribute_by_name("role")?;

mutation.remove_node(role_attribute);

Some(JsRuleAction {
category: ActionCategory::QuickFix,
applicability: Applicability::MaybeIncorrect,
Expand Down
24 changes: 18 additions & 6 deletions crates/biome_service/src/configuration/linter/rules.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ hooks_incorrect_options.json:6:5 deserialize ━━━━━━━━━━━
- useGroupedTypeImport
- useImportRestrictions
- useShorthandAssign
- useValidAriaRole



Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ hooks_missing_name.json:6:5 deserialize ━━━━━━━━━━━━━
- useGroupedTypeImport
- useImportRestrictions
- useShorthandAssign
- useValidAriaRole



2 changes: 1 addition & 1 deletion website/src/components/generated/NumberOfRules.astro

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1a4c382

Please sign in to comment.