Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 847 Bytes

File metadata and controls

44 lines (32 loc) · 847 Bytes

@rdlabo/rules/deny-element

This plugin disallows the use of certain HTML tags.

This rule is particularly useful for Ionic applications where you want to enforce the use of Controller-based modals and action sheets instead of inline components.

Rule Details

❌ Incorrect: Using disallowed elements in templates

<ion-modal></ion-modal>
<!-- error -->

✅ Correct: Configure the rule in .eslintrc.json to specify which elements to disallow

Rule Settings

{
  "rules": {
    "@rdlabo/rules/deny-element": [
      "error",
      {
        "elements": ["ion-modal"]
      }
    ]
  }
}

Options

const options: {
  elements: string[]; // Array of element names to disallow
};

Implementation