diff --git a/.eslintrc.js b/.eslintrc.js index ce415a15a..fc938afd9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,11 +8,10 @@ module.exports = { "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:prettier/recommended", - "prettier/@typescript-eslint", "plugin:import/errors", "plugin:import/warnings", - "plugin:import/typescript" + "plugin:import/typescript", + "prettier", ], parser: "@typescript-eslint/parser", parserOptions: { diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..37e391feb --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v16.17.0 diff --git a/package.json b/package.json index 7e281b932..9bccd8e35 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,6 @@ "url": "https://github.com/screepers/screeps-typescript-starter/issues" }, "homepage": "https://github.com/screepers/screeps-typescript-starter#readme", - "engines": { - "node": "10.x || 12.x" - }, "devDependencies": { "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", @@ -42,18 +39,16 @@ "@types/screeps": "^3.2.3", "@types/sinon": "^5.0.5", "@types/sinon-chai": "^3.2.0", - "@typescript-eslint/eslint-plugin": "^4.29.1", - "@typescript-eslint/parser": "^4.29.1", - "@typescript-eslint/typescript-estree": "^4.29.1", + "@typescript-eslint/eslint-plugin": "^5.38.1", + "@typescript-eslint/parser": "^5.38.1", "chai": "^4.2.0", - "eslint": "^7.32.0", - "eslint-config-prettier": "^8.3.0", - "eslint-import-resolver-typescript": "^2.4.0", + "eslint": "^8.24.0", + "eslint-config-prettier": "^8.5.0", + "eslint-import-resolver-typescript": "^3.5.1", "eslint-plugin-import": "^2.24.0", - "eslint-plugin-prettier": "^3.4.0", "lodash": "^3.10.1", "mocha": "^5.2.0", - "prettier": "^2.3.2", + "prettier": "^2.7.1", "rollup": "^2.56.2", "rollup-plugin-clear": "^2.0.7", "rollup-plugin-screeps": "^1.0.1", @@ -62,7 +57,7 @@ "sinon-chai": "^3.2.0", "ts-node": "^10.2.0", "tsconfig-paths": "^3.10.1", - "typescript": "^4.3.5" + "typescript": "^4.8.4" }, "dependencies": { "source-map": "~0.6.1" diff --git a/src/main.ts b/src/main.ts index 3b29f3e72..326c76525 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,12 +21,10 @@ declare global { working: boolean; } - // Syntax for adding proprties to `global` (ex "global.log") - namespace NodeJS { - interface Global { - log: any; - } - } +} +// Syntax for adding proprties to `global` (ex "global.log") +declare const global: { + log: any; } // When compiling TS to JS and bundling with rollup, the line numbers and file names in error messages change diff --git a/src/utils/ErrorMapper.ts b/src/utils/ErrorMapper.ts index 119a3954e..75222a394 100644 --- a/src/utils/ErrorMapper.ts +++ b/src/utils/ErrorMapper.ts @@ -1,3 +1,4 @@ +/* eslint-disable */ import { SourceMapConsumer } from "source-map"; export class ErrorMapper { diff --git a/tsconfig.json b/tsconfig.json index 9b1ca355a..ff922dc09 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,5 @@ "allowSyntheticDefaultImports": true, "allowUnreachableCode": false }, - "exclude": [ - "node_modules" - ] + "exclude": ["node_modules"] }