@zalib/dev 5.9.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.
Files changed (38) hide show
  1. package/README.md +85 -0
  2. package/dist/eslint/helpers/index.d.ts +2 -0
  3. package/dist/eslint/helpers/index.d.ts.map +1 -0
  4. package/dist/eslint/helpers/index.js +14 -0
  5. package/dist/eslint/helpers/index.js.map +1 -0
  6. package/dist/eslint/index.d.ts +177 -0
  7. package/dist/eslint/index.d.ts.map +1 -0
  8. package/dist/eslint/index.js +11 -0
  9. package/dist/eslint/index.js.map +1 -0
  10. package/dist/eslint/nestjs-plugin/api-response.d.ts +4 -0
  11. package/dist/eslint/nestjs-plugin/api-response.d.ts.map +1 -0
  12. package/dist/eslint/nestjs-plugin/api-response.js +46 -0
  13. package/dist/eslint/nestjs-plugin/api-response.js.map +1 -0
  14. package/dist/eslint/nestjs-plugin/index.d.ts +8 -0
  15. package/dist/eslint/nestjs-plugin/index.d.ts.map +1 -0
  16. package/dist/eslint/nestjs-plugin/index.js +7 -0
  17. package/dist/eslint/nestjs-plugin/index.js.map +1 -0
  18. package/dist/eslint/nestjs.d.ts +27 -0
  19. package/dist/eslint/nestjs.d.ts.map +1 -0
  20. package/dist/eslint/nestjs.js +25 -0
  21. package/dist/eslint/nestjs.js.map +1 -0
  22. package/dist/eslint/node-js.d.ts +15 -0
  23. package/dist/eslint/node-js.d.ts.map +1 -0
  24. package/dist/eslint/node-js.js +120 -0
  25. package/dist/eslint/node-js.js.map +1 -0
  26. package/dist/eslint/node-ts.d.ts +142 -0
  27. package/dist/eslint/node-ts.d.ts.map +1 -0
  28. package/dist/eslint/node-ts.js +285 -0
  29. package/dist/eslint/node-ts.js.map +1 -0
  30. package/dist/prettier/index.d.ts +9 -0
  31. package/dist/prettier/index.d.ts.map +1 -0
  32. package/dist/prettier/index.js +12 -0
  33. package/dist/prettier/index.js.map +1 -0
  34. package/dist/sandbox/toLowerCase.d.ts +2 -0
  35. package/dist/sandbox/toLowerCase.d.ts.map +1 -0
  36. package/dist/sandbox/toLowerCase.js +7 -0
  37. package/dist/sandbox/toLowerCase.js.map +1 -0
  38. package/package.json +79 -0
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # Package `@zalib/dev`
2
+
3
+ Development tooling package.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm i -D @zalib/dev
9
+ ```
10
+
11
+ ---
12
+
13
+ # ESLint configurations
14
+
15
+ The package uses:
16
+
17
+ - ESLint 9 flat config
18
+ - Prettier for formatting
19
+ - `eslint-plugin-import-x`
20
+ - `eslint-plugin-security`
21
+ - `eslint-plugin-perfectionist`
22
+ - `@typescript-eslint`
23
+
24
+ ## Included Configurations
25
+
26
+ | Config | Description |
27
+ | ------------------- | ------------------------------------------------ |
28
+ | `getNodeJsConfig()` | Get ESLint config method for JavaScript projects |
29
+ | `getNodeTsConfig()` | Get ESLint config method for TypeScript projects |
30
+ | `getNestjsConfig()` | Get ESLint config method for NestJS projects |
31
+
32
+ ### `eslint.config.js`
33
+
34
+ ```js
35
+ const {
36
+ defineConfig,
37
+ getNodeJsConfig,
38
+ getNodeTsConfig,
39
+ } = require('@zalib/dev/eslint');
40
+
41
+ module.exports = defineConfig([
42
+ { ignores: ['**/node_modules/**', '**/dist/**'] },
43
+ ...getNodeJsConfig(),
44
+ ...getNodeTsConfig(),
45
+ ]);
46
+ ```
47
+
48
+ ---
49
+
50
+ # Prettier configurations
51
+
52
+ ### `prettier.config.js`
53
+
54
+ ```js
55
+ const prettierConfig = require('@zalib/dev/prettier');
56
+
57
+ module.exports = { ...prettierConfig };
58
+ ```
59
+
60
+ ---
61
+
62
+ # VSCode Integration
63
+
64
+ ### `.vscode/settings.json`
65
+
66
+ ```json
67
+ {
68
+ "editor.formatOnSave": true,
69
+ "editor.formatOnPaste": false,
70
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
71
+ "editor.codeActionsOnSave": {
72
+ "source.fixAll.eslint": "explicit"
73
+ },
74
+ "eslint.validate": ["javascript", "typescript"]
75
+ }
76
+ ```
77
+
78
+ ---
79
+
80
+ # Requirements
81
+
82
+ | Tool | Version |
83
+ | ---------- | ------- |
84
+ | Node.js | 22.22+ |
85
+ | TypeScript | 5.9+ |
@@ -0,0 +1,2 @@
1
+ export function isModuleInstalled(moduleName: any): boolean;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eslint/helpers/index.js"],"names":[],"mappings":"AAGA,4DAQC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ const isModuleInstalled = (moduleName) => {
3
+ try {
4
+ require.resolve(moduleName);
5
+ return true;
6
+ }
7
+ catch {
8
+ return false;
9
+ }
10
+ };
11
+ module.exports = {
12
+ isModuleInstalled,
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/eslint/helpers/index.js"],"names":[],"mappings":";AAGA,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,EAAE;IACvC,IAAI,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAE5B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG;IACf,iBAAiB;CAClB,CAAC","sourcesContent":["/**\n * Хелпер для проверки установки плагина\n */\nconst isModuleInstalled = (moduleName) => {\n try {\n require.resolve(moduleName);\n\n return true;\n } catch {\n return false;\n }\n};\n\nmodule.exports = {\n isModuleInstalled,\n};\n"]}
@@ -0,0 +1,177 @@
1
+ import { defineConfig } from "eslint/config";
2
+ import { isModuleInstalled } from "./helpers";
3
+ export declare let getNestjsConfig: ({ files }?: {}) => {
4
+ files: any;
5
+ plugins: {
6
+ nestjs: {
7
+ rules: {
8
+ 'api-response': {
9
+ create(context: any): {
10
+ MethodDefinition(node: any): void;
11
+ };
12
+ };
13
+ };
14
+ };
15
+ };
16
+ rules: {
17
+ '@typescript-eslint/no-restricted-imports': (string | {
18
+ paths: {
19
+ allowTypeImports: boolean;
20
+ importNames: string[];
21
+ message: string;
22
+ name: string;
23
+ }[];
24
+ })[];
25
+ 'nestjs/api-response': string;
26
+ };
27
+ }[];
28
+ export declare let getNodeJsConfig: ({ files }?: {}) => ({
29
+ rules: Record<string, 0 | "off">;
30
+ } | {
31
+ files: any;
32
+ plugins: {
33
+ 'import-x': typeof import("eslint-plugin-import-x");
34
+ perfectionist: typeof import("eslint-plugin-perfectionist", { with: { "resolution-mode": "import" } });
35
+ security: any;
36
+ };
37
+ rules: any;
38
+ })[];
39
+ export declare let getNodeTsConfig: ({ files, tsconfig }?: {}) => {
40
+ files: any;
41
+ languageOptions: {
42
+ parser: typeof import("@typescript-eslint/parser");
43
+ parserOptions: {
44
+ ecmaFeatures: {
45
+ modules: boolean;
46
+ };
47
+ project: any;
48
+ sourceType: string;
49
+ };
50
+ };
51
+ plugins: {
52
+ '@typescript-eslint': {
53
+ configs: Record<string, import("@typescript-eslint/utils/ts-eslint").ClassicConfig.Config>;
54
+ meta: import("@typescript-eslint/utils/ts-eslint").FlatConfig.PluginMeta;
55
+ rules: typeof import("@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules");
56
+ };
57
+ 'import-x': typeof import("eslint-plugin-import-x");
58
+ perfectionist: typeof import("eslint-plugin-perfectionist", { with: { "resolution-mode": "import" } });
59
+ security: any;
60
+ };
61
+ rules: {
62
+ '@typescript-eslint/await-thenable': string;
63
+ '@typescript-eslint/consistent-type-imports': (string | {
64
+ prefer: string;
65
+ })[];
66
+ '@typescript-eslint/explicit-function-return-type': (string | {
67
+ allowExpressions: boolean;
68
+ })[];
69
+ '@typescript-eslint/explicit-member-accessibility': (string | {
70
+ accessibility: string;
71
+ overrides: {
72
+ constructors: string;
73
+ };
74
+ })[];
75
+ '@typescript-eslint/explicit-module-boundary-types': string;
76
+ '@typescript-eslint/member-ordering': (string | {
77
+ default: any[];
78
+ })[];
79
+ '@typescript-eslint/naming-convention': (string | {
80
+ format: string[];
81
+ leadingUnderscore: string;
82
+ selector: string;
83
+ trailingUnderscore: string;
84
+ modifiers?: undefined;
85
+ } | {
86
+ format: null;
87
+ modifiers: string[];
88
+ selector: string[];
89
+ leadingUnderscore?: undefined;
90
+ trailingUnderscore?: undefined;
91
+ } | {
92
+ format: null;
93
+ modifiers: string[];
94
+ selector: string;
95
+ leadingUnderscore?: undefined;
96
+ trailingUnderscore?: undefined;
97
+ })[];
98
+ '@typescript-eslint/no-base-to-string': string;
99
+ '@typescript-eslint/no-empty-function': (string | {
100
+ allow: string[];
101
+ })[];
102
+ '@typescript-eslint/no-empty-object-type': string;
103
+ '@typescript-eslint/no-explicit-any': string;
104
+ '@typescript-eslint/no-floating-promises': string;
105
+ '@typescript-eslint/no-magic-numbers': (string | {
106
+ ignore: number[];
107
+ ignoreArrayIndexes: boolean;
108
+ ignoreDefaultValues: boolean;
109
+ ignoreEnums: boolean;
110
+ ignoreNumericLiteralTypes: boolean;
111
+ ignoreReadonlyClassProperties: boolean;
112
+ })[];
113
+ '@typescript-eslint/no-misused-promises': string;
114
+ '@typescript-eslint/no-unsafe-argument': string;
115
+ '@typescript-eslint/no-unsafe-assignment': string;
116
+ '@typescript-eslint/no-unsafe-call': string;
117
+ '@typescript-eslint/no-unsafe-function-type': string;
118
+ '@typescript-eslint/no-unsafe-member-access': string;
119
+ '@typescript-eslint/no-unsafe-return': string;
120
+ '@typescript-eslint/no-wrapper-object-types': string;
121
+ '@typescript-eslint/require-await': string;
122
+ '@typescript-eslint/restrict-template-expressions': (string | {
123
+ allowAny: boolean;
124
+ allowBoolean: boolean;
125
+ allowNullish: boolean;
126
+ allowNumber: boolean;
127
+ })[];
128
+ '@typescript-eslint/return-await': string[];
129
+ 'import-x/default': string;
130
+ 'import-x/export': string;
131
+ 'import-x/extensions': string;
132
+ 'import-x/first': string;
133
+ 'import-x/named': string;
134
+ 'import-x/namespace': string;
135
+ 'import-x/newline-after-import': string;
136
+ 'import-x/no-cycle': string;
137
+ 'import-x/no-extraneous-dependencies': (string | {
138
+ devDependencies: boolean;
139
+ })[];
140
+ 'import-x/no-unresolved': string;
141
+ 'import-x/order': string;
142
+ 'import-x/prefer-default-export': string;
143
+ 'max-classes-per-file': string;
144
+ 'perfectionist/sort-enums': (string | {
145
+ order: string;
146
+ type: string;
147
+ })[];
148
+ 'perfectionist/sort-imports': (string | {
149
+ customGroups: any[];
150
+ groups: (string | string[])[];
151
+ ignoreCase: boolean;
152
+ internalPattern: string[];
153
+ newlinesBetween: number;
154
+ order: string;
155
+ sortSideEffects: boolean;
156
+ type: string;
157
+ })[];
158
+ 'perfectionist/sort-interfaces': (string | {
159
+ order: string;
160
+ type: string;
161
+ })[];
162
+ 'perfectionist/sort-object-types': (string | {
163
+ order: string;
164
+ type: string;
165
+ })[];
166
+ 'sort-imports': string;
167
+ };
168
+ settings: {
169
+ 'import/resolver': {
170
+ typescript: {
171
+ project: any;
172
+ };
173
+ }[];
174
+ };
175
+ }[];
176
+ export { defineConfig, isModuleInstalled };
177
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eslint/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ const { defineConfig } = require('eslint/config');
3
+ const { isModuleInstalled } = require('./helpers');
4
+ module.exports = {
5
+ defineConfig,
6
+ getNestjsConfig: require('./nestjs'),
7
+ getNodeJsConfig: require('./node-js'),
8
+ getNodeTsConfig: require('./node-ts'),
9
+ isModuleInstalled,
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eslint/index.js"],"names":[],"mappings":";AAAA,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAElD,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEnD,MAAM,CAAC,OAAO,GAAG;IACf,YAAY;IACZ,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC;IACpC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC;IACrC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC;IACrC,iBAAiB;CAClB,CAAC","sourcesContent":["const { defineConfig } = require('eslint/config');\n\nconst { isModuleInstalled } = require('./helpers');\n\nmodule.exports = {\n defineConfig,\n getNestjsConfig: require('./nestjs'),\n getNodeJsConfig: require('./node-js'),\n getNodeTsConfig: require('./node-ts'),\n isModuleInstalled,\n};\n"]}
@@ -0,0 +1,4 @@
1
+ export function create(context: any): {
2
+ MethodDefinition(node: any): void;
3
+ };
4
+ //# sourceMappingURL=api-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-response.d.ts","sourceRoot":"","sources":["../../../src/eslint/nestjs-plugin/api-response.js"],"names":[],"mappings":"AAME;;EAwDC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ const controllerMethods = new Set(['Get', 'Post', 'Put', 'Delete', 'Patch']);
3
+ const decoratorTypes = new Set(['ClassDeclaration', 'MethodDefinition']);
4
+ module.exports = {
5
+ create(context) {
6
+ function getNodeDecorators(node) {
7
+ return decoratorTypes.has(node.type) && node.decorators
8
+ ? node.decorators
9
+ .map(({ expression }) => expression.callee?.name)
10
+ .filter(Boolean)
11
+ : [];
12
+ }
13
+ function ignoreControllerMethod(node) {
14
+ if (node.key.name === 'constructor')
15
+ return true;
16
+ const methodDecorators = getNodeDecorators(node);
17
+ const parentDecorators = getNodeDecorators(node.parent.parent);
18
+ if (!parentDecorators.includes('ApiController'))
19
+ return true;
20
+ if (methodDecorators.includes('AnyResponse'))
21
+ return true;
22
+ return !node.decorators?.some(({ expression }) => controllerMethods.has(expression.callee?.name));
23
+ }
24
+ function isApiResponseType(typeAnnotation, level = 0) {
25
+ if (level === 0 && typeAnnotation?.typeName?.name === 'Promise') {
26
+ const typeArgument = typeAnnotation.typeArguments?.params[0];
27
+ return isApiResponseType(typeArgument, level + 1);
28
+ }
29
+ if (typeAnnotation?.type === 'TSVoidKeyword')
30
+ return true;
31
+ return (typeAnnotation?.type === 'TSTypeReference' &&
32
+ typeAnnotation.typeName?.name === 'ApiResponse');
33
+ }
34
+ return {
35
+ MethodDefinition(node) {
36
+ if (ignoreControllerMethod(node))
37
+ return;
38
+ if (!isApiResponseType(node.value.returnType?.typeAnnotation)) {
39
+ const message = 'The return type must be "ApiResponse<T>" or "void"';
40
+ context.report({ message, node });
41
+ }
42
+ },
43
+ };
44
+ },
45
+ };
46
+ //# sourceMappingURL=api-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-response.js","sourceRoot":"","sources":["../../../src/eslint/nestjs-plugin/api-response.js"],"names":[],"mappings":";AAEA,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7E,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAEzE,MAAM,CAAC,OAAO,GAAG;IACf,MAAM,CAAC,OAAO;QAEZ,SAAS,iBAAiB,CAAC,IAAI;YAC7B,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU;gBACrD,CAAC,CAAC,IAAI,CAAC,UAAU;qBACZ,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC;qBAChD,MAAM,CAAC,OAAO,CAAC;gBACpB,CAAC,CAAC,EAAE,CAAC;QACT,CAAC;QAGD,SAAS,sBAAsB,CAAC,IAAI;YAClC,IAAI,IAAI,CAAC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AC;oBAC9D,MAAM,OAAO,GAAG,oDAAoD,CAAC;oBAErE,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpC,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* eslint-disable complexity */\n\nconst controllerMethods = new Set(['Get', 'Post', 'Put', 'Delete', 'Patch']);\nconst decoratorTypes = new Set(['ClassDeclaration', 'MethodDefinition']);\n\nmodule.exports = {\n create(context) {\n // собирает декораторы узла\n function getNodeDecorators(node) {\n return decoratorTypes.has(node.type) && node.decorators\n ? node.decorators\n .map(({ expression }) => expression.callee?.name)\n .filter(Boolean)\n : [];\n }\n\n // проверка на игнорирование метода\n function ignoreControllerMethod(node) {\n if (node.key.name === 'constructor') return true;\n\n const methodDecorators = getNodeDecorators(node);\n const parentDecorators = getNodeDecorators(node.parent.parent);\n\n // игнорировать, если это не метод @ApiController\n if (!parentDecorators.includes('ApiController')) return true;\n\n // игнорировать, если есть декоратор @AnyResponse\n if (methodDecorators.includes('AnyResponse')) return true;\n\n // игнорировать, если нет декоратора роутинга\n return !node.decorators?.some(({ expression }) =>\n controllerMethods.has(expression.callee?.name),\n );\n }\n\n // рекурсивный проход по описанию типа\n function isApiResponseType(typeAnnotation, level = 0) {\n if (level === 0 && typeAnnotation?.typeName?.name === 'Promise') {\n const typeArgument = typeAnnotation.typeArguments?.params[0];\n\n return isApiResponseType(typeArgument, level + 1);\n }\n\n if (typeAnnotation?.type === 'TSVoidKeyword') return true;\n\n return (\n typeAnnotation?.type === 'TSTypeReference' &&\n typeAnnotation.typeName?.name === 'ApiResponse'\n );\n }\n\n return {\n MethodDefinition(node) {\n if (ignoreControllerMethod(node)) return;\n\n if (!isApiResponseType(node.value.returnType?.typeAnnotation)) {\n const message = 'The return type must be \"ApiResponse<T>\" or \"void\"';\n\n context.report({ message, node });\n }\n },\n };\n },\n};\n"]}
@@ -0,0 +1,8 @@
1
+ export let rules: {
2
+ 'api-response': {
3
+ create(context: any): {
4
+ MethodDefinition(node: any): void;
5
+ };
6
+ };
7
+ };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eslint/nestjs-plugin/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ module.exports = {
3
+ rules: {
4
+ 'api-response': require('./api-response'),
5
+ },
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/eslint/nestjs-plugin/index.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,KAAK,EAAE;QACL,cAAc,EAAE,OAAO,CAAC,gBAAgB,CAAC;KAC1C;CACF,CAAC","sourcesContent":["module.exports = {\n rules: {\n 'api-response': require('./api-response'),\n },\n};\n"]}
@@ -0,0 +1,27 @@
1
+ declare function _exports({ files }?: {}): {
2
+ files: any;
3
+ plugins: {
4
+ nestjs: {
5
+ rules: {
6
+ 'api-response': {
7
+ create(context: any): {
8
+ MethodDefinition(node: any): void;
9
+ };
10
+ };
11
+ };
12
+ };
13
+ };
14
+ rules: {
15
+ '@typescript-eslint/no-restricted-imports': (string | {
16
+ paths: {
17
+ allowTypeImports: boolean;
18
+ importNames: string[];
19
+ message: string;
20
+ name: string;
21
+ }[];
22
+ })[];
23
+ 'nestjs/api-response': string;
24
+ };
25
+ }[];
26
+ export = _exports;
27
+ //# sourceMappingURL=nestjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestjs.d.ts","sourceRoot":"","sources":["../../src/eslint/nestjs.js"],"names":[],"mappings":"AAEiB;;;;;;;;;;;;;;;;;;;;;;;;IAqBhB"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ const nestjsPlugin = require('./nestjs-plugin');
3
+ module.exports = ({ files } = {}) => [
4
+ {
5
+ files: files || ['**/*.controller.ts'],
6
+ plugins: { nestjs: nestjsPlugin },
7
+ rules: {
8
+ '@typescript-eslint/no-restricted-imports': [
9
+ 'error',
10
+ {
11
+ paths: [
12
+ {
13
+ allowTypeImports: true,
14
+ importNames: ['Controller'],
15
+ message: 'Use ApiController from @common/nest',
16
+ name: '@nestjs/common',
17
+ },
18
+ ],
19
+ },
20
+ ],
21
+ 'nestjs/api-response': 'error',
22
+ },
23
+ },
24
+ ];
25
+ //# sourceMappingURL=nestjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestjs.js","sourceRoot":"","sources":["../../src/eslint/nestjs.js"],"names":[],"mappings":";AAAA,MAAM,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhD,MAAM,CAAC,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;IACnC;QACE,KAAK,EAAE,KAAK,IAAI,CAAC,oBAAoB,CAAC;QACtC,OAAO,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;QACjC,KAAK,EAAE;YACL,0CAA0C,EAAE;gBAC1C,OAAO;gBACP;oBACE,KAAK,EAAE;wBACL;4BACE,gBAAgB,EAAE,IAAI;4BACtB,WAAW,EAAE,CAAC,YAAY,CAAC;4BAC3B,OAAO,EAAE,qCAAqC;4BAC9C,IAAI,EAAE,gBAAgB;yBACvB;qBACF;iBACF;aACF;YACD,qBAAqB,EAAE,OAAO;SAC/B;KACF;CACF,CAAC","sourcesContent":["const nestjsPlugin = require('./nestjs-plugin');\n\nmodule.exports = ({ files } = {}) => [\n {\n files: files || ['**/*.controller.ts'],\n plugins: { nestjs: nestjsPlugin },\n rules: {\n '@typescript-eslint/no-restricted-imports': [\n 'error',\n {\n paths: [\n {\n allowTypeImports: true,\n importNames: ['Controller'],\n message: 'Use ApiController from @common/nest',\n name: '@nestjs/common',\n },\n ],\n },\n ],\n 'nestjs/api-response': 'error',\n },\n },\n];\n"]}
@@ -0,0 +1,15 @@
1
+ declare function _exports({ files }?: {}): ({
2
+ rules: Record<string, 0 | "off">;
3
+ } | {
4
+ files: any;
5
+ plugins: {
6
+ 'import-x': typeof importXPlugin;
7
+ perfectionist: typeof perfectionistPlugin;
8
+ security: any;
9
+ };
10
+ rules: any;
11
+ })[];
12
+ export = _exports;
13
+ import importXPlugin = require("eslint-plugin-import-x");
14
+ import perfectionistPlugin = require("eslint-plugin-perfectionist");
15
+ //# sourceMappingURL=node-js.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-js.d.ts","sourceRoot":"","sources":["../../src/eslint/node-js.js"],"names":[],"mappings":"AAKiB;;;;;;;;;;KAiJhB"}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ const prettierConfig = require('eslint-config-prettier');
3
+ const importXPlugin = require('eslint-plugin-import-x');
4
+ const perfectionistPlugin = require('eslint-plugin-perfectionist');
5
+ const securityPlugin = require('eslint-plugin-security');
6
+ module.exports = ({ files } = {}) => [
7
+ {
8
+ files: files || ['**/*.js'],
9
+ plugins: {
10
+ 'import-x': importXPlugin,
11
+ perfectionist: perfectionistPlugin,
12
+ security: securityPlugin,
13
+ },
14
+ rules: {
15
+ ...securityPlugin.configs.recommended.rules,
16
+ 'arrow-parens': [
17
+ 'warn',
18
+ 'always',
19
+ {
20
+ requireForBlockBody: true,
21
+ },
22
+ ],
23
+ 'class-methods-use-this': 'off',
24
+ 'comma-dangle': [
25
+ 'error',
26
+ {
27
+ arrays: 'always-multiline',
28
+ exports: 'always-multiline',
29
+ functions: 'always-multiline',
30
+ imports: 'always-multiline',
31
+ objects: 'always-multiline',
32
+ },
33
+ ],
34
+ complexity: ['error', { max: 10 }],
35
+ 'function-paren-newline': 'off',
36
+ 'implicit-arrow-linebreak': 'off',
37
+ 'import-x/extensions': 'off',
38
+ 'import-x/no-unresolved': 'off',
39
+ 'import-x/order': [
40
+ 'error',
41
+ {
42
+ alphabetize: {
43
+ caseInsensitive: true,
44
+ order: 'asc',
45
+ },
46
+ groups: [
47
+ 'builtin',
48
+ 'external',
49
+ 'internal',
50
+ ['parent', 'sibling'],
51
+ 'index',
52
+ 'type',
53
+ ],
54
+ 'newlines-between': 'always',
55
+ warnOnUnassignedImports: true,
56
+ },
57
+ ],
58
+ 'jest/no-deprecated-functions': 'off',
59
+ 'max-lines': [
60
+ 'error',
61
+ {
62
+ max: 500,
63
+ skipBlankLines: false,
64
+ skipComments: true,
65
+ },
66
+ ],
67
+ 'max-lines-per-function': [
68
+ 'error',
69
+ {
70
+ max: 200,
71
+ skipBlankLines: false,
72
+ skipComments: true,
73
+ },
74
+ ],
75
+ 'max-params': ['error', { max: 3 }],
76
+ 'no-await-in-loop': 'off',
77
+ 'no-continue': 'off',
78
+ 'no-empty-function': 'off',
79
+ 'no-plusplus': [
80
+ 'error',
81
+ {
82
+ allowForLoopAfterthoughts: true,
83
+ },
84
+ ],
85
+ 'no-promise-executor-return': 'off',
86
+ 'no-restricted-syntax': 'off',
87
+ 'padding-line-between-statements': [
88
+ 'error',
89
+ {
90
+ blankLine: 'always',
91
+ next: '*',
92
+ prev: ['block-like'],
93
+ },
94
+ {
95
+ blankLine: 'always',
96
+ next: 'if',
97
+ prev: '*',
98
+ },
99
+ {
100
+ blankLine: 'always',
101
+ next: '*',
102
+ prev: 'if',
103
+ },
104
+ ],
105
+ 'perfectionist/sort-objects': [
106
+ 'error',
107
+ {
108
+ order: 'asc',
109
+ type: 'natural',
110
+ },
111
+ ],
112
+ 'require-await': 'off',
113
+ 'sort-imports': 'off',
114
+ 'sort-keys': 'off',
115
+ strict: 'off',
116
+ },
117
+ },
118
+ prettierConfig,
119
+ ];
120
+ //# sourceMappingURL=node-js.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-js.js","sourceRoot":"","sources":["../../src/eslint/node-js.js"],"names":[],"mappings":";AAAA,MAAM,cAAc,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACzD,MAAM,aAAa,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAC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AE,KAAK;YAErC,WAAW,EAAE;gBACX,OAAO;gBACP;oBACE,GAAG,EAAE,GAAG;oBACR,cAAc,EAAE,KAAK;oBACrB,YAAY,EAAE,IAAI;iBACnB;aACF;YAED,wBAAwB,EAAE;gBACxB,OAAO;gBACP;oBACE,GAAG,EAAE,GAAG;oBACR,cAAc,EAAE,KAAK;oBACrB,YAAY,EAAE,IAAI;iBACnB;aACF;YAED,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;YAEnC,kBAAkB,EAAE,KAAK;YAEzB,aAAa,EAAE,KAAK;YAEpB,mBAAmB,EAAE,KAAK;YAE1B,aAAa,EAAE;gBACb,OAAO;gBACP;oBACE,yBAAyB,EAAE,IAAI;iBAChC;aACF;YAED,4BAA4B,EAAE,KAAK;YAEnC,sBAAsB,EAAE,KAAK;YAE7B,iCAAiC,EAAE;gBACjC,OAAO;gBAEP;oBACE,SAAS,EAAE,QAAQ;oBACnB,IAAI,EAAE,GAAG;oBACT,IAAI,EAAE,CAAC,YAAY,CAAC;iBACrB;gBAED;oBACE,SAAS,EAAE,QAAQ;oBACnB,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,GAAG;iBACV;gBAED;oBACE,SAAS,EAAE,QAAQ;oBACnB,IAAI,EAAE,GAAG;oBACT,IAAI,EAAE,IAAI;iBACX;aACF;YAED,4BAA4B,EAAE;gBAC5B,OAAO;gBACP;oBACE,KAAK,EAAE,KAAK;oBAEZ,IAAI,EAAE,SAAS;iBAChB;aACF;YACD,eAAe,EAAE,KAAK;YAEtB,cAAc,EAAE,KAAK;YAErB,WAAW,EAAE,KAAK;YAElB,MAAM,EAAE,KAAK;SACd;KACF;IAED,cAAc;CACf,CAAC","sourcesContent":["const prettierConfig = require('eslint-config-prettier');\nconst importXPlugin = require('eslint-plugin-import-x');\nconst perfectionistPlugin = require('eslint-plugin-perfectionist');\nconst securityPlugin = require('eslint-plugin-security');\n\nmodule.exports = ({ files } = {}) => [\n {\n files: files || ['**/*.js'],\n plugins: {\n 'import-x': importXPlugin,\n perfectionist: perfectionistPlugin,\n security: securityPlugin,\n },\n rules: {\n ...securityPlugin.configs.recommended.rules,\n\n 'arrow-parens': [\n 'warn',\n 'always',\n {\n requireForBlockBody: true,\n },\n ],\n\n 'class-methods-use-this': 'off',\n\n 'comma-dangle': [\n 'error',\n {\n arrays: 'always-multiline',\n exports: 'always-multiline',\n functions: 'always-multiline',\n imports: 'always-multiline',\n objects: 'always-multiline',\n },\n ],\n\n complexity: ['error', { max: 10 }],\n\n 'function-paren-newline': 'off',\n\n 'implicit-arrow-linebreak': 'off',\n\n 'import-x/extensions': 'off',\n\n 'import-x/no-unresolved': 'off',\n\n 'import-x/order': [\n 'error',\n {\n alphabetize: {\n caseInsensitive: true,\n order: 'asc',\n },\n\n groups: [\n 'builtin',\n 'external',\n 'internal',\n ['parent', 'sibling'],\n 'index',\n 'type',\n ],\n\n 'newlines-between': 'always',\n\n warnOnUnassignedImports: true,\n },\n ],\n\n 'jest/no-deprecated-functions': 'off',\n\n 'max-lines': [\n 'error',\n {\n max: 500,\n skipBlankLines: false,\n skipComments: true,\n },\n ],\n\n 'max-lines-per-function': [\n 'error',\n {\n max: 200,\n skipBlankLines: false,\n skipComments: true,\n },\n ],\n\n 'max-params': ['error', { max: 3 }],\n\n 'no-await-in-loop': 'off',\n\n 'no-continue': 'off',\n\n 'no-empty-function': 'off',\n\n 'no-plusplus': [\n 'error',\n {\n allowForLoopAfterthoughts: true,\n },\n ],\n\n 'no-promise-executor-return': 'off',\n\n 'no-restricted-syntax': 'off',\n\n 'padding-line-between-statements': [\n 'error',\n\n {\n blankLine: 'always',\n next: '*',\n prev: ['block-like'],\n },\n\n {\n blankLine: 'always',\n next: 'if',\n prev: '*',\n },\n\n {\n blankLine: 'always',\n next: '*',\n prev: 'if',\n },\n ],\n\n 'perfectionist/sort-objects': [\n 'error',\n {\n order: 'asc',\n\n type: 'natural',\n },\n ],\n 'require-await': 'off',\n\n 'sort-imports': 'off',\n\n 'sort-keys': 'off',\n\n strict: 'off',\n },\n },\n\n prettierConfig,\n];\n"]}
@@ -0,0 +1,142 @@
1
+ declare function _exports({ files, tsconfig }?: {}): {
2
+ files: any;
3
+ languageOptions: {
4
+ parser: typeof tsParser;
5
+ parserOptions: {
6
+ ecmaFeatures: {
7
+ modules: boolean;
8
+ };
9
+ project: any;
10
+ sourceType: string;
11
+ };
12
+ };
13
+ plugins: {
14
+ '@typescript-eslint': {
15
+ configs: Record<string, import("@typescript-eslint/utils/ts-eslint").ClassicConfig.Config>;
16
+ meta: import("@typescript-eslint/utils/ts-eslint").FlatConfig.PluginMeta;
17
+ rules: typeof import("@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules");
18
+ };
19
+ 'import-x': typeof importXPlugin;
20
+ perfectionist: typeof tsPerfectionistPlugin;
21
+ security: any;
22
+ };
23
+ rules: {
24
+ '@typescript-eslint/await-thenable': string;
25
+ '@typescript-eslint/consistent-type-imports': (string | {
26
+ prefer: string;
27
+ })[];
28
+ '@typescript-eslint/explicit-function-return-type': (string | {
29
+ allowExpressions: boolean;
30
+ })[];
31
+ '@typescript-eslint/explicit-member-accessibility': (string | {
32
+ accessibility: string;
33
+ overrides: {
34
+ constructors: string;
35
+ };
36
+ })[];
37
+ '@typescript-eslint/explicit-module-boundary-types': string;
38
+ '@typescript-eslint/member-ordering': (string | {
39
+ default: any[];
40
+ })[];
41
+ '@typescript-eslint/naming-convention': (string | {
42
+ format: string[];
43
+ leadingUnderscore: string;
44
+ selector: string;
45
+ trailingUnderscore: string;
46
+ modifiers?: undefined;
47
+ } | {
48
+ format: null;
49
+ modifiers: string[];
50
+ selector: string[];
51
+ leadingUnderscore?: undefined;
52
+ trailingUnderscore?: undefined;
53
+ } | {
54
+ format: null;
55
+ modifiers: string[];
56
+ selector: string;
57
+ leadingUnderscore?: undefined;
58
+ trailingUnderscore?: undefined;
59
+ })[];
60
+ '@typescript-eslint/no-base-to-string': string;
61
+ '@typescript-eslint/no-empty-function': (string | {
62
+ allow: string[];
63
+ })[];
64
+ '@typescript-eslint/no-empty-object-type': string;
65
+ '@typescript-eslint/no-explicit-any': string;
66
+ '@typescript-eslint/no-floating-promises': string;
67
+ '@typescript-eslint/no-magic-numbers': (string | {
68
+ ignore: number[];
69
+ ignoreArrayIndexes: boolean;
70
+ ignoreDefaultValues: boolean;
71
+ ignoreEnums: boolean;
72
+ ignoreNumericLiteralTypes: boolean;
73
+ ignoreReadonlyClassProperties: boolean;
74
+ })[];
75
+ '@typescript-eslint/no-misused-promises': string;
76
+ '@typescript-eslint/no-unsafe-argument': string;
77
+ '@typescript-eslint/no-unsafe-assignment': string;
78
+ '@typescript-eslint/no-unsafe-call': string;
79
+ '@typescript-eslint/no-unsafe-function-type': string;
80
+ '@typescript-eslint/no-unsafe-member-access': string;
81
+ '@typescript-eslint/no-unsafe-return': string;
82
+ '@typescript-eslint/no-wrapper-object-types': string;
83
+ '@typescript-eslint/require-await': string;
84
+ '@typescript-eslint/restrict-template-expressions': (string | {
85
+ allowAny: boolean;
86
+ allowBoolean: boolean;
87
+ allowNullish: boolean;
88
+ allowNumber: boolean;
89
+ })[];
90
+ '@typescript-eslint/return-await': string[];
91
+ 'import-x/default': string;
92
+ 'import-x/export': string;
93
+ 'import-x/extensions': string;
94
+ 'import-x/first': string;
95
+ 'import-x/named': string;
96
+ 'import-x/namespace': string;
97
+ 'import-x/newline-after-import': string;
98
+ 'import-x/no-cycle': string;
99
+ 'import-x/no-extraneous-dependencies': (string | {
100
+ devDependencies: boolean;
101
+ })[];
102
+ 'import-x/no-unresolved': string;
103
+ 'import-x/order': string;
104
+ 'import-x/prefer-default-export': string;
105
+ 'max-classes-per-file': string;
106
+ 'perfectionist/sort-enums': (string | {
107
+ order: string;
108
+ type: string;
109
+ })[];
110
+ 'perfectionist/sort-imports': (string | {
111
+ customGroups: any[];
112
+ groups: (string | string[])[];
113
+ ignoreCase: boolean;
114
+ internalPattern: string[];
115
+ newlinesBetween: number;
116
+ order: string;
117
+ sortSideEffects: boolean;
118
+ type: string;
119
+ })[];
120
+ 'perfectionist/sort-interfaces': (string | {
121
+ order: string;
122
+ type: string;
123
+ })[];
124
+ 'perfectionist/sort-object-types': (string | {
125
+ order: string;
126
+ type: string;
127
+ })[];
128
+ 'sort-imports': string;
129
+ };
130
+ settings: {
131
+ 'import/resolver': {
132
+ typescript: {
133
+ project: any;
134
+ };
135
+ }[];
136
+ };
137
+ }[];
138
+ export = _exports;
139
+ import tsParser = require("@typescript-eslint/parser");
140
+ import importXPlugin = require("eslint-plugin-import-x");
141
+ import tsPerfectionistPlugin = require("eslint-plugin-perfectionist");
142
+ //# sourceMappingURL=node-ts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-ts.d.ts","sourceRoot":"","sources":["../../src/eslint/node-ts.js"],"names":[],"mappings":"AA8CiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkRhB"}
@@ -0,0 +1,285 @@
1
+ "use strict";
2
+ const tsEslintPlugin = require('@typescript-eslint/eslint-plugin');
3
+ const tsParser = require('@typescript-eslint/parser');
4
+ const importXPlugin = require('eslint-plugin-import-x');
5
+ const tsPerfectionistPlugin = require('eslint-plugin-perfectionist');
6
+ const securityPlugin = require('eslint-plugin-security');
7
+ const nodeJsConfig = require('./node-js');
8
+ function eslintMembersGroup(suffix) {
9
+ return [
10
+ `public-static-${suffix}`,
11
+ `protected-static-${suffix}`,
12
+ `private-static-${suffix}`,
13
+ `#private-static-${suffix}`,
14
+ `public-instance-${suffix}`,
15
+ `protected-instance-${suffix}`,
16
+ `private-instance-${suffix}`,
17
+ `#private-instance-${suffix}`,
18
+ `public-abstract-${suffix}`,
19
+ `protected-abstract-${suffix}`,
20
+ `public-${suffix}`,
21
+ `protected-${suffix}`,
22
+ `private-${suffix}`,
23
+ `#private-${suffix}`,
24
+ `static-${suffix}`,
25
+ `instance-${suffix}`,
26
+ `abstract-${suffix}`,
27
+ suffix,
28
+ ];
29
+ }
30
+ function eslintImportSortCustomGroups(prefix, selectors, pattern) {
31
+ return selectors.map((selector) => ({
32
+ elementNamePattern: pattern,
33
+ groupName: `${prefix}-${selector}`,
34
+ selector,
35
+ }));
36
+ }
37
+ module.exports = ({ files, tsconfig } = {}) => [
38
+ {
39
+ files: files || ['**/*.ts'],
40
+ languageOptions: {
41
+ parser: tsParser,
42
+ parserOptions: {
43
+ ecmaFeatures: { modules: true },
44
+ project: tsconfig || './tsconfig.json',
45
+ sourceType: 'module',
46
+ },
47
+ },
48
+ plugins: {
49
+ '@typescript-eslint': tsEslintPlugin,
50
+ 'import-x': importXPlugin,
51
+ perfectionist: tsPerfectionistPlugin,
52
+ security: securityPlugin,
53
+ },
54
+ rules: {
55
+ ...tsEslintPlugin.configs.recommended.rules,
56
+ ...tsEslintPlugin.configs['recommended-requiring-type-checking'].rules,
57
+ '@typescript-eslint/await-thenable': 'warn',
58
+ '@typescript-eslint/consistent-type-imports': [
59
+ 'error',
60
+ {
61
+ prefer: 'type-imports',
62
+ },
63
+ ],
64
+ '@typescript-eslint/explicit-function-return-type': [
65
+ 'error',
66
+ {
67
+ allowExpressions: true,
68
+ },
69
+ ],
70
+ '@typescript-eslint/explicit-member-accessibility': [
71
+ 'error',
72
+ {
73
+ accessibility: 'explicit',
74
+ overrides: {
75
+ constructors: 'no-public',
76
+ },
77
+ },
78
+ ],
79
+ '@typescript-eslint/explicit-module-boundary-types': 'error',
80
+ '@typescript-eslint/member-ordering': [
81
+ 'error',
82
+ {
83
+ default: [
84
+ 'signature',
85
+ 'call-signature',
86
+ ...eslintMembersGroup('field'),
87
+ 'static-initialization',
88
+ 'public-constructor',
89
+ 'protected-constructor',
90
+ 'private-constructor',
91
+ 'constructor',
92
+ ...eslintMembersGroup('get'),
93
+ ...eslintMembersGroup('set'),
94
+ ...eslintMembersGroup('method'),
95
+ ],
96
+ },
97
+ ],
98
+ '@typescript-eslint/naming-convention': [
99
+ 'error',
100
+ {
101
+ format: ['camelCase'],
102
+ leadingUnderscore: 'forbid',
103
+ selector: 'default',
104
+ trailingUnderscore: 'forbid',
105
+ },
106
+ {
107
+ format: null,
108
+ modifiers: ['requiresQuotes'],
109
+ selector: [
110
+ 'accessor',
111
+ 'classMethod',
112
+ 'classProperty',
113
+ 'enumMember',
114
+ 'objectLiteralMethod',
115
+ 'objectLiteralProperty',
116
+ 'typeMethod',
117
+ 'typeProperty',
118
+ ],
119
+ },
120
+ {
121
+ format: null,
122
+ modifiers: ['destructured', 'unused'],
123
+ selector: 'variable',
124
+ },
125
+ {
126
+ format: ['camelCase', 'UPPER_CASE'],
127
+ leadingUnderscore: 'forbid',
128
+ selector: 'variable',
129
+ trailingUnderscore: 'forbid',
130
+ },
131
+ {
132
+ format: ['camelCase', 'snake_case'],
133
+ leadingUnderscore: 'forbid',
134
+ selector: 'property',
135
+ trailingUnderscore: 'forbid',
136
+ },
137
+ {
138
+ format: ['camelCase'],
139
+ leadingUnderscore: 'allow',
140
+ selector: 'parameter',
141
+ trailingUnderscore: 'forbid',
142
+ },
143
+ {
144
+ format: ['PascalCase'],
145
+ leadingUnderscore: 'forbid',
146
+ selector: 'typeLike',
147
+ trailingUnderscore: 'forbid',
148
+ },
149
+ {
150
+ format: ['PascalCase', 'UPPER_CASE'],
151
+ leadingUnderscore: 'forbid',
152
+ selector: 'enum',
153
+ trailingUnderscore: 'forbid',
154
+ },
155
+ {
156
+ format: ['PascalCase', 'UPPER_CASE'],
157
+ leadingUnderscore: 'forbid',
158
+ selector: 'enumMember',
159
+ trailingUnderscore: 'forbid',
160
+ },
161
+ ],
162
+ '@typescript-eslint/no-base-to-string': 'off',
163
+ '@typescript-eslint/no-empty-function': [
164
+ 'error',
165
+ {
166
+ allow: [
167
+ 'constructors',
168
+ 'private-constructors',
169
+ 'protected-constructors',
170
+ 'decoratedFunctions',
171
+ 'overrideMethods',
172
+ 'setters',
173
+ ],
174
+ },
175
+ ],
176
+ '@typescript-eslint/no-empty-object-type': 'error',
177
+ '@typescript-eslint/no-explicit-any': 'error',
178
+ '@typescript-eslint/no-floating-promises': 'off',
179
+ '@typescript-eslint/no-magic-numbers': [
180
+ 'warn',
181
+ {
182
+ ignore: [-1, 0, 1],
183
+ ignoreArrayIndexes: true,
184
+ ignoreDefaultValues: true,
185
+ ignoreEnums: true,
186
+ ignoreNumericLiteralTypes: true,
187
+ ignoreReadonlyClassProperties: true,
188
+ },
189
+ ],
190
+ '@typescript-eslint/no-misused-promises': 'off',
191
+ '@typescript-eslint/no-unsafe-argument': 'off',
192
+ '@typescript-eslint/no-unsafe-assignment': 'off',
193
+ '@typescript-eslint/no-unsafe-call': 'off',
194
+ '@typescript-eslint/no-unsafe-function-type': 'error',
195
+ '@typescript-eslint/no-unsafe-member-access': 'off',
196
+ '@typescript-eslint/no-unsafe-return': 'off',
197
+ '@typescript-eslint/no-wrapper-object-types': 'error',
198
+ '@typescript-eslint/require-await': 'warn',
199
+ '@typescript-eslint/restrict-template-expressions': [
200
+ 'error',
201
+ {
202
+ allowAny: true,
203
+ allowBoolean: true,
204
+ allowNullish: true,
205
+ allowNumber: true,
206
+ },
207
+ ],
208
+ '@typescript-eslint/return-await': ['error', 'in-try-catch'],
209
+ 'import-x/default': 'error',
210
+ 'import-x/export': 'error',
211
+ 'import-x/extensions': 'off',
212
+ 'import-x/first': 'error',
213
+ 'import-x/named': 'error',
214
+ 'import-x/namespace': 'error',
215
+ 'import-x/newline-after-import': 'error',
216
+ 'import-x/no-cycle': 'error',
217
+ 'import-x/no-extraneous-dependencies': [
218
+ 'error',
219
+ {
220
+ devDependencies: true,
221
+ },
222
+ ],
223
+ 'import-x/no-unresolved': 'off',
224
+ 'import-x/order': 'off',
225
+ 'import-x/prefer-default-export': 'off',
226
+ 'max-classes-per-file': 'off',
227
+ 'perfectionist/sort-enums': [
228
+ 'error',
229
+ {
230
+ order: 'asc',
231
+ type: 'alphabetical',
232
+ },
233
+ ],
234
+ 'perfectionist/sort-imports': [
235
+ 'error',
236
+ {
237
+ customGroups: [
238
+ ...eslintImportSortCustomGroups('types', ['parent', 'sibling', 'index', 'internal'], '.*(interfaces?|types?|typings?).*'),
239
+ ...eslintImportSortCustomGroups('const', ['parent', 'sibling', 'index', 'internal'], '.*(constants?|config?).*'),
240
+ ],
241
+ groups: [
242
+ 'side-effect',
243
+ 'external',
244
+ 'internal',
245
+ ['parent', 'sibling', 'index'],
246
+ ['types-internal', 'types-parent', 'types-sibling', 'types-index'],
247
+ ['const-internal', 'const-parent', 'const-sibling', 'const-index'],
248
+ 'unknown',
249
+ ],
250
+ ignoreCase: true,
251
+ internalPattern: ['^@/', '^~/', '^src/'],
252
+ newlinesBetween: 1,
253
+ order: 'asc',
254
+ sortSideEffects: false,
255
+ type: 'alphabetical',
256
+ },
257
+ ],
258
+ 'perfectionist/sort-interfaces': [
259
+ 'error',
260
+ {
261
+ order: 'asc',
262
+ type: 'alphabetical',
263
+ },
264
+ ],
265
+ 'perfectionist/sort-object-types': [
266
+ 'error',
267
+ {
268
+ order: 'asc',
269
+ type: 'alphabetical',
270
+ },
271
+ ],
272
+ 'sort-imports': 'off',
273
+ },
274
+ settings: {
275
+ 'import/resolver': [
276
+ {
277
+ typescript: {
278
+ project: tsconfig || './tsconfig.json',
279
+ },
280
+ },
281
+ ],
282
+ },
283
+ },
284
+ ];
285
+ //# sourceMappingURL=node-ts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-ts.js","sourceRoot":"","sources":["../../src/eslint/node-ts.js"],"names":[],"mappings":";AAEA,MAAM,cAAc,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AACnE,MAAM,QAAQ,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AACtD,MAAM,aAAa,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACxD,MAAM,qBAAqB,GAAG,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eslint-disable max-lines-per-function */\n\nconst tsEslintPlugin = require('@typescript-eslint/eslint-plugin');\nconst tsParser = require('@typescript-eslint/parser');\nconst importXPlugin = require('eslint-plugin-import-x');\nconst tsPerfectionistPlugin = require('eslint-plugin-perfectionist');\nconst securityPlugin = require('eslint-plugin-security');\n\nconst nodeJsConfig = require('./node-js');\n\nfunction eslintMembersGroup(suffix) {\n return [\n `public-static-${suffix}`,\n `protected-static-${suffix}`,\n `private-static-${suffix}`,\n `#private-static-${suffix}`,\n\n `public-instance-${suffix}`,\n `protected-instance-${suffix}`,\n `private-instance-${suffix}`,\n `#private-instance-${suffix}`,\n\n `public-abstract-${suffix}`,\n `protected-abstract-${suffix}`,\n\n `public-${suffix}`,\n `protected-${suffix}`,\n `private-${suffix}`,\n `#private-${suffix}`,\n\n `static-${suffix}`,\n `instance-${suffix}`,\n `abstract-${suffix}`,\n\n suffix,\n ];\n}\n\nfunction eslintImportSortCustomGroups(prefix, selectors, pattern) {\n return selectors.map((selector) => ({\n elementNamePattern: pattern,\n groupName: `${prefix}-${selector}`,\n selector,\n }));\n}\n\nmodule.exports = ({ files, tsconfig } = {}) => [\n {\n files: files || ['**/*.ts'],\n languageOptions: {\n parser: tsParser,\n parserOptions: {\n ecmaFeatures: { modules: true },\n project: tsconfig || './tsconfig.json',\n sourceType: 'module',\n },\n },\n plugins: {\n '@typescript-eslint': tsEslintPlugin,\n 'import-x': importXPlugin,\n perfectionist: tsPerfectionistPlugin,\n security: securityPlugin,\n },\n rules: {\n ...tsEslintPlugin.configs.recommended.rules,\n ...tsEslintPlugin.configs['recommended-requiring-type-checking'].rules,\n\n // переопределения базовых правил плагинов\n '@typescript-eslint/await-thenable': 'warn',\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n },\n ],\n '@typescript-eslint/explicit-function-return-type': [\n 'error',\n {\n allowExpressions: true,\n },\n ],\n '@typescript-eslint/explicit-member-accessibility': [\n 'error',\n {\n accessibility: 'explicit',\n overrides: {\n constructors: 'no-public',\n },\n },\n ],\n '@typescript-eslint/explicit-module-boundary-types': 'error',\n '@typescript-eslint/member-ordering': [\n 'error',\n {\n default: [\n // Index signature\n 'signature',\n 'call-signature',\n\n // Fields\n ...eslintMembersGroup('field'),\n\n // Static initialization\n 'static-initialization',\n\n // Constructors\n 'public-constructor',\n 'protected-constructor',\n 'private-constructor',\n\n 'constructor',\n\n // Getters\n ...eslintMembersGroup('get'),\n\n // Setters\n ...eslintMembersGroup('set'),\n\n // Methods\n ...eslintMembersGroup('method'),\n ],\n },\n ],\n '@typescript-eslint/naming-convention': [\n 'error',\n {\n format: ['camelCase'],\n leadingUnderscore: 'forbid',\n selector: 'default',\n trailingUnderscore: 'forbid',\n },\n {\n format: null,\n modifiers: ['requiresQuotes'],\n selector: [\n 'accessor',\n 'classMethod',\n 'classProperty',\n 'enumMember',\n 'objectLiteralMethod',\n 'objectLiteralProperty',\n 'typeMethod',\n 'typeProperty',\n ],\n },\n {\n format: null,\n modifiers: ['destructured', 'unused'],\n selector: 'variable',\n },\n {\n format: ['camelCase', 'UPPER_CASE'],\n leadingUnderscore: 'forbid',\n selector: 'variable',\n trailingUnderscore: 'forbid',\n },\n {\n format: ['camelCase', 'snake_case'],\n leadingUnderscore: 'forbid',\n selector: 'property',\n trailingUnderscore: 'forbid',\n },\n {\n format: ['camelCase'],\n leadingUnderscore: 'allow',\n selector: 'parameter',\n trailingUnderscore: 'forbid',\n },\n {\n format: ['PascalCase'],\n leadingUnderscore: 'forbid',\n selector: 'typeLike',\n trailingUnderscore: 'forbid',\n },\n {\n format: ['PascalCase', 'UPPER_CASE'],\n leadingUnderscore: 'forbid',\n selector: 'enum',\n trailingUnderscore: 'forbid',\n },\n {\n format: ['PascalCase', 'UPPER_CASE'],\n leadingUnderscore: 'forbid',\n selector: 'enumMember',\n trailingUnderscore: 'forbid',\n },\n ],\n '@typescript-eslint/no-base-to-string': 'off',\n '@typescript-eslint/no-empty-function': [\n 'error',\n {\n allow: [\n 'constructors',\n 'private-constructors',\n 'protected-constructors',\n 'decoratedFunctions',\n 'overrideMethods',\n 'setters',\n ],\n },\n ],\n '@typescript-eslint/no-empty-object-type': 'error',\n '@typescript-eslint/no-explicit-any': 'error',\n '@typescript-eslint/no-floating-promises': 'off',\n '@typescript-eslint/no-magic-numbers': [\n 'warn',\n {\n ignore: [-1, 0, 1],\n ignoreArrayIndexes: true,\n ignoreDefaultValues: true,\n ignoreEnums: true,\n ignoreNumericLiteralTypes: true,\n ignoreReadonlyClassProperties: true,\n },\n ],\n '@typescript-eslint/no-misused-promises': 'off',\n '@typescript-eslint/no-unsafe-argument': 'off',\n '@typescript-eslint/no-unsafe-assignment': 'off',\n '@typescript-eslint/no-unsafe-call': 'off',\n '@typescript-eslint/no-unsafe-function-type': 'error',\n '@typescript-eslint/no-unsafe-member-access': 'off',\n '@typescript-eslint/no-unsafe-return': 'off',\n '@typescript-eslint/no-wrapper-object-types': 'error',\n '@typescript-eslint/require-await': 'warn',\n '@typescript-eslint/restrict-template-expressions': [\n 'error',\n {\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumber: true,\n },\n ],\n '@typescript-eslint/return-await': ['error', 'in-try-catch'],\n 'import-x/default': 'error',\n 'import-x/export': 'error',\n 'import-x/extensions': 'off',\n 'import-x/first': 'error',\n 'import-x/named': 'error',\n 'import-x/namespace': 'error',\n 'import-x/newline-after-import': 'error',\n 'import-x/no-cycle': 'error',\n 'import-x/no-extraneous-dependencies': [\n 'error',\n {\n devDependencies: true,\n },\n ],\n 'import-x/no-unresolved': 'off',\n 'import-x/order': 'off',\n 'import-x/prefer-default-export': 'off',\n 'max-classes-per-file': 'off',\n // Сортировка enum (по имени или значению)\n 'perfectionist/sort-enums': [\n 'error',\n {\n order: 'asc',\n type: 'alphabetical',\n },\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n customGroups: [\n ...eslintImportSortCustomGroups(\n 'types',\n ['parent', 'sibling', 'index', 'internal'],\n '.*(interfaces?|types?|typings?).*',\n ),\n ...eslintImportSortCustomGroups(\n 'const',\n ['parent', 'sibling', 'index', 'internal'],\n '.*(constants?|config?).*',\n ),\n ],\n groups: [\n 'side-effect',\n 'external',\n 'internal',\n ['parent', 'sibling', 'index'],\n ['types-internal', 'types-parent', 'types-sibling', 'types-index'],\n ['const-internal', 'const-parent', 'const-sibling', 'const-index'],\n 'unknown',\n ],\n ignoreCase: true,\n internalPattern: ['^@/', '^~/', '^src/'],\n newlinesBetween: 1,\n order: 'asc',\n sortSideEffects: false,\n type: 'alphabetical',\n },\n ],\n // Сортировка интерфейсов\n 'perfectionist/sort-interfaces': [\n 'error',\n {\n order: 'asc',\n type: 'alphabetical',\n },\n ],\n // Сортировка свойств в типах объектов\n 'perfectionist/sort-object-types': [\n 'error',\n {\n order: 'asc',\n type: 'alphabetical',\n },\n ],\n 'sort-imports': 'off',\n },\n settings: {\n 'import/resolver': [\n {\n typescript: {\n project: tsconfig || './tsconfig.json',\n },\n },\n ],\n },\n },\n];\n"]}
@@ -0,0 +1,9 @@
1
+ export let arrowParens: string;
2
+ export let jsxBracketSameLine: boolean;
3
+ export let printWidth: number;
4
+ export let semi: boolean;
5
+ export let singleQuote: boolean;
6
+ export let tabWidth: number;
7
+ export let trailingComma: string;
8
+ export let useTabs: boolean;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prettier/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ module.exports = {
3
+ arrowParens: 'always',
4
+ jsxBracketSameLine: false,
5
+ printWidth: 80,
6
+ semi: true,
7
+ singleQuote: true,
8
+ tabWidth: 2,
9
+ trailingComma: 'all',
10
+ useTabs: false,
11
+ };
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prettier/index.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,WAAW,EAAE,QAAQ;IACrB,kBAAkB,EAAE,KAAK;IACzB,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,IAAI;IACV,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,CAAC;IACX,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,KAAK;CACf,CAAC","sourcesContent":["module.exports = {\n arrowParens: 'always',\n jsxBracketSameLine: false,\n printWidth: 80,\n semi: true,\n singleQuote: true,\n tabWidth: 2,\n trailingComma: 'all',\n useTabs: false,\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function toLowerCase(str: string): string;
2
+ //# sourceMappingURL=toLowerCase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toLowerCase.d.ts","sourceRoot":"","sources":["../../src/sandbox/toLowerCase.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toLowerCase = toLowerCase;
4
+ function toLowerCase(str) {
5
+ return str.toLowerCase();
6
+ }
7
+ //# sourceMappingURL=toLowerCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toLowerCase.js","sourceRoot":"","sources":["../../src/sandbox/toLowerCase.ts"],"names":[],"mappings":";;AAAA,kCAEC;AAFD,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["export function toLowerCase(str: string): string {\n return str.toLowerCase();\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@zalib/dev",
3
+ "version": "5.9.0",
4
+ "description": "DevKIT package",
5
+ "license": "UNLICENSED",
6
+ "engines": {
7
+ "node": "^22.22.3",
8
+ "npm": "^10.9.8"
9
+ },
10
+ "files": [
11
+ "dist/**/*"
12
+ ],
13
+ "exports": {
14
+ "./eslint": {
15
+ "default": "./dist/eslint/index.js",
16
+ "types": "./dist/eslint/index.d.ts"
17
+ },
18
+ "./prettier": {
19
+ "default": "./dist/prettier/index.js",
20
+ "types": "./dist/prettier/index.d.ts"
21
+ }
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/wsp-repo/dev.git"
26
+ },
27
+ "scripts": {
28
+ "build": "npm run clean && tsc -p tsconfig.build.json",
29
+ "clean": "rimraf dist",
30
+ "format": "prettier --write 'src/**/*.{js,ts,json,md}'",
31
+ "lint": "eslint ./src --quiet",
32
+ "lint:fix": "eslint ./src --fix",
33
+ "prebuild": "rimraf dist",
34
+ "prepare": "npm run build",
35
+ "prepublishOnly": "npm run lint",
36
+ "release:major": "npm version major",
37
+ "release:minor": "npm version minor",
38
+ "release:patch": "npm version patch",
39
+ "test": "vitest run"
40
+ },
41
+ "dependencies": {
42
+ "@typescript-eslint/eslint-plugin": "8.59.4",
43
+ "@typescript-eslint/parser": "8.59.4",
44
+ "@typescript-eslint/utils": "8.59.4",
45
+ "@vitest/coverage-v8": "4.1.7",
46
+ "eslint": "9.39.4",
47
+ "eslint-config-prettier": "10.1.8",
48
+ "eslint-import-resolver-typescript": "4.4.4",
49
+ "eslint-plugin-import-x": "4.16.2",
50
+ "eslint-plugin-perfectionist": "5.9.0",
51
+ "eslint-plugin-security": "4.0.0",
52
+ "husky": "9.1.7",
53
+ "lint-staged": "17.0.5",
54
+ "prettier": "3.8.3",
55
+ "rimraf": "6.1.3",
56
+ "ts-node": "10.9.2",
57
+ "typescript": "5.9.3",
58
+ "vitest": "4.1.7"
59
+ },
60
+ "devDependencies": {
61
+ "@types/node": "25.9.1"
62
+ },
63
+ "overrides": {
64
+ "rimraf": "6.1.3"
65
+ },
66
+ "lint-staged": {
67
+ "package.json": "check-exact-package",
68
+ "*.{js,ts}": [
69
+ "eslint --quiet --max-warnings 0",
70
+ "eslint --quiet --fix",
71
+ "prettier --write"
72
+ ]
73
+ },
74
+ "husky": {
75
+ "hooks": {
76
+ "pre-commit": "lint-staged --allow-empty"
77
+ }
78
+ }
79
+ }