Skip to content

Commit

Permalink
update eslint to version 9
Browse files Browse the repository at this point in the history
  • Loading branch information
dichovsky committed Aug 30, 2024
1 parent 31737af commit 8c9eab3
Show file tree
Hide file tree
Showing 5 changed files with 315 additions and 376 deletions.
15 changes: 0 additions & 15 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion __tests__/canvas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test('should reset the canvas width and height', () => {

factory.reset(canvasAndContext, 300, 400);

expect(canvasAndContext.canvas).to.not.be.undefined;
expect(canvasAndContext!.canvas).toBeDefined();
expect(canvasAndContext!.canvas!.width).to.equal(300);
expect(canvasAndContext!.canvas!.height).to.equal(400);
});
Expand Down
35 changes: 35 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
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 [{
ignores: ["**/*.js", "**/*.d.ts"],
}, ...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
), {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
},

rules: {
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-explicit-any": 0,
},
}];
Loading

0 comments on commit 8c9eab3

Please sign in to comment.