diff --git a/docs/rules/element-newline.md b/docs/rules/element-newline.md index a0d2a4ee..79424461 100644 --- a/docs/rules/element-newline.md +++ b/docs/rules/element-newline.md @@ -1,12 +1,10 @@ -# @html-eslint/element-newline +# element-newline -Enforce newline between elements. +This rule enforces newlines between tags. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/element-newline": "error", @@ -16,8 +14,6 @@ module.exports = { ## Rule Details -This rule enforces newline between elements. - Examples of **incorrect** code for this rule: @@ -39,9 +35,21 @@ Examples of **correct** code for this rule: ### Options -This rule has an object option. +This rule has an object option: + +- `"skip"`: skips newline checking for the specified element's children. + +```ts +//... +"@html-eslint/element-newline": ["error", { + "skip": Array +}] +``` -- `skip`: Specifies an array of tag names. Newlines are not checked for children elements of the specified tags. +#### skip + +You can specify list of tag names in the `skip` option. +Newline checking is not performed on children of the specified tags. Examples of **correct** code for the `{ "skip": ["pre", "code"] }` option: @@ -50,8 +58,11 @@ Examples of **correct** code for the `{ "skip": ["pre", "code"] }` option:
     
+``` + +```html -
+
``` diff --git a/docs/rules/id-naming-convention.md b/docs/rules/id-naming-convention.md index 4c130902..df01973c 100644 --- a/docs/rules/id-naming-convention.md +++ b/docs/rules/id-naming-convention.md @@ -1,12 +1,10 @@ -# @html-eslint/id-naming-convention +# id-naming-convention -- Enforce naming conventions for id attributes. +This rule enforces consistent naming convention for `id` attribute values. ## How to use -.eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/id-naming-convention": "error", @@ -16,8 +14,7 @@ module.exports = { ## Rule Details -This rule enforces naming conventions for id attributes. -It supports 4 naming cases. `camelCase`, `snake_case`, `PascalCase`, `kebab-case` (default `snake_case`). +This rule supports 4 naming cases. `camelCase`, `snake_case`, `PascalCase`, `kebab-case` (default `snake_case`). ### Options @@ -82,6 +79,6 @@ Examples of **correct** code for this rule with the `"kebab-case"` option:
``` -## Further reading +## Further Reading [Wiki - Naming convention]() diff --git a/docs/rules/indent.md b/docs/rules/indent.md index 218a269a..5d92fd4f 100644 --- a/docs/rules/indent.md +++ b/docs/rules/indent.md @@ -1,12 +1,10 @@ -# @html-eslint/indent +# indent -Enforce consistent indentation. +This rule enforces consistent indentation. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/indent": "error", @@ -16,11 +14,14 @@ module.exports = { ## Rule Details -This rule enforces consistent indentation styles. The default indent is `4 spaces`. - ### Options -This rule has two options +```ts +//... +"@html-eslint/indent": ["error", "tab" | number] +``` + +This rule has two options. - `number(0, 1, ..)` (default 4): requires the use of indentation with specified number of spaces. @@ -42,7 +43,7 @@ Examples of **correct** code for this rule: ``` -#### space +#### number (default: 4) If the option is number it means the number of spaces for indentation. @@ -54,9 +55,10 @@ If the option is number it means the number of spaces for indentation. Examples of **incorrect** code for this rule with the `"2"` option: + ```html - + ``` @@ -68,8 +70,6 @@ Examples of **correct** code for this rule with the `"2"` option: ``` - - #### tab If the option is `"tab"` it means using `tab` for indentation. @@ -82,9 +82,10 @@ If the option is `"tab"` it means using `tab` for indentation. Examples of **incorrect** code for this rule: + ```html - + ``` @@ -92,9 +93,6 @@ Examples of **correct** code for this rule: ```html - - - - + ``` diff --git a/docs/rules/lowercase.md b/docs/rules/lowercase.md index 0d632792..e72ebe04 100644 --- a/docs/rules/lowercase.md +++ b/docs/rules/lowercase.md @@ -1,17 +1,10 @@ ---- -id: lowercase -title: "lowercase" ---- - # lowercase -Enforce to use lowercase for tag and attribute names. +This rule enforces to use lowercase for tag and attribute names. ## How to use -.eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/lowercase": "error", diff --git a/docs/rules/no-abstract-roles.md b/docs/rules/no-abstract-roles.md index e4379347..6c6b7766 100644 --- a/docs/rules/no-abstract-roles.md +++ b/docs/rules/no-abstract-roles.md @@ -1,10 +1,10 @@ -# @html-eslint/no-abstract-roles +# no-abstract-roles -Disallow use of abstract roles. +This rule disallows use of abstract roles. -- .eslintrc.js +## How to use -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-abstract-roles": "error", @@ -44,6 +44,6 @@ Examples of **correct** code for this rule:
``` -## Further reading +## Further Reading - [HTML spec - Abstract Roles](https://www.w3.org/TR/wai-aria-1.0/roles#abstract_roles) diff --git a/docs/rules/no-accesskey-attrs.md b/docs/rules/no-accesskey-attrs.md index d421f22b..e3db4de0 100644 --- a/docs/rules/no-accesskey-attrs.md +++ b/docs/rules/no-accesskey-attrs.md @@ -1,14 +1,15 @@ -# @html-eslint/no-accesskey-attrs +# no-accesskey-attrs -Disallow accesskey attributes. +This rule disallows use of `accesskey` attributes. -Access keys are HTML attributes that allow web developers to assign keyboard shortcuts to elements. Inconsistencies between keyboard shortcuts and keyboard commands used by screenreader and keyboard only users create accessibility complications so to avoid complications, access keys should not be used. +## Why? -## How to use +`accesskey` attributes allow web developers to assign keyboard shortcuts to elements. +Inconsistencies between keyboard shortcuts and keyboard commands used by screenreader and keyboard only users create accessibility complications so to avoid complications, access keys should not be used. -- .eslintrc.js +## How to use -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-accesskey-attrs": "error", @@ -18,8 +19,6 @@ module.exports = { ## Rule Details -This rule disallows the use of `accesskey` attributes. - Examples of **incorrect** code for this rule: ```html @@ -32,6 +31,6 @@ Examples of **correct** code for this rule:
``` -## Further reading +## Further Reading -- [MDN - accesskey](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey) +- [MDN: accesskey](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey) diff --git a/docs/rules/no-aria-hidden-body.md b/docs/rules/no-aria-hidden-body.md index 6899ad7a..03116f0f 100644 --- a/docs/rules/no-aria-hidden-body.md +++ b/docs/rules/no-aria-hidden-body.md @@ -1,12 +1,17 @@ -# @html-eslint/no-aria-hidden-body +# no-aria-hidden-body -Disallow to use aria-hidden attributes on the `body` element. +This rule disallows the use of `aria-hidden` attribute on the `body`. -## How to use +## Why? + +The `aria-hidden` attribute is typically used to hide elements from assistive technologies (such as screen readers) when they are not intended to be perceived by users. -- .eslintrc.js +When `aria-hidden`="true" is applied to the `` element, it removes the entire content of the document from the accessibility tree. +This means that assistive technologies will not perceive any of the content within the ``, making the entire page inaccessible to users who rely on screen readers or other assistive technologies. -```js +## How to use + +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-aria-hidden-body": "error", @@ -16,8 +21,6 @@ module.exports = { ## Rule Details -This rule disallows the use of aria-hidden attributes on the `body` element. - Examples of **incorrect** code for this rule: ```html @@ -32,6 +35,6 @@ Examples of **correct** code for this rule: ``` -## Further reading +## Further Reading -- [MDN - Using the aria-hidden attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-hidden_attribute) +- [MDN: Using the aria-hidden attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-hidden_attribute) diff --git a/docs/rules/no-duplicate-attrs.md b/docs/rules/no-duplicate-attrs.md index 46f52154..c3b6a25f 100644 --- a/docs/rules/no-duplicate-attrs.md +++ b/docs/rules/no-duplicate-attrs.md @@ -1,12 +1,15 @@ -# @html-eslint/no-duplicate-attrs +# no-duplicate-attrs Disallow duplicate attributes. -## How to use +## Why? + +The HTML specification mandates that attribute names must be unique within a single HTML element. +Violating this rule results in non-compliance with the standard. -- .eslintrc.js +## How to use -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-duplicate-attrs": "error", diff --git a/docs/rules/no-duplicate-id.md b/docs/rules/no-duplicate-id.md index 089ae374..b45cbeae 100644 --- a/docs/rules/no-duplicate-id.md +++ b/docs/rules/no-duplicate-id.md @@ -1,12 +1,10 @@ -# @html-eslint/no-duplicate-id +# no-duplicate-id -Disallow duplicate `id` attributes. +This rule disallows duplicate `id` attributes. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-duplicate-id": "error", @@ -16,8 +14,6 @@ module.exports = { ## Rule Details -This rule disallow the use of duplicate `id` attributes. - Examples of **incorrect** code for this rule: ```html @@ -32,6 +28,6 @@ Examples of **correct** code for this rule:
``` -## Further reading +## Further Reading -- [MDN - id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) +- [MDN: id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) diff --git a/docs/rules/no-extra-spacing-attrs.md b/docs/rules/no-extra-spacing-attrs.md index 68064066..4fa325d1 100644 --- a/docs/rules/no-extra-spacing-attrs.md +++ b/docs/rules/no-extra-spacing-attrs.md @@ -1,12 +1,10 @@ -# @html-eslint/no-extra-spacing-attrs +# no-extra-spacing-attrs -Disallow extra spaces around attributes. +This rule disallows extra spaces around attributes. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-extra-spacing-attrs": "error", @@ -16,8 +14,6 @@ module.exports = { ## Rule Details -This rule disallows the use of extra spaces around attributes. - Examples of **incorrect** code for this rule: diff --git a/docs/rules/no-inline-styles.md b/docs/rules/no-inline-styles.md index b9d07c47..d316a313 100644 --- a/docs/rules/no-inline-styles.md +++ b/docs/rules/no-inline-styles.md @@ -1,12 +1,21 @@ -# @html-eslint/no-inline-styles +# no-inline-styles -Disallow inline styles. +This rule disallows the use of inline styles. -## How to use +## Why? + +Using inline styles in HTML is generally considered bad practice for several reasons: -- .eslintrc.js +- **Readability and Maintainability**: + - Inline styles can make the HTML code less readable and harder to maintain, especially as the project grows. It becomes challenging to identify and manage styles applied to different elements when they are scattered throughout the HTML. +- **Reusability**: + - Inline styles don't promote code reuse. If you want the same style applied to multiple elements, you have to duplicate the inline style for each element. This can lead to redundancy and increases the chances of errors. +- **CSS Specificity Issues**: + - Inline styles have a high level of specificity, making it harder to override them with external or internal styles. This can lead to unexpected styling behavior and conflicts. + +## How to use -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-inline-styles": "error", @@ -16,8 +25,6 @@ module.exports = { ## Rule Details -This rule disallows the use of inline styles. - Examples of **incorrect** code for this rule: ```html @@ -29,7 +36,3 @@ Examples of **correct** code for this rule: ```html
``` - -## Further reading - -- [MDN - id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) diff --git a/docs/rules/no-multiple-empty-lines.md b/docs/rules/no-multiple-empty-lines.md index 9217c0aa..975d89a6 100644 --- a/docs/rules/no-multiple-empty-lines.md +++ b/docs/rules/no-multiple-empty-lines.md @@ -1,12 +1,10 @@ -# @html-eslint/no-multiple-empty-lines +# no-multiple-empty-lines -Disallow use of multiple empty lines. +This rule disallows use of multiple empty lines. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-multiple-empty-lines": "error", @@ -24,8 +22,7 @@ This rule disallows the use of empty lines which exceeded the maximum lines allo Examples of **incorrect** code for this rule with the default `{ "max": 2 }` option: - - + ```html
@@ -34,17 +31,12 @@ Examples of **incorrect** code for this rule with the default `{ "max": 2 }` opt
``` - - Examples of **correct** code for this rule with the default `{ "max": 2 }` option: - - + ```html
``` - - diff --git a/docs/rules/no-multiple-h1.md b/docs/rules/no-multiple-h1.md index 536e1af2..8ff0ac00 100644 --- a/docs/rules/no-multiple-h1.md +++ b/docs/rules/no-multiple-h1.md @@ -1,12 +1,10 @@ -# @html-eslint/no-multiple-h1 +# no-multiple-h1 -Disallow multiple `

`. +This rule disallows multiple `

`. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-multiple-h1": "error", @@ -16,7 +14,7 @@ module.exports = { ## Rule Details -This rule disallows the use of multiple `

` tags. +This rule disallows the use of multiple `

` tags. Examples of **incorrect** code for this rule: @@ -39,6 +37,6 @@ Examples of **correct** code for this rule: ``` -## Further reading +## Further Reading - [MDN - heading elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements) diff --git a/docs/rules/no-non-scalable-viewport.md b/docs/rules/no-non-scalable-viewport.md index de5539ed..f113bbca 100644 --- a/docs/rules/no-non-scalable-viewport.md +++ b/docs/rules/no-non-scalable-viewport.md @@ -1,14 +1,12 @@ -# @html-eslint/no-non-scalable-viewport +# no-non-scalable-viewport -Disallow use of `user-scalable=no` in ``. +This rule disallows use of `user-scalable=no` in ``. The `user-scalable=no` disables zooming on a page. It makes users with partial vision or low vision hard to read web content. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-non-scalable-viewport": "error", @@ -18,8 +16,6 @@ module.exports = { ## Rule Details -This rule disallow use of `user-scalable-no` in ``. - Examples of **incorrect** code for this rule: ```html @@ -42,6 +38,6 @@ Examples of **correct** code for this rule: ``` -## Further reading +## Further Reading -- [MDN - Viewport meta tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag) +- [MDN: Viewport meta tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag) diff --git a/docs/rules/no-obsolete-tags.md b/docs/rules/no-obsolete-tags.md index 8e43e184..39febbe0 100644 --- a/docs/rules/no-obsolete-tags.md +++ b/docs/rules/no-obsolete-tags.md @@ -1,6 +1,8 @@ -# @html-eslint/no-obsolete-tags +# no-obsolete-tags -Disallow using obsolete tags in HTML5. +This rule disallows using obsolete tags in HTML5. + +## Why? The following element list is obsoleted in HTML5. It's not encouraged to use these tags. @@ -11,9 +13,7 @@ applet, acronym, bgsound, dir, frame, frameset, noframes, isindex, keygen, listi ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-obsolete-tags": "error", @@ -32,6 +32,6 @@ Examples of **incorrect** code for this rule: ``` -## Further reading +## Further Reading - [html spec 16.2. Non-conforming features](https://html.spec.whatwg.org/#non-conforming-features) diff --git a/docs/rules/no-positive-tabindex.md b/docs/rules/no-positive-tabindex.md index e4637d69..ab4329b4 100644 --- a/docs/rules/no-positive-tabindex.md +++ b/docs/rules/no-positive-tabindex.md @@ -1,12 +1,18 @@ -# @html-eslint/no-positive-tabindex +# no-positive-tabindex -Disallow use of positive `tabindex` attribute. +This rule disallows use of positive `tabindex` attribute. -## How to use +## Why? -- .eslintrc.js +n HTML, the `tabindex` attribute is used to specify the tab order of elements when navigating through a page using the "Tab" key. +By default, elements are included in the tab order based on their position in the HTML source code. The `tabindex` attribute allows you to modify this order. -```js +It's generally a good practice to let the natural flow of elements in the HTML dictate the tab order whenever possible. +Setting explicit `tabindex` values should be used sparingly and only when there's a specific reason to deviate from the default order. + +## How to use + +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-positive-tabindex": "error", @@ -16,8 +22,6 @@ module.exports = { ## Rule Details -This rule disallows use of positive `tabindex` attribute. - Examples of **incorrect** code for this rule: ```html diff --git a/docs/rules/no-restricted-attr-values.md b/docs/rules/no-restricted-attr-values.md index 6debd0b9..d0fad9de 100644 --- a/docs/rules/no-restricted-attr-values.md +++ b/docs/rules/no-restricted-attr-values.md @@ -1,12 +1,10 @@ -# @html-eslint/no-restricted-attr-values +# no-restricted-attr-values -Disallow specified attribute values. +This rule disallows use of specified attribute values. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { '@html-eslint/no-restricted-attr-values': ["error", { diff --git a/docs/rules/no-restricted-attrs.md b/docs/rules/no-restricted-attrs.md index 9f0bf3ef..417b922c 100644 --- a/docs/rules/no-restricted-attrs.md +++ b/docs/rules/no-restricted-attrs.md @@ -1,12 +1,10 @@ -# @html-eslint/no-restricted-attrs +# no-restricted-attrs -Disallow specified attributes. +This rule disallows use of specified attributes. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-restricted-attrs": [ diff --git a/docs/rules/no-script-style-type.md b/docs/rules/no-script-style-type.md index b34c4b15..4568f9fb 100644 --- a/docs/rules/no-script-style-type.md +++ b/docs/rules/no-script-style-type.md @@ -1,15 +1,17 @@ ---- -id: no-script-style-type -title: "no-script-style-type" ---- - # no-script-style-type -Enforce to omit default type attributes for style sheets and scripts. +This rule disallows the use of `type` attributes for style sheets (unless not using CSS) and scripts (unless not using JavaScript). + +## Why? + +Specifying below tag's `type` attributes is not necessary as HTML5 implies `text/css` and `text/javascript` as defaults + +- script - `type="text/javascript"` +- style, link - `type="text/css"` -.eslintrc.js +## How to use -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-script-style-type": "error", @@ -20,10 +22,6 @@ module.exports = { ## Rule Details This rule disallows the use of `type` attributes for style sheets (unless not using CSS) and scripts (unless not using JavaScript). -Specifying below `type` attributes is not necessary as HTML5 implies `text/css` and `text/javascript` as defaults - -- script - `type="text/javascript"` -- style, link - `type="text/css"` Examples of **incorrect** code for this rule: @@ -57,6 +55,6 @@ Examples of **correct** code for this rule: ``` -## Further reading +## Further Reading - [Google HTML/CSS Style Guide - type Attributes](https://google.github.io/styleguide/htmlcssguide.html#type_Attributes) diff --git a/docs/rules/no-skip-heading-levels.md b/docs/rules/no-skip-heading-levels.md index 65f93dc4..792c3aeb 100644 --- a/docs/rules/no-skip-heading-levels.md +++ b/docs/rules/no-skip-heading-levels.md @@ -1,12 +1,10 @@ -# @html-eslint/no-skip-heading-levels +# no-skip-heading-levels -Disallow skipping heading levels. +This rule disallows skipping heading levels. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-skip-heading-levels": "error", @@ -16,8 +14,6 @@ module.exports = { ## Rule Details -This rule disallows skipping heading levels. - Examples of **incorrect** code for this rule: ```html @@ -40,6 +36,6 @@ Examples of **correct** code for this rule: ``` -## Further reading +## Further Reading - [MDN - heading elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements) diff --git a/docs/rules/no-target-blank.md b/docs/rules/no-target-blank.md index dc2fe25e..8e5fd349 100644 --- a/docs/rules/no-target-blank.md +++ b/docs/rules/no-target-blank.md @@ -1,12 +1,10 @@ -# @html-eslint/no-target-blank +# no-target-blank -Disallow usage of unsafe `target='_blank'`. +This rule disallows usage of unsafe `target='_blank'`. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-target-blank": "error", diff --git a/docs/rules/no-trailing-spaces.md b/docs/rules/no-trailing-spaces.md index 2828ff54..5024c017 100644 --- a/docs/rules/no-trailing-spaces.md +++ b/docs/rules/no-trailing-spaces.md @@ -1,12 +1,10 @@ -# @html-eslint/no-trailing-spaces +# no-trailing-spaces -Disallow trailing white spaces at the end of lines. +This rule disallows trailing white spaces at the end of lines. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/no-trailing-spaces": "error", @@ -16,8 +14,6 @@ module.exports = { ## Rule Details -This rule disallows trailing white spaces (spaces, tabs) at the end of lines. - Examples of **incorrect** code for this rule: ```html diff --git a/docs/rules/quotes.md b/docs/rules/quotes.md index 03b2248f..f37ae4e0 100644 --- a/docs/rules/quotes.md +++ b/docs/rules/quotes.md @@ -1,12 +1,10 @@ -# @html-eslint/quotes +# quotes -Enforce consistent quoting attributes with double(`"`) or single(`'`) +This rule enforces consistent quoting attributes with double(`"`) or single(`'`) ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/quotes": "error", @@ -16,8 +14,6 @@ module.exports = { ## Rule Details -This rule enforces the consistent use of double(`"`) or single(`'`) quotes for element attributes. - ### Options This rule has two options @@ -57,6 +53,6 @@ Examples of **correct** code for this rule with the default `"single"` option:
``` -## Further reading +## Further Reading - [MDN - Quoting attributes](https://developer.mozilla.org/en-US/docs/MDN/Guidelines/Code_guidelines/HTML#Quoting_attributes) diff --git a/docs/rules/require-attrs.md b/docs/rules/require-attrs.md index e4e06b72..3996f8dd 100644 --- a/docs/rules/require-attrs.md +++ b/docs/rules/require-attrs.md @@ -1,12 +1,10 @@ -# @html-eslint/require-attrs +# require-attrs -Enforces the use of tag with specified attributes. +This rule enforces the use of tag with specified attributes. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/require-attrs": [ @@ -22,8 +20,6 @@ module.exports = { ## Rule Details -This rule enforces use of tag with specified attributes. - ### Options This rule takes a array of object which has tag name with attribute name. diff --git a/docs/rules/require-button-type.md b/docs/rules/require-button-type.md index cf7e7fe9..b7babe50 100644 --- a/docs/rules/require-button-type.md +++ b/docs/rules/require-button-type.md @@ -1,6 +1,6 @@ -# @html-eslint/require-button-type +# require-button-type -Require use of button element with a valid type attribute. +This rule enforces to use of button element with a valid type attribute.(`"button"`, `"submit"`, `"reset"`) ## How to use @@ -16,8 +16,6 @@ module.exports = { ## Rule Details -This rule enforces use of a valid type attribute for button elements. (`"button"`, `"submit"`, `"reset"`) - Examples of **incorrect** code for this rule: @@ -34,6 +32,6 @@ Examples of **correct** code for this rule: ``` -## Further reading +## Further Reading - [HTML spec - the button element](https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-type) diff --git a/docs/rules/require-closing-tags.md b/docs/rules/require-closing-tags.md index 334b1ff5..812319b7 100644 --- a/docs/rules/require-closing-tags.md +++ b/docs/rules/require-closing-tags.md @@ -1,6 +1,6 @@ -# @html-eslint/require-closing-tags +# require-closing-tags -Require use of closing tag. +This rule enforces closing tag. ## How to use @@ -16,8 +16,6 @@ module.exports = { ## Rule Details -This rule checks whether the tag has closing tag or not. - Examples of **incorrect** code for this rule: @@ -108,6 +106,6 @@ Examples of **correct** code for the `{ "allowSelfClosingCustom": true }` option ``` -## Further reading +## Further Reading - [Void Elements](https://html.spec.whatwg.org/multipage/syntax.html#void-elements) diff --git a/docs/rules/require-doctype.md b/docs/rules/require-doctype.md index bb383162..c17aa3c6 100644 --- a/docs/rules/require-doctype.md +++ b/docs/rules/require-doctype.md @@ -1,12 +1,10 @@ -# @html-eslint/require-doctype +# require-doctype -Require `` in the document. +This rule enforces to use `` in the document. ## How to use -- .eslintrc.js - -```js +```js,.eslintrc.js module.exports = { rules: { "@html-eslint/require-doctype": "error", @@ -16,8 +14,6 @@ module.exports = { ## Rule Details -This rule enforces the ``. - Examples of **incorrect** code for this rule: ```html @@ -31,6 +27,6 @@ Examples of **correct** code for this rule: ``` -## Further reading +## Further Reading - [MDN - Doctype](https://developer.mozilla.org/en-US/docs/Glossary/Doctype) diff --git a/docs/rules/require-frame-title.md b/docs/rules/require-frame-title.md index 57cf6109..d8a645c1 100644 --- a/docs/rules/require-frame-title.md +++ b/docs/rules/require-frame-title.md @@ -1,12 +1,16 @@ -# @html-eslint/require-frame-title +# require-frame-title -Require `title` attribute in `` and `