Skip to content

Commit

Permalink
Bump to eslint 9.8
Browse files Browse the repository at this point in the history
Morph to eslint.config.mjs and fix unused warnings for caught exceptions.
  • Loading branch information
IDisposable committed Jul 29, 2024
1 parent a0de32f commit e0cc616
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 137 deletions.
18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion dist/dom-to-image-more.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dom-to-image-more.min.js.map

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
...compat.extends('eslint:recommended'),
{
languageOptions: {
globals: {
...globals.browser,
},

ecmaVersion: 'latest',
sourceType: 'module',
},

rules: {
'indent': ['error', 4],
'linebreak-style': ['error', 'unix'],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
},
];
Loading

0 comments on commit e0cc616

Please sign in to comment.