@imqueue/core 1.13.1 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,77 @@
1
+ import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
2
+ import tsParser from "@typescript-eslint/parser";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import js from "@eslint/js";
6
+ import { FlatCompat } from "@eslint/eslintrc";
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+ const compat = new FlatCompat({
11
+ baseDirectory: __dirname,
12
+ recommendedConfig: js.configs.recommended,
13
+ allConfig: js.configs.all
14
+ });
15
+
16
+ export default [...compat.extends(
17
+ "plugin:@typescript-eslint/recommended",
18
+ "plugin:@typescript-eslint/recommended-requiring-type-checking",
19
+ ), {
20
+ plugins: {
21
+ "@typescript-eslint": typescriptEslintEslintPlugin,
22
+ },
23
+
24
+ languageOptions: {
25
+ parser: tsParser,
26
+ ecmaVersion: 5,
27
+ sourceType: "module",
28
+
29
+ parserOptions: {
30
+ project: "tsconfig.json",
31
+ },
32
+ },
33
+
34
+ rules: {
35
+ "@typescript-eslint/interface-name-prefix": "off",
36
+ "@typescript-eslint/explicit-function-return-type": ["warn"],
37
+ "@typescript-eslint/explicit-module-boundary-types": "off",
38
+ "@typescript-eslint/no-unsafe-member-access": "off",
39
+ "@typescript-eslint/no-explicit-any": "off",
40
+ "@typescript-eslint/no-unsafe-assignment": "warn",
41
+ "@typescript-eslint/no-unsafe-argument": "warn",
42
+ "no-trailing-spaces": "warn",
43
+ "no-unused-vars": "off",
44
+ "@typescript-eslint/no-unused-vars": ["warn"],
45
+ "semi": ["warn", "always"],
46
+
47
+ "no-console": ["warn", {
48
+ allow: ["warn", "error", "info"],
49
+ }],
50
+
51
+ "no-debugger": "error",
52
+ "arrow-parens": ["warn", "as-needed"],
53
+
54
+ "quotes": ["error", "single", {
55
+ avoidEscape: true,
56
+ allowTemplateLiterals: true,
57
+ }],
58
+
59
+ "comma-dangle": ["warn", {
60
+ arrays: "always-multiline",
61
+ objects: "always-multiline",
62
+ imports: "always-multiline",
63
+ exports: "always-multiline",
64
+ functions: "always-multiline",
65
+ }],
66
+
67
+ "max-len": ["warn", {
68
+ code: 80,
69
+ ignoreComments: true,
70
+ ignoreRegExpLiterals: true,
71
+ ignoreTrailingComments: true,
72
+ ignoreTemplateLiterals: true,
73
+ ignoreStrings: true,
74
+ ignoreUrls: true,
75
+ }],
76
+ },
77
+ }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imqueue/core",
3
- "version": "1.13.1",
3
+ "version": "1.15.0",
4
4
  "description": "Simple JSON-based messaging queue for inter service communication",
5
5
  "keywords": [
6
6
  "message-queue",
@@ -41,27 +41,33 @@
41
41
  "redis": "3.1.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@types/chai": "^4.3.10",
45
- "@types/mocha": "^10.0.4",
46
- "@types/mock-require": "^2.0.3",
47
- "@types/node": "^20.9.0",
48
- "@types/sinon": "^17.0.1",
49
- "@types/yargs": "^17.0.31",
44
+ "@eslint/js": "^9.14.0",
45
+ "@types/chai": "^5.0.1",
46
+ "@types/eslint__eslintrc": "^2.1.2",
47
+ "@types/mocha": "^10.0.9",
48
+ "@types/mock-require": "^3.0.0",
49
+ "@types/node": "^22.9.0",
50
+ "@types/sinon": "^17.0.3",
51
+ "@types/yargs": "^17.0.33",
52
+ "@typescript-eslint/eslint-plugin": "^8.13.0",
53
+ "@typescript-eslint/parser": "^8.13.0",
54
+ "@typescript-eslint/typescript-estree": "^8.13.0",
50
55
  "chai": "^4.3.10",
51
56
  "codeclimate-test-reporter": "^0.5.1",
52
- "coveralls": "^3.1.1",
53
- "mocha": "^10.2.0",
57
+ "coveralls-next": "^4.2.1",
58
+ "eslint": "^9.14.0",
59
+ "eslint-plugin-jsdoc": "^50.4.3",
60
+ "mocha": "^10.8.2",
54
61
  "mocha-lcov-reporter": "^1.3.0",
55
62
  "mock-require": "^3.0.3",
56
- "nyc": "^15.1.0",
57
- "open": "^9.1.0",
58
- "reflect-metadata": "^0.1.13",
59
- "sinon": "^17.0.1",
63
+ "nyc": "^17.1.0",
64
+ "open": "^10.1.0",
65
+ "reflect-metadata": "^0.2.2",
66
+ "sinon": "^19.0.2",
60
67
  "source-map-support": "^0.5.21",
61
- "ts-node": "^10.9.1",
62
- "tslint": "^6.1.3",
63
- "typedoc": "^0.25.3",
64
- "typescript": "^5.2.2",
68
+ "ts-node": "^10.9.2",
69
+ "typedoc": "^0.26.11",
70
+ "typescript": "^5.6.3",
65
71
  "yargs": "^17.7.2"
66
72
  },
67
73
  "main": "index.js",
package/src/RedisQueue.js CHANGED
@@ -494,7 +494,12 @@ class RedisQueue extends events_1.EventEmitter {
494
494
  onReadyHandler(options, context, channel, resolve) {
495
495
  return (async () => {
496
496
  this.logger.info('%s: %s channel connected, host %s, pid %s', context.name, channel, this.redisKey, process.pid);
497
- await this.setChannelName(context[channel], context.name, options.prefix || '', channel);
497
+ try {
498
+ await this.setChannelName(context[channel], context.name, options.prefix || '', channel);
499
+ }
500
+ catch (err) {
501
+ this.logger.warn('Error setting channel name:', err);
502
+ }
498
503
  switch (channel) {
499
504
  case 'reader':
500
505
  this.read();
package/tslint.json DELETED
@@ -1,77 +0,0 @@
1
- {
2
- "lintOptions": {
3
- "typeCheck": true
4
- },
5
- "linterOptions": {
6
- "exclude": [
7
- "test/**/*",
8
- "docs/**/*",
9
- "benchmark/**/*",
10
- "coverage/**/*",
11
- ".nyc_output/**/*",
12
- "benchmark-result/**/*"
13
- ]
14
- },
15
- "extends": "tslint:recommended",
16
- "rules": {
17
- "no-bitwise": false,
18
- "await-promise": false,
19
- "strict-boolean-expressions": false,
20
- "cyclomatic-complexity": true,
21
- "newline-before-return": true,
22
- "no-parameter-properties": false,
23
- "no-parameter-reassignment": false,
24
- "no-unused-variable": true,
25
- "no-conditional-assignment": false,
26
- "comment-format": [true, "check-space"],
27
- "member-access": true,
28
- "no-string-literal": false,
29
- "ordered-imports": false,
30
- "only-arrow-functions": [
31
- true,
32
- "allow-declarations",
33
- "allow-named-functions"
34
- ],
35
- "no-implicit-dependencies": [true, "dev"],
36
- "completed-docs": true,
37
- "no-any": false,
38
- "no-unsafe-any": false,
39
- "no-magic-numbers": false,
40
- "no-non-null-assertion": true,
41
- "no-null-keyword": true,
42
- "no-require-imports": true,
43
- "no-unbound-method": true,
44
- "no-unnecessary-qualifier": true,
45
- "no-use-before-declare": true,
46
- "no-void-expression": true,
47
- "prefer-function-over-method": false,
48
- "strict-type-predicates": true,
49
- "triple-equals": [true, "allow-undefined-check"],
50
- "typedef": true,
51
- "quotemark": [true, "single", "avoid-escape", "avoid-template"],
52
- "ban": [true, ["describe", "only"], ["it", "only"]],
53
- "interface-name": false,
54
- "file-header": [true,
55
- "", "", "Copyright (c) \\d{4}, imqueue.com"
56
- ],
57
- "max-classes-per-file": false,
58
- "max-line-length": [true, 80],
59
- "member-ordering": [true,
60
- "public-before-private",
61
- "static-before-instance",
62
- "variables-before-functions"
63
- ],
64
- "newline-per-chained-call": false,
65
- "no-console": {
66
- "options": ["log"]
67
- },
68
- "no-switch-case-fall-through": true,
69
- "switch-default": false,
70
- "variable-name": [true,
71
- "ban-keywords",
72
- "check-format",
73
- "allow-leading-underscore",
74
- "allow-pascal-case"
75
- ]
76
- }
77
- }