From 1445ed96418575f66b699ca0f72d34e6120819c7 Mon Sep 17 00:00:00 2001 From: bramkor <140380882+bramkor@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:04:12 +0200 Subject: [PATCH] fix: linter issues (#5) --- .eslintrc.js | 12 ++++++++---- package-lock.json | 12 ++++++------ package.json | 9 ++++----- tsconfig.json | 30 +++++++++++++++++++----------- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index dd9b796..6b729a9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -45,19 +45,23 @@ module.exports = { 'error', { default: [ + // Static fields 'public-static-field', 'protected-static-field', 'private-static-field', + + // Instance fields 'public-instance-field', 'protected-instance-field', 'private-instance-field', + + // Constructors 'constructor', + + // Methods 'public-static-method', 'protected-static-method', 'private-static-method', - 'public-abstract-method', - 'protected-abstract-method', - 'private-abstract-method', 'public-instance-method', 'protected-instance-method', 'private-instance-method' @@ -116,7 +120,6 @@ module.exports = { ], '@typescript-eslint/default-param-last': ['error'], '@typescript-eslint/consistent-type-assertions': 'error', - '@typescript-eslint/no-duplicate-imports': 'error', '@typescript-eslint/no-non-null-assertion': 'error', '@typescript-eslint/unified-signatures': 'error', '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', @@ -190,6 +193,7 @@ module.exports = { 'no-restricted-syntax': ['error', 'ForInStatement'], 'no-throw-literal': 'error', 'no-undef-init': 'error', + "no-duplicate-imports": "error", 'object-shorthand': 'error', 'one-var': ['error', 'never'], 'padding-line-between-statements': [ diff --git a/package-lock.json b/package-lock.json index 12cc7ef..2559860 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,8 @@ "@commitlint/cli": "^18.4.0", "@commitlint/config-conventional": "^18.4.0", "@types/node": "^20.0.0", - "@typescript-eslint/eslint-plugin": "^6.0.0", - "@typescript-eslint/parser": "^6.0.0", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", "@vercel/ncc": "^0.38.0", "eslint": "^8.0.0", "eslint-config-prettier": "^9.0.0", @@ -29,7 +29,7 @@ "is-ci": "^3.0.1", "lint-staged": "^15.0.0", "prettier": "^3.0.0", - "typescript": "^5.0.0" + "typescript": "~5.3.3" } }, "node_modules/@actions/core": { @@ -5663,9 +5663,9 @@ } }, "node_modules/typescript": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", - "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index d3f57a7..2a7d511 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ "@commitlint/cli": "^18.4.0", "@commitlint/config-conventional": "^18.4.0", "@types/node": "^20.0.0", - "@typescript-eslint/eslint-plugin": "^6.0.0", - "@typescript-eslint/parser": "^6.0.0", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", "@vercel/ncc": "^0.38.0", "eslint": "^8.0.0", "eslint-config-prettier": "^9.0.0", @@ -42,7 +42,7 @@ "is-ci": "^3.0.1", "lint-staged": "^15.0.0", "prettier": "^3.0.0", - "typescript": "^5.0.0" + "typescript": "~5.3.3" }, "commitlint": { "extends": [ @@ -52,8 +52,7 @@ "lint-staged": { "*.ts": [ "eslint --fix", - "prettier --write", - "git add" + "prettier --write" ] } } diff --git a/tsconfig.json b/tsconfig.json index 264cf6d..c72c054 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,20 @@ { - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "outDir": "./dist", - "rootDir": "./src", - "strict": true, - "noImplicitAny": true, - "esModuleInterop": true - }, - "exclude": ["node_modules", "**/*.test.ts"] - } + "compilerOptions": { + "target": "es2022", + "moduleResolution": "node", + "module": "commonjs", + "outDir": "./dist", + "rootDir": "./src", + "strict": true, + "noImplicitAny": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "ES2022" + ] + }, + "exclude": [ + "node_modules" + ] + } \ No newline at end of file