Skip to content

Commit

Permalink
Adding additional eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Dec 13, 2023
1 parent 8c17694 commit 4ed4c30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function getMap(mapFilePath: string): Promise<ITiledMap> {
try {
mapFile = await fs.promises.readFile(mapFilePath);
} catch (err) {
throw Error(`Cannot get the map file: ${err}`);
throw Error(`Cannot get the map file: ${err instanceof Error ? err.message : "unknown error"}`);
}
const isRealMap = ITiledMap.passthrough().safeParse(JSON.parse(mapFile.toString("utf-8")));

Expand Down

0 comments on commit 4ed4c30

Please sign in to comment.