Skip to content

Commit e0cc616

Browse files
committed
Bump to eslint 9.8
Morph to eslint.config.mjs and fix unused warnings for caught exceptions.
1 parent a0de32f commit e0cc616

7 files changed

Lines changed: 143 additions & 137 deletions

File tree

.eslintrc.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

dist/dom-to-image-more.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dom-to-image-more.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import globals from 'globals';
2+
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
4+
import js from '@eslint/js';
5+
import { FlatCompat } from '@eslint/eslintrc';
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all,
13+
});
14+
15+
export default [
16+
...compat.extends('eslint:recommended'),
17+
{
18+
languageOptions: {
19+
globals: {
20+
...globals.browser,
21+
},
22+
23+
ecmaVersion: 'latest',
24+
sourceType: 'module',
25+
},
26+
27+
rules: {
28+
'indent': ['error', 4],
29+
'linebreak-style': ['error', 'unix'],
30+
'quotes': ['error', 'single'],
31+
'semi': ['error', 'always'],
32+
'no-unused-vars': [
33+
'error',
34+
{
35+
argsIgnorePattern: '^_',
36+
caughtErrorsIgnorePattern: '^_',
37+
varsIgnorePattern: '^_',
38+
},
39+
],
40+
},
41+
},
42+
];

0 commit comments

Comments
 (0)