@geekbears/gb-nest-helpers 0.0.12 → 0.0.13

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,196 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
+ import typescriptEslint from "@typescript-eslint/eslint-plugin";
3
+ import globals from "globals";
4
+ import tsParser from "@typescript-eslint/parser";
5
+ import path from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+ import js from "@eslint/js";
8
+ import { FlatCompat } from "@eslint/eslintrc";
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+ const compat = new FlatCompat({
13
+ baseDirectory: __dirname,
14
+ recommendedConfig: js.configs.recommended,
15
+ allConfig: js.configs.all
16
+ });
17
+
18
+ export default [...compat.extends(
19
+ "plugin:@typescript-eslint/recommended",
20
+ "plugin:@typescript-eslint/recommended-requiring-type-checking",
21
+ "prettier",
22
+ ), {
23
+ plugins: {
24
+
25
+
26
+ "@typescript-eslint": typescriptEslint,
27
+ },
28
+
29
+ languageOptions: {
30
+ globals: {
31
+ ...globals.node,
32
+ },
33
+
34
+ parser: tsParser,
35
+ ecmaVersion: 5,
36
+ sourceType: "module",
37
+
38
+ parserOptions: {
39
+ project: "tsconfig.json",
40
+ },
41
+ },
42
+
43
+ rules: {
44
+ "@typescript-eslint/adjacent-overload-signatures": "error",
45
+ "@typescript-eslint/array-type": ["error", {
46
+ default: "array",
47
+ }],
48
+ "@typescript-eslint/consistent-type-assertions": "error",
49
+ "@typescript-eslint/dot-notation": "error",
50
+ "@typescript-eslint/explicit-function-return-type": "off",
51
+ "@typescript-eslint/explicit-module-boundary-types": "off",
52
+ "@typescript-eslint/indent": "off",
53
+ "@typescript-eslint/no-shadow": "off",
54
+ "@typescript-eslint/member-delimiter-style": ["off", {
55
+ multiline: {
56
+ delimiter: "none",
57
+ requireLast: true,
58
+ },
59
+
60
+ singleline: {
61
+ delimiter: "semi",
62
+ requireLast: false,
63
+ },
64
+ }],
65
+
66
+ "@typescript-eslint/naming-convention": ["error", {
67
+ selector: "variable",
68
+ format: ["camelCase", "UPPER_CASE", "PascalCase"],
69
+ leadingUnderscore: "allow",
70
+ trailingUnderscore: "forbid",
71
+ }],
72
+
73
+ "@typescript-eslint/no-empty-function": "error",
74
+ "@typescript-eslint/no-empty-interface": "error",
75
+ "@typescript-eslint/no-explicit-any": "off",
76
+ "@typescript-eslint/no-misused-new": "error",
77
+ "@typescript-eslint/no-namespace": "error",
78
+ "@typescript-eslint/no-parameter-properties": "off",
79
+ "@typescript-eslint/no-unsafe-assignment": "warn",
80
+ "@typescript-eslint/no-unsafe-argument": "warn",
81
+ "@typescript-eslint/no-unsafe-call": "warn",
82
+ "@typescript-eslint/no-floating-promises": "warn",
83
+ "@typescript-eslint/no-unsafe-member-access": "warn",
84
+ "@typescript-eslint/no-unsafe-return": "warn",
85
+ "@typescript-eslint/no-misused-promises": "warn",
86
+ "@typescript-eslint/no-unused-expressions": "off",
87
+ "@typescript-eslint/no-unsafe-argument": "warn",
88
+ "@typescript-eslint/no-unused-vars": "warn",
89
+ "@typescript-eslint/unbound-method": "warn",
90
+ "@typescript-eslint/no-base-to-string": "warn",
91
+ "id-denylist": "off",
92
+ "@typescript-eslint/no-this-alias": [
93
+ "error",
94
+ {
95
+ "allowDestructuring": true, // Allow `const { props, state } = this`; false by default
96
+ "allowedNames": ["me"] // Allow `const vm= this`; `[]` by default
97
+ }
98
+ ],
99
+
100
+ "@typescript-eslint/no-unused-expressions": "error",
101
+ "@typescript-eslint/no-use-before-define": "off",
102
+ "@typescript-eslint/no-var-requires": "error",
103
+ "@typescript-eslint/prefer-for-of": "error",
104
+ "@typescript-eslint/prefer-function-type": "error",
105
+ "@typescript-eslint/prefer-namespace-keyword": "error",
106
+ "@typescript-eslint/quotes": "off",
107
+ "@typescript-eslint/semi": ["off", null],
108
+
109
+ "@typescript-eslint/triple-slash-reference": ["error", {
110
+ path: "always",
111
+ types: "prefer-import",
112
+ lib: "always",
113
+ }],
114
+
115
+ "@typescript-eslint/type-annotation-spacing": "off",
116
+ "@typescript-eslint/typedef": "off",
117
+ "@typescript-eslint/unified-signatures": "error",
118
+ "arrow-parens": ["off", "always"],
119
+ "brace-style": ["off", "off"],
120
+ "comma-dangle": "off",
121
+ complexity: "off",
122
+ "constructor-super": "error",
123
+ "dot-notation": "off",
124
+ "eol-last": "off",
125
+ eqeqeq: ["error", "smart"],
126
+ "guard-for-in": "error",
127
+
128
+ "id-denylist": [
129
+ "error",
130
+ "any",
131
+ "Number",
132
+ "number",
133
+ "String",
134
+ "string",
135
+ "Boolean",
136
+ "boolean",
137
+ "Undefined",
138
+ "undefined",
139
+ ],
140
+
141
+ "id-match": "error",
142
+ indent: "off",
143
+ "linebreak-style": "off",
144
+ "max-classes-per-file": ["error", 1],
145
+ "max-len": "off",
146
+ "new-parens": "off",
147
+ "newline-per-chained-call": "off",
148
+ "no-bitwise": "error",
149
+ "no-caller": "error",
150
+ "no-cond-assign": "error",
151
+
152
+ "no-debugger": "error",
153
+ "no-empty": "error",
154
+ "no-empty-function": "off",
155
+ "no-eval": "error",
156
+ "no-extra-semi": "off",
157
+ "no-fallthrough": "off",
158
+ "no-invalid-this": "off",
159
+ "no-irregular-whitespace": "off",
160
+ "no-multiple-empty-lines": "off",
161
+ "no-new-wrappers": "error",
162
+
163
+ "no-throw-literal": "error",
164
+ "no-trailing-spaces": "off",
165
+ "no-undef-init": "error",
166
+ "no-underscore-dangle": "off",
167
+ "no-unsafe-finally": "error",
168
+ "no-unused-expressions": "off",
169
+ "no-unused-labels": "error",
170
+ "no-use-before-define": "off",
171
+ "no-var": "error",
172
+ "object-shorthand": "error",
173
+ "one-var": ["error", "never"],
174
+
175
+ "padded-blocks": ["off", {
176
+ blocks: "never",
177
+ }, {
178
+ allowSingleLineBlocks: true,
179
+ }],
180
+ "prefer-const": "error",
181
+ "quote-props": "off",
182
+ quotes: "off",
183
+ radix: "error",
184
+
185
+ semi: "off",
186
+ "space-before-function-paren": "off",
187
+ "space-in-parens": ["off", "never"],
188
+
189
+ "spaced-comment": ["error", "always", {
190
+ markers: ["/"],
191
+ }],
192
+
193
+ "use-isnan": "error",
194
+ "valid-typeof": "off",
195
+ },
196
+ }];
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "prepublishOnly": "npm run compile",
10
10
  "pretest": "npm run compile",
11
11
  "test": "echo \"Error: no test specified\" && exit 0",
12
- "lint": "tslint src/**/*.ts",
12
+ "lint": "eslint -c eslint.config.mjs src/*.ts --fix",
13
13
  "format": "prettier --write \"src/**/*.ts\""
14
14
  },
15
15
  "repository": {
@@ -28,17 +28,21 @@
28
28
  },
29
29
  "homepage": "https://gitlab.com/geekbears/utilities/backend/gb-nest-helpers#readme",
30
30
  "devDependencies": {
31
- "@types/node": "^22.7.3",
31
+ "@types/node": "^22.7.8",
32
32
  "@types/qs": "^6.9.16",
33
+ "@typescript-eslint/eslint-plugin": "^8.11.0",
34
+ "@typescript-eslint/parser": "^8.11.0",
35
+ "eslint": "^9.13.0",
36
+ "eslint-config-prettier": "^9.1.0",
37
+ "eslint-plugin-prettier": "^5.2.1",
33
38
  "prettier": "^3.3.3",
34
39
  "rimraf": "^6.0.1",
35
40
  "ts-node": "^10.9.2",
36
- "tslint": "^6.1.3",
37
- "typescript": "^5.6.2"
41
+ "typescript": "^5.6.3"
38
42
  },
39
43
  "peerDependencies": {
40
44
  "@nestjs/common": "9 - 11",
41
45
  "@nestjs/swagger": "6 - 8"
42
46
  },
43
- "version": "0.0.12"
47
+ "version": "0.0.13"
44
48
  }
package/tslint.json DELETED
@@ -1,62 +0,0 @@
1
- {
2
- "rules": {
3
- "no-inferrable-types": true,
4
- "class-name": true,
5
- "comment-format": [
6
- true,
7
- "check-space"
8
- ],
9
- "indent": [
10
- true,
11
- "spaces"
12
- ],
13
- "eofline": true,
14
- "no-duplicate-variable": true,
15
- "no-eval": true,
16
- "no-arg": true,
17
- "no-internal-module": true,
18
- "no-trailing-whitespace": true,
19
- "no-bitwise": true,
20
- "no-unused-expression": true,
21
- "no-var-keyword": true,
22
- "one-line": [
23
- true,
24
- "check-catch",
25
- "check-else",
26
- "check-open-brace",
27
- "check-whitespace"
28
- ],
29
- "quotemark": [
30
- true,
31
- "single",
32
- "avoid-escape"
33
- ],
34
- "semicolon": [true, "always"],
35
- "typedef-whitespace": [
36
- true,
37
- {
38
- "call-signature": "nospace",
39
- "index-signature": "nospace",
40
- "parameter": "nospace",
41
- "property-declaration": "nospace",
42
- "variable-declaration": "nospace"
43
- }
44
- ],
45
- "curly": true,
46
- "variable-name": [
47
- true,
48
- "ban-keywords",
49
- "check-format",
50
- "allow-leading-underscore",
51
- "allow-pascal-case"
52
- ],
53
- "whitespace": [
54
- true,
55
- "check-branch",
56
- "check-decl",
57
- "check-operator",
58
- "check-separator",
59
- "check-type"
60
- ]
61
- }
62
- }