@kitschpatrol/eslint-config 4.2.1 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/eslint.config.cjs CHANGED
@@ -112,6 +112,7 @@ const globalRulesTypescript = {
112
112
 
113
113
  /* @type {import('eslint').Linter.Config} */
114
114
  module.exports = {
115
+ plugins: ['@html-eslint', 'html'],
115
116
  extends: extendsPrefix,
116
117
  env: {
117
118
  browser: true,
@@ -126,10 +127,50 @@ module.exports = {
126
127
  ecmaVersion: 2022,
127
128
  extraFileExtensions: ['.svelte', '.astro'], // Essential for these file types to make it to the override
128
129
  project: 'tsconfig.eslint.json',
130
+ tsconfigRootDir: process.cwd(), // Look for tsconfig in the consuming project's root
129
131
  sourceType: 'module',
130
132
  },
131
133
  rules: globalRulesPrefix,
132
134
  overrides: [
135
+ // HTML (and inline scripts)
136
+ {
137
+ files: ['*.html'],
138
+ parser: '@html-eslint/parser',
139
+ rules: {
140
+ // Best Practice
141
+ '@html-eslint/no-duplicate-attrs': 'error',
142
+ '@html-eslint/no-duplicate-id': 'error',
143
+ '@html-eslint/no-inline-styles': 'error',
144
+ '@html-eslint/no-obsolete-tags': 'error',
145
+ '@html-eslint/no-restricted-attr-values': 'error',
146
+ '@html-eslint/no-restricted-attrs': 'error',
147
+ '@html-eslint/no-script-style-type': 'error',
148
+ '@html-eslint/no-target-blank': 'error',
149
+ '@html-eslint/require-attrs': 'error',
150
+ '@html-eslint/require-button-type': 'error',
151
+ // '@html-eslint/require-closing-tags': 'error',
152
+ '@html-eslint/require-doctype': 'error',
153
+ '@html-eslint/require-li-container': 'error',
154
+ '@html-eslint/require-meta-charset': 'error',
155
+ // SEO
156
+ '@html-eslint/no-multiple-h1': 'error',
157
+ '@html-eslint/require-lang': 'error',
158
+ // '@html-eslint/require-meta-description': 'error',
159
+ // '@html-eslint/require-open-graph-protocol': 'error',
160
+ '@html-eslint/require-title': 'error',
161
+ // Accessibility
162
+ '@html-eslint/no-abstract-roles': 'error',
163
+ '@html-eslint/no-accesskey-attrs': 'error',
164
+ '@html-eslint/no-aria-hidden-body': 'error',
165
+ '@html-eslint/no-non-scalable-viewport': 'error',
166
+ '@html-eslint/no-positive-tabindex': 'error',
167
+ '@html-eslint/no-skip-heading-levels': 'error',
168
+ '@html-eslint/require-frame-title': 'error',
169
+ '@html-eslint/require-img-alt': 'error',
170
+ '@html-eslint/require-meta-viewport': 'error',
171
+ },
172
+ },
173
+
133
174
  // Markdown
134
175
  {
135
176
  extends: ['plugin:mdx/recommended'],
@@ -179,7 +220,7 @@ module.exports = {
179
220
  ],
180
221
  parser: '@typescript-eslint/parser',
181
222
  parserOptions: {
182
- project: true,
223
+ project: 'tsconfig.eslint.json', // Not sure why this isn't inherited
183
224
  },
184
225
  rules: {
185
226
  ...globalRulesPrefix,
@@ -208,7 +249,7 @@ module.exports = {
208
249
  parserOptions: {
209
250
  extraFileExtensions: ['.astro'],
210
251
  parser: '@typescript-eslint/parser',
211
- project: true,
252
+ project: 'tsconfig.eslint.json', // Not sure why this isn't inherited
212
253
  sourceType: 'module',
213
254
  },
214
255
  rules: {
@@ -4,13 +4,14 @@
4
4
  },
5
5
  "eslint.enable": true,
6
6
  "eslint.validate": [
7
+ "astro",
8
+ "html",
7
9
  "javascript",
8
10
  "javascriptreact",
9
- "typescript",
10
- "typescriptreact",
11
- "svelte",
12
- "astro",
13
11
  "markdown",
14
- "mdx"
12
+ "mdx",
13
+ "svelte",
14
+ "typescript",
15
+ "typescriptreact"
15
16
  ]
16
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/eslint-config",
3
- "version": "4.2.1",
3
+ "version": "4.3.0",
4
4
  "type": "module",
5
5
  "description": "Eslint config for @kitschpatrol/shared-config",
6
6
  "repository": {
@@ -34,6 +34,8 @@
34
34
  "eslint": ">=8.52.0"
35
35
  },
36
36
  "dependencies": {
37
+ "@html-eslint/eslint-plugin": "^0.22.0",
38
+ "@html-eslint/parser": "^0.22.0",
37
39
  "@pinojs/json-colorizer": "^4.0.0",
38
40
  "@typescript-eslint/eslint-plugin": "^6.15.0",
39
41
  "@typescript-eslint/parser": "^6.15.0",
@@ -42,6 +44,7 @@
42
44
  "eslint-config-xo": "^0.43.1",
43
45
  "eslint-config-xo-typescript": "^1.0.1",
44
46
  "eslint-plugin-astro": "^0.30.0",
47
+ "eslint-plugin-html": "^7.1.0",
45
48
  "eslint-plugin-jsx-a11y": "^6.8.0",
46
49
  "eslint-plugin-mdx": "^3.0.0",
47
50
  "eslint-plugin-n": "^16.5.0",