8000 Rule proposal: `template/no-restricted-syntax` · Issue #655 · angular-eslint/angular-eslint · GitHub
[go: up one dir, main page]

Skip to content
Rule proposal: template/no-restricted-syntax #655
Closed
@rafaelss95

Description

@rafaelss95

Similar to https://eslint.org/docs/rules/no-restricted-syntax, but for templates. Taking #308 as an example:

{
  "rules": {
    "@angular-eslint/template/no-restricted-syntax": [
      "error",
      {
        "selector": "Element[name='button']:not(:has(:matches(BoundAttribute, TextAttribute)[name='type']))",
        "message": "Missing an explicit type attribute for button"
      },
      {
        "selector": "Element[name='button'] :matches(BoundAttribute, TextAttribute)[name='type'][value!=/^(button|reset|submit)$/]",
        "message": "Invalid value for button type attribute"
      },
    ]
  }
}

Metadata

Metadata

Assignees

Labels

PRs WelcomeIf a high-quality PR is created for this it will be acceptedpackage: eslint-plugin-templateAngular Template rulesrule proposalThis issue is requesting/proposing the creation of a new rule within one of the core plugins

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0