4.10.2 • Published 2 months ago

eslint-plugin-github v4.10.2

Weekly downloads
29,015
License
MIT
Repository
github
Last release
2 months ago

eslint-plugin-github

Installation

npm install --save-dev eslint eslint-plugin-github

Setup

Add github to your list of plugins in your ESLint config.

JSON ESLint config example:

{
  "plugins": ["github"]
}

Extend the configs you wish to use.

JSON ESLint config example:

{
  "extends": ["plugin:github/recommended"]
}

The available configs are:

  • internal
    • Rules useful for github applications.
  • browser
    • Useful rules when shipping your app to the browser.
  • react
    • Recommended rules for React applications.
  • recommended
    • Recommended rules for every application.
  • typescript
    • Useful rules when writing TypeScript.

Component mapping (Experimental)

Note: This is experimental and subject to change.

The react config includes rules which target specific HTML elements. You may provide a mapping of custom components to an HTML element in your eslintrc configuration to increase linter coverage.

By default, these eslint rules will check the "as" prop for underlying element changes. If your repo uses a different prop name for polymorphic components provide the prop name in your eslintrc configuration under polymorphicPropName.

{
  "settings": {
    "github": {
      "polymorphicPropName": "asChild",
      "components": {
        "Box": "p",
        "Link": "a"
      }
    }
  }
}

This config will be interpreted in the following way:

  • All <Box> elements will be treated as a p element type.
  • <Link> without a defined as prop will be treated as a a.
  • <Link as='button'> will be treated as a button element type.

Rules

💼 Configurations enabled in.\ 🔍 Set in the browser configuration.\ 🔐 Set in the internal configuration.\ ⚛️ Set in the react configuration.\ ✅ Set in the recommended configuration.\ 🔧 Automatically fixable by the --fix CLI option.\ ❌ Deprecated.

Name                                       Description💼🔧
a11y-aria-label-is-well-formattedaria-label text should be formatted as you would visual text.⚛️
a11y-no-generic-link-textdisallow generic link text
a11y-no-title-attributeGuards against developers using the title attribute⚛️
a11y-no-visually-hidden-interactive-elementEnsures that interactive elements are not visually hidden⚛️
a11y-role-supports-aria-propsEnforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role.⚛️
a11y-svg-has-accessible-nameSVGs must have an accessible name⚛️
array-foreachenforce for..of loops over Array.forEach
async-currenttargetdisallow event.currentTarget calls inside of async functions🔍
async-preventdefaultdisallow event.preventDefault calls inside of async functions🔍
authenticity-tokendisallow usage of CSRF tokens in JavaScript🔐
get-attributedisallow wrong usage of attribute names🔍🔧
js-class-nameenforce a naming convention for js- prefixed classes🔐
no-blurdisallow usage of Element.prototype.blur()🔍
no-d-nonedisallow usage the d-none CSS class🔐
no-datasetenforce usage of Element.prototype.getAttribute instead of Element.prototype.datalist🔍
no-dynamic-script-tagdisallow creating dynamic script tags
no-implicit-buggy-globalsdisallow implicit global variables
no-inner-htmldisallow Element.prototype.innerHTML in favor of Element.prototype.textContent🔍
no-innerTextdisallow Element.prototype.innerText in favor of Element.prototype.textContent🔍🔧
no-thenenforce using async/await syntax over Promises
no-useless-passivedisallow marking a event handler as passive when it has no effect🔍🔧
prefer-observersdisallow poorly performing event listeners🔍
require-passive-eventsenforce marking high frequency event handlers as passive🔍
unescaped-html-literaldisallow unescaped HTML literals🔍
4.10.2

2 months ago

4.10.1

7 months ago

4.10.0

8 months ago

4.9.0

10 months ago

4.9.2

10 months ago

4.9.1

10 months ago

4.8.0

11 months ago

4.7.0

1 year ago

4.6.1

1 year ago

4.4.1

1 year ago

4.4.0

2 years ago

4.6.0

1 year ago

4.5.0

1 year ago

4.3.7

2 years ago

4.3.6

2 years ago

4.3.4

2 years ago

4.3.5

2 years ago

4.3.3

2 years ago

4.3.2

3 years ago

4.3.1

3 years ago

0.0.0-dev

3 years ago

4.3.0

3 years ago

4.2.0

3 years ago

4.1.4

3 years ago

4.1.5

3 years ago

4.1.3

3 years ago

4.1.2

3 years ago

4.1.1

4 years ago

4.1.0

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

4.0.0-1

4 years ago

4.0.0-0

4 years ago

3.4.1

4 years ago

3.4.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.2

4 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.1.0-beta.4

5 years ago

3.1.0-beta.3

5 years ago

3.1.0-beta.2

5 years ago

3.0.1

5 years ago

3.1.0-beta.1

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.2

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.7.4

5 years ago

1.7.3

5 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.1

5 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.25.1

6 years ago

0.25.0

6 years ago

0.24.1

6 years ago

0.24.0

6 years ago

0.23.0

6 years ago

0.22.0

6 years ago

0.21.2

6 years ago

0.21.1

6 years ago

0.21.0

6 years ago

0.20.1

6 years ago

0.20.0

6 years ago

0.19.1

6 years ago

0.19.0

6 years ago

0.18.0

6 years ago

0.17.1

6 years ago

0.17.0

7 years ago

0.16.2

7 years ago

0.16.1

7 years ago

0.16.0

7 years ago

0.15.2

7 years ago

0.15.1

7 years ago

0.15.0

7 years ago

0.14.1

7 years ago

0.14.0

7 years ago

0.13.1

7 years ago

0.13.0

7 years ago

0.12.0

7 years ago

0.11.0

7 years ago

0.10.0

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago