@geekbears/gb-class-validators 0.0.21 → 0.0.22

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.
Files changed (2) hide show
  1. package/eslint.config.mjs +183 -0
  2. package/package.json +12 -6
@@ -0,0 +1,183 @@
1
+ import typescriptEslint from "@typescript-eslint/eslint-plugin";
2
+ import globals from "globals";
3
+ import tsParser from "@typescript-eslint/parser";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import js from "@eslint/js";
7
+ import { FlatCompat } from "@eslint/eslintrc";
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+ const compat = new FlatCompat({
12
+ baseDirectory: __dirname,
13
+ recommendedConfig: js.configs.recommended,
14
+ allConfig: js.configs.all
15
+ });
16
+
17
+ export default [...compat.extends(
18
+ "plugin:@typescript-eslint/recommended",
19
+ "plugin:@typescript-eslint/recommended-requiring-type-checking",
20
+ "prettier",
21
+ ), {
22
+ plugins: {
23
+
24
+
25
+ "@typescript-eslint": typescriptEslint,
26
+ },
27
+
28
+ languageOptions: {
29
+ globals: {
30
+ ...globals.node,
31
+ },
32
+
33
+ parser: tsParser,
34
+ ecmaVersion: 5,
35
+ sourceType: "module",
36
+
37
+ parserOptions: {
38
+ project: "tsconfig.json",
39
+ },
40
+ },
41
+
42
+ rules: {
43
+ "@typescript-eslint/adjacent-overload-signatures": "error",
44
+
45
+ "@typescript-eslint/array-type": ["error", {
46
+ default: "array",
47
+ }],
48
+
49
+
50
+
51
+ "@typescript-eslint/consistent-type-assertions": "error",
52
+ "@typescript-eslint/dot-notation": "error",
53
+ "@typescript-eslint/explicit-function-return-type": "off",
54
+ "@typescript-eslint/explicit-module-boundary-types": "off",
55
+ "@typescript-eslint/indent": "off",
56
+
57
+ "@typescript-eslint/member-delimiter-style": ["off", {
58
+ multiline: {
59
+ delimiter: "none",
60
+ requireLast: true,
61
+ },
62
+
63
+ singleline: {
64
+ delimiter: "semi",
65
+ requireLast: false,
66
+ },
67
+ }],
68
+
69
+ "@typescript-eslint/naming-convention": ["error", {
70
+ selector: "variable",
71
+ format: ["camelCase", "UPPER_CASE", "PascalCase"],
72
+ leadingUnderscore: "allow",
73
+ trailingUnderscore: "forbid",
74
+ }],
75
+
76
+ "@typescript-eslint/no-empty-function": "error",
77
+ "@typescript-eslint/no-empty-interface": "error",
78
+ "@typescript-eslint/no-explicit-any": "off",
79
+ "@typescript-eslint/no-misused-new": "error",
80
+ "@typescript-eslint/no-namespace": "error",
81
+ "@typescript-eslint/no-parameter-properties": "off",
82
+
83
+ "@typescript-eslint/no-shadow": ["error", {
84
+ hoist: "all",
85
+ }],
86
+
87
+ "@typescript-eslint/no-unused-expressions": "error",
88
+ "@typescript-eslint/no-use-before-define": "off",
89
+ "@typescript-eslint/no-var-requires": "error",
90
+ "@typescript-eslint/prefer-for-of": "error",
91
+ "@typescript-eslint/prefer-function-type": "error",
92
+ "@typescript-eslint/prefer-namespace-keyword": "error",
93
+ "@typescript-eslint/quotes": "off",
94
+ "@typescript-eslint/semi": ["off", null],
95
+
96
+ "@typescript-eslint/triple-slash-reference": ["error", {
97
+ path: "always",
98
+ types: "prefer-import",
99
+ lib: "always",
100
+ }],
101
+
102
+ "@typescript-eslint/type-annotation-spacing": "off",
103
+ "@typescript-eslint/typedef": "off",
104
+ "@typescript-eslint/unified-signatures": "error",
105
+ "arrow-parens": ["off", "always"],
106
+ "brace-style": ["off", "off"],
107
+ "comma-dangle": "off",
108
+ complexity: "off",
109
+ "constructor-super": "error",
110
+ "dot-notation": "off",
111
+ "eol-last": "off",
112
+ eqeqeq: ["error", "smart"],
113
+ "guard-for-in": "error",
114
+
115
+ "id-denylist": [
116
+ "error",
117
+ "any",
118
+ "Number",
119
+ "number",
120
+ "String",
121
+ "string",
122
+ "Boolean",
123
+ "boolean",
124
+ "Undefined",
125
+ "undefined",
126
+ ],
127
+
128
+ "id-match": "error",
129
+ indent: "off",
130
+ "linebreak-style": "off",
131
+ "max-classes-per-file": ["error", 1],
132
+ "max-len": "off",
133
+ "new-parens": "off",
134
+ "newline-per-chained-call": "off",
135
+ "no-bitwise": "error",
136
+ "no-caller": "error",
137
+ "no-cond-assign": "error",
138
+ "no-console": "error",
139
+ "no-debugger": "error",
140
+ "no-empty": "error",
141
+ "no-empty-function": "off",
142
+ "no-eval": "error",
143
+ "no-extra-semi": "off",
144
+ "no-fallthrough": "off",
145
+ "no-invalid-this": "off",
146
+ "no-irregular-whitespace": "off",
147
+ "no-multiple-empty-lines": "off",
148
+ "no-new-wrappers": "error",
149
+ "no-shadow": "off",
150
+ "no-throw-literal": "error",
151
+ "no-trailing-spaces": "off",
152
+ "no-undef-init": "error",
153
+ "no-underscore-dangle": "off",
154
+ "no-unsafe-finally": "error",
155
+ "no-unused-expressions": "off",
156
+ "no-unused-labels": "error",
157
+ "no-use-before-define": "off",
158
+ "no-var": "error",
159
+ "object-shorthand": "error",
160
+ "one-var": ["error", "never"],
161
+
162
+ "padded-blocks": ["off", {
163
+ blocks: "never",
164
+ }, {
165
+ allowSingleLineBlocks: true,
166
+ }],
167
+ "prefer-const": "error",
168
+ "quote-props": "off",
169
+ quotes: "off",
170
+ radix: "error",
171
+
172
+ semi: "off",
173
+ "space-before-function-paren": "off",
174
+ "space-in-parens": ["off", "never"],
175
+
176
+ "spaced-comment": ["error", "always", {
177
+ markers: ["/"],
178
+ }],
179
+
180
+ "use-isnan": "error",
181
+ "valid-typeof": "off",
182
+ },
183
+ }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekbears/gb-class-validators",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Geekbears custom validators using class-validator package.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "prebuild": "rimraf lib",
10
10
  "build": "tsc",
11
11
  "format": "prettier --write \"src/**/*.ts\"",
12
- "lint": "tslint -p tsconfig.json",
12
+ "lint": "eslint -c eslint.config.mjs src/*.ts --fix",
13
13
  "prepare": "npm run build",
14
14
  "prepublishOnly": "npm test && npm run lint",
15
15
  "preversion": "npm run lint",
@@ -45,16 +45,22 @@
45
45
  },
46
46
  "homepage": "https://gitlab.com/geekbears/utilities/backend/gb-class-validators#readme",
47
47
  "devDependencies": {
48
+ "@eslint/eslintrc": "^3.1.0",
49
+ "@eslint/js": "^9.13.0",
48
50
  "@types/jest": "^29.5.13",
49
- "@types/lodash": "^4.17.9",
51
+ "@types/lodash": "^4.17.12",
50
52
  "@types/validator": "^13.12.2",
53
+ "@typescript-eslint/eslint-plugin": "^8.11.0",
54
+ "@typescript-eslint/parser": "^8.11.0",
55
+ "eslint": "^9.13.0",
56
+ "eslint-config-prettier": "^9.1.0",
57
+ "eslint-plugin-prettier": "^5.2.1",
58
+ "globals": "^15.11.0",
51
59
  "jest": "^29.7.0",
52
60
  "prettier": "^3.3.3",
53
61
  "rimraf": "^6.0.1",
54
62
  "ts-jest": "^29.2.5",
55
- "tslint": "^6.1.3",
56
- "tslint-config-prettier": "^1.18.0",
57
- "typescript": "^5.6.2"
63
+ "typescript": "^5.6.3"
58
64
  },
59
65
  "dependencies": {
60
66
  "class-validator": "^0.14.1",