Skip to content

Commit

Permalink
fix: update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Oct 17, 2024
1 parent d4bcfc1 commit 761dc90
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 234 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

24 changes: 24 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";

export default [
{
languageOptions: {
globals: globals.browser,
},
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier,
{
ignores: [
'coverage',
'dist',
'node_modules',
'.vscode',
'rollup.config.js',
]
},
];
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"docs"
],
"devDependencies": {
"@eslint/js": "^9.12.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@semantic-release/changelog": "^6.0.3",
Expand All @@ -45,13 +46,12 @@
"@semantic-release/release-notes-generator": "^14.0.1",
"@types/jest": "^29.5.13",
"@types/node": "^22.7.6",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"cpy-cli": "^5.0.0",
"del": "^8.0.0",
"del-cli": "^6.0.0",
"eslint": "^8.57.1",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.11.0",
"jest": "^29.7.0",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.7.0",
Expand All @@ -61,7 +61,8 @@
"serve": "^14.2.4",
"ts-jest": "^29.2.5",
"tslib": "^2.8.0",
"typescript": "~5.6.3"
"typescript": "~5.6.3",
"typescript-eslint": "^8.9.0"
},
"jest": {
"moduleFileExtensions": [
Expand Down
2 changes: 1 addition & 1 deletion src/signature_event_target.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class SignatureEventTarget {
constructor() {
try {
this._et = new EventTarget();
} catch (error) {
} catch {
// Using document as EventTarget to support iOS 13 and older.
// Because EventTarget constructor just exists at iOS 14 and later.
this._et = document;
Expand Down
2 changes: 0 additions & 2 deletions src/signature_pad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,6 @@ export default class SignaturePad extends SignatureEventTarget {
// Need to check curve for NaN values, these pop up when drawing
// lines on the canvas that are not continuous. E.g. Sharp corners
// or stopping mid-stroke and than continuing without lifting mouse.
/* eslint-disable no-restricted-globals */
if (
!isNaN(curve.control1.x) &&
!isNaN(curve.control1.y) &&
Expand All @@ -771,7 +770,6 @@ export default class SignaturePad extends SignatureEventTarget {

svg.appendChild(path);
}
/* eslint-enable no-restricted-globals */
},

(point, { penColor, dotSize, minWidth, maxWidth }) => {
Expand Down
Loading

0 comments on commit 761dc90

Please sign in to comment.