Skip to content

Commit

Permalink
Lint for builtin html tags
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Oct 23, 2023
1 parent 8dc7cfa commit 522d0ac
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 3 deletions.
140 changes: 140 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,145 @@ module.exports = {
'no-irregular-whitespace': 'off',
},
},
{
files: ['*.mdx', 'shared.js'],
rules: {
'react/forbid-elements': [
'error',
{
// See https://github.com/npm/documentation/pull/791
// https://gist.githubusercontent.com/cecchi/99772a8483914b112400/raw/bcaecc4ba809caec518158bb46f9dead456ae5da/html-tags.json
forbid: [
'abbr',
'acronym',
'address',
'applet',
'area',
'article',
'audio',
'b',
'base',
'basefont',
'bdi',
'bdo',
'big',
'blink',
'br',
'button',
'canvas',
'caption',
'center',
'cite',
'code',
'col',
'colgroup',
'content',
'data',
'datalist',
'dd',
'del',
'details',
'dfn',
'dialog',
'dir',
'div',
'dl',
'dt',
'element',
'em',
'embed',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'frame',
'frameset',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'head',
'header',
'hgroup',
'hr',
'html',
'i',
'input',
'ins',
'isindex',
'kbd',
'keygen',
'label',
'legend',
// ok because there is no mdx replacement and styles are provided via parent ul/ol
// 'li',
'listing',
'main',
'map',
'mark',
'menu',
'menuitem',
'meter',
'nav',
'noembed',
'noscript',
'object',
'ol',
'optgroup',
'option',
'output',
'p',
'param',
'plaintext',
'pre',
'progress',
'q',
'rp',
'rt',
'rtc',
'ruby',
's',
'samp',
'script',
'section',
'select',
'shadow',
'small',
'source',
'spacer',
'span',
'strike',
// ok since there is no mdx replacement
// 'strong'
'style',
'sub',
'summary',
'sup',
'table',
'tbody',
'td',
'template',
'tfoot',
'th',
'thead',
'time',
'title',
'tr',
'track',
'tt',
'u',
'ul',
'var',
'video',
'wbr',
'xmp',
],
},
],
},
},
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,13 @@ Although security-key with WebAuthn can be used for authentication from both the

2. On the command line, type the [`npm profile`](/cli/profile) command along with the option for the 2FA mode you want to enable:

- To enable 2FA for authorization and writes, type:<br/>
- To enable 2FA for authorization and writes, type:

```
npm profile enable-2fa auth-and-writes
```

- To enable 2FA for authorization only, type:<br/>
- To enable 2FA for authorization only, type:

```
npm profile enable-2fa auth-only
Expand Down

0 comments on commit 522d0ac

Please sign in to comment.