Skip to content

Commit 54a4713

Browse files
authored
Fix CI: upgrade eslint-plugin-github to 6.1.1, migrate to flat config
1 parent 34544b1 commit 54a4713

5 files changed

Lines changed: 557 additions & 405 deletions

File tree

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

eslint.config.mjs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import githubPlugin from 'eslint-plugin-github'
2+
import {fixupPluginRules} from '@eslint/compat'
3+
import customElementsPlugin from 'eslint-plugin-custom-elements'
4+
import globals from 'globals'
5+
6+
const githubFlatConfigs = githubPlugin.getFlatConfigs()
7+
8+
const customElementsRules = Object.fromEntries(
9+
Object.keys(customElementsPlugin.rules).map(r => [`custom-elements/${r}`, 'error']),
10+
)
11+
12+
export default [
13+
{ignores: ['dist']},
14+
githubFlatConfigs.browser,
15+
githubFlatConfigs.recommended,
16+
...githubFlatConfigs.typescript,
17+
{
18+
plugins: {
19+
'custom-elements': fixupPluginRules(customElementsPlugin),
20+
},
21+
languageOptions: {
22+
globals: {
23+
FileAttachmentElement: 'readonly',
24+
},
25+
},
26+
rules: {
27+
...customElementsRules,
28+
'@typescript-eslint/no-explicit-any': 'off',
29+
'custom-elements/tag-name-matches-class': ['error', {suffix: 'Element'}],
30+
},
31+
},
32+
{
33+
files: ['test/**/*.js'],
34+
languageOptions: {
35+
globals: {
36+
...globals.mocha,
37+
...globals.chai,
38+
},
39+
},
40+
rules: {
41+
'github/unescaped-html-literal': 'off',
42+
'github/no-inner-html': 'off',
43+
'import/extensions': 'off',
44+
'import/no-unresolved': 'off',
45+
'one-var': 'off',
46+
},
47+
},
48+
]

0 commit comments

Comments
 (0)