8000 [@angular-eslint/template/button-has-type] support allowList · Issue #2193 · angular-eslint/angular-eslint · GitHub
[go: up one dir, main page]

Skip to content
8000

[@angular-eslint/template/button-has-type] support allowList #2193

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

Closed
splincode opened this issue Jan 9, 2025 · 4 comments · Fixed by #2326
Closed

[@angular-eslint/template/button-has-type] support allowList #2193

splincode opened this issue Jan 9, 2025 · 4 comments · Fixed by #2326
Labels
enhancement New feature or request package: eslint-plugin-template Angular Template rules PRs Welcome If a high-quality PR is created for this it will be accepted

Comments

@splincode
Copy link

We want use

'@angular-eslint/template/button-has-type': [
    'error',
    {
        allowList: [
            'tuiAccordion',
        ],
    },
],

instead of

'@angular-eslint/template/button-has-type': 'error',

Because we have

<button tuiAccordion>Item</button>

where tuiAccordion has default type

image

@splincode splincode added package: eslint-plugin-template Angular Template rules triage This issue needs to be looked at and categorized by a maintainer labels Jan 9, 2025
@splincode splincode changed the title [rulename] support allowList to @angular-eslint/template/button-has-type [@angular-eslint/template/button-has-type] support allowList Jan 9, 2025
@reduckted
Copy link
Contributor

This would be quite handy. In one of the codebases I work in, I have a directive that does the same thing - sets the type property automatically. I've had to disable this rule because the directive is so widely used that I'd have to disable it via comments in so many places.

@JamesHenry JamesHenry added PRs Welcome If a high-quality PR is created for this it will be accepted and removed triage This issue needs to be looked at and categorized by a maintainer labels Mar 8, 2025
@JamesHenry
Copy link
Member

Thanks I'd happily accept a PR for this. Is allowList the most appropriate name? 🤔

Maybe something allowedWhenUsingDirectives: string[] or something like that? Any better suggestions?

@JamesHenry
Copy link
Member

The same kind of discussion is warranted here: #1996

@JamesHenry JamesHenry added the enhancement New feature or request label Mar 8, 2025
@reduckted
Copy link
Contributor

Maybe something allowedWhenUsingDirectives: string[] or something like that? Any better suggestions?

Maybe "ignore" instead of "allow"?

  • ignoreWithDirectives
  • ignoreWhenUsingDirectives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request package: eslint-plugin-template Angular Template rules PRs Welcome If a high-quality PR is created for this it will be accepted
Projects
None yet
3 participants
0