Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.01 KB

no-forbidden-elements.md

File metadata and controls

55 lines (38 loc) · 1.01 KB

no-forbidden-elements

✅ The extends: 'recommended' property in a configuration file enables this rule.

This rule disallows the use of forbidden elements in template files.

The rule is configurable so teams can add their own disallowed elements. The default list of forbidden elements are meta, style, html and script.

Examples

This rule forbids the following:

<script></script>
<style></style>
<html></html>
<meta charset="utf-8">

This rule allows the following:

<header></header>
<div></div>
<head>
  <meta charset="utf-8">
</head>

Configuration

  • boolean - true to enable / false to disable
    • array -- an array of strings to forbid, default: ['meta', 'style', 'html', 'script']
    • object -- An object with the following keys:
      • forbidden -- An array of forbidden element names

References