-
Notifications
You must be signed in to change notification settings - Fork 0
/
html.js
36 lines (34 loc) · 1.49 KB
/
html.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// @ts-check
import htmlPlugin from "@html-eslint/eslint-plugin";
import htmlParser from "@html-eslint/parser";
import tseslint from "typescript-eslint";
export const html = tseslint.config({
files: [`**/*.html`],
languageOptions: {
parser: htmlParser,
},
plugins: {
"@html-eslint": htmlPlugin,
},
rules: {
...htmlPlugin.configs[`flat/recommended`].rules,
"@html-eslint/attrs-newline": `off`, // Formatting
"@html-eslint/id-naming-convention": [`error`, `kebab-case`],
"@html-eslint/indent": `off`, // Formatting
"@html-eslint/no-abstract-roles": `error`, // Accessibility
"@html-eslint/no-accesskey-attrs": `error`, // Accessibility
"@html-eslint/no-aria-hidden-body": `error`, // Please don’t 🙃
"@html-eslint/no-extra-spacing-attrs": `off`, // Prettier
"@html-eslint/no-inline-styles": `error`, // CSP (require explanation)
"@html-eslint/no-non-scalable-viewport": `error`, // Accessibility
"@html-eslint/no-positive-tabindex": `error`, // Require explanation
"@html-eslint/no-skip-heading-levels": `error`, // Require explanation
"@html-eslint/no-target-blank": `error`, // Be safe
"@html-eslint/require-button-type": `error`, // Be explicit
"@html-eslint/require-closing-tags": `off`, // Prettier
"@html-eslint/require-frame-title": `error`, // Best practice?
"@html-eslint/require-meta-charset": `error`, // Best practice?
"@html-eslint/require-meta-description": `error`, // Best practice?
"@html-eslint/require-meta-viewport": `error`, // Best practice
},
});