Skip to content
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

Add a language field to RuleMetadata #2801

Closed
Tracked by #2797
ematipico opened this issue May 10, 2024 · 4 comments · Fixed by #2811
Closed
Tracked by #2797

Add a language field to RuleMetadata #2801

ematipico opened this issue May 10, 2024 · 4 comments · Fixed by #2811
Assignees
Labels
good first issue Good for newcomers S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@ematipico
Copy link
Member

ematipico commented May 10, 2024

@togami2864 did try to add this, however it was added as an enum, which is too specific.

We should add language as a plain static string.

Once this is done, you could update all the rules to add something like this to the macro that creates the rules:

declare_rule! {
    /// docs
    pub NoInteractiveElementToNoninteractiveRole {
        version: "1.3.0",
        name: "noInteractiveElementToNoninteractiveRole",
        sources: &[RuleSource::EslintJsxA11y("no-interactive-element-to-noninteractive-role")],
        recommended: true,
        fix_kind: FixKind::Unsafe,
+		language: "js",
    }
}

Here's an example on how to add a new field https://github.com/biomejs/biome/pull/426/files#diff-751854fcf56fd7d9a4e543a10dc6f9916f618964ad5a1facb22a5bf1ee619852R67

@ematipico ematipico added good first issue Good for newcomers S-Help-wanted Status: you're familiar with the code base and want to help the project labels May 10, 2024
@dyc3
Copy link
Contributor

dyc3 commented May 10, 2024

I could take this one.

@Conaclos
Copy link
Member

did try to add this, however it was added as an enum, which is too specific.

Why is this too specific?

@dyc3
Copy link
Contributor

dyc3 commented May 10, 2024

It would probably be more difficult to allow biome plugins for languages we don't already support?

@ematipico
Copy link
Member Author

did try to add this, however it was added as an enum, which is too specific.

Why is this too specific?

biome_analyze is a language-agnostic crate and should stay like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants