From e2287a0c150b6c73ea362c96e64b1a10357ae9e0 Mon Sep 17 00:00:00 2001 From: Adan Date: Sun, 3 Sep 2023 09:19:23 +0000 Subject: [PATCH] TSDoc linter added --- .eslintrc.cjs | 5 ++++- node/package.json | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index ed20b05fc4..d06c48cdc9 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,11 +1,14 @@ module.exports = { extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], + plugins: ["@typescript-eslint", "eslint-plugin-tsdoc"], root: true, env: { browser: true, node: true, jest: true, }, + rules: { + 'tsdoc/syntax': 'warn' + } }; diff --git a/node/package.json b/node/package.json index 1d51cc5e29..17699c23d5 100644 --- a/node/package.json +++ b/node/package.json @@ -20,7 +20,8 @@ "build-protobuf": "npm run compile-protobuf-files && npm run fix-protobuf-file", "compile-protobuf-files": "cd src && pbjs -t static-module -o ProtobufMessage.js ../../babushka-core/src/protobuf/*.proto && pbts -o ProtobufMessage.d.ts ProtobufMessage.js", "fix-protobuf-file": "replace 'this\\.encode\\(message, writer\\)\\.ldelim' 'this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim' src/ProtobufMessage.js", - "test": "jest --verbose --runInBand" + "test": "jest --verbose --runInBand", + "lint": "eslint -f unix \"src/**/*.{ts,tsx}\"" }, "devDependencies": { "@babel/preset-env": "^7.20.2", @@ -28,10 +29,11 @@ "@types/jest": "^29.4.0", "@types/redis-server": "^1.2.0", "@types/uuid": "^9.0.1", - "@typescript-eslint/eslint-plugin": "^5.54.1", + "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.54.1", "babel-jest": "^28.1.3", - "eslint": "^8.36.0", + "eslint": "^8.48.0", + "eslint-plugin-tsdoc": "^0.2.17", "find-free-port": "^2.0.0", "jest": "^28.1.3", "protobufjs-cli": "^1.1.1",