@sklv-labs/dev-configs 0.1.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.
- package/CHANGELOG.md +31 -0
- package/LICENSE +21 -0
- package/README.md +58 -0
- package/configs/git/commitlint.js +28 -0
- package/configs/git/lint-staged.js +4 -0
- package/package.json +71 -0
- package/presets/base/eslint.config.mjs +97 -0
- package/presets/base/jest.config.js +28 -0
- package/presets/base/prettier.js +12 -0
- package/presets/base/tsconfig.json +28 -0
- package/presets/base/tsconfig.spec.json +10 -0
- package/presets/nestjs/eslint.config.mjs +102 -0
- package/presets/nestjs/jest.config.js +33 -0
- package/presets/nestjs/tsconfig.json +26 -0
- package/presets/nestjs/tsconfig.spec.json +10 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## Unreleased
|
|
9
|
+
|
|
10
|
+
First release from the [sklv-labs/ts](https://github.com/sklv-labs/ts) monorepo, replacing the
|
|
11
|
+
standalone `@sklv-labs/ts-dev-configs` package.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `base` and `nestjs` presets for TypeScript, ESLint, Jest and Prettier.
|
|
16
|
+
- `presets/base/tsconfig.spec.json`, so non-NestJS packages no longer borrow the NestJS one.
|
|
17
|
+
- ESLint plugins are now declared as real `dependencies`, so the presets resolve under pnpm's
|
|
18
|
+
strict `node_modules` layout without hoisting workarounds.
|
|
19
|
+
|
|
20
|
+
### Removed
|
|
21
|
+
|
|
22
|
+
- `src/index.ts` and the `presets/*/index.js` shims, which restated every path already declared
|
|
23
|
+
in `exports`. Reference the subpath exports directly.
|
|
24
|
+
- The unused `react` preset and the vite / vitest / webpack / vscode configs.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Presets no longer set `tsconfigRootDir` to their own location inside `node_modules`, which broke
|
|
29
|
+
type-checked linting for consumers.
|
|
30
|
+
- Dropped rules for uninstalled plugins (`@darraghor/nestjs-typed/*`) and for
|
|
31
|
+
`@typescript-eslint/interface-name-prefix`, which no longer exists.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sklv-labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @sklv-labs/dev-configs
|
|
2
|
+
|
|
3
|
+
Shared TypeScript, ESLint, Prettier and Jest presets for sklv-labs projects.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add -D @sklv-labs/dev-configs eslint prettier typescript
|
|
9
|
+
# add jest + ts-jest too if you use the jest presets
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Presets
|
|
13
|
+
|
|
14
|
+
Two flavours: `base` for plain TypeScript, `nestjs` for NestJS packages (adds decorator metadata,
|
|
15
|
+
`prettier/prettier` as an error, and coverage thresholds).
|
|
16
|
+
|
|
17
|
+
`tsconfig.json`
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"extends": "@sklv-labs/dev-configs/presets/base/tsconfig.json",
|
|
22
|
+
"compilerOptions": { "outDir": "./dist", "rootDir": "./src" },
|
|
23
|
+
"include": ["src/**/*"]
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`eslint.config.mjs`
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import baseEslint from '@sklv-labs/dev-configs/eslint/base';
|
|
31
|
+
import { defineConfig } from 'eslint/config';
|
|
32
|
+
|
|
33
|
+
export default defineConfig([...baseEslint]);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`jest.config.js` · `.prettierrc.js` · `commitlint.config.js` · `.lintstagedrc.js`
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
module.exports = require('@sklv-labs/dev-configs/presets/base/jest.config.js');
|
|
40
|
+
module.exports = require('@sklv-labs/dev-configs/presets/base/prettier.js');
|
|
41
|
+
module.exports = require('@sklv-labs/dev-configs/configs/git/commitlint.js');
|
|
42
|
+
module.exports = require('@sklv-labs/dev-configs/configs/git/lint-staged.js');
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Swap `base` for `nestjs` where a NestJS variant exists. The full list of importable paths is the
|
|
46
|
+
`exports` map in `package.json`.
|
|
47
|
+
|
|
48
|
+
## Notes
|
|
49
|
+
|
|
50
|
+
The presets set `projectService: true` but deliberately do **not** set `tsconfigRootDir` — ESLint
|
|
51
|
+
resolves it from the directory it runs in, which is what you want in a workspace.
|
|
52
|
+
|
|
53
|
+
`eslint`, `prettier`, `typescript`, `jest` and `ts-jest` are peer dependencies; the ESLint plugins
|
|
54
|
+
the presets import are ordinary dependencies, so they resolve under pnpm without hoisting.
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
MIT
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['@commitlint/config-conventional'],
|
|
3
|
+
rules: {
|
|
4
|
+
'type-enum': [
|
|
5
|
+
2,
|
|
6
|
+
'always',
|
|
7
|
+
[
|
|
8
|
+
'feat',
|
|
9
|
+
'fix',
|
|
10
|
+
'docs',
|
|
11
|
+
'style',
|
|
12
|
+
'refactor',
|
|
13
|
+
'perf',
|
|
14
|
+
'test',
|
|
15
|
+
'chore',
|
|
16
|
+
'revert',
|
|
17
|
+
'build',
|
|
18
|
+
'ci',
|
|
19
|
+
],
|
|
20
|
+
],
|
|
21
|
+
'type-case': [2, 'always', 'lower-case'],
|
|
22
|
+
'type-empty': [2, 'never'],
|
|
23
|
+
'scope-case': [2, 'always', 'lower-case'],
|
|
24
|
+
'subject-empty': [2, 'never'],
|
|
25
|
+
'subject-full-stop': [2, 'never', '.'],
|
|
26
|
+
'header-max-length': [2, 'always', 100],
|
|
27
|
+
},
|
|
28
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sklv-labs/dev-configs",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared TypeScript, ESLint, Prettier and Jest presets for sklv-labs projects",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"typescript",
|
|
7
|
+
"eslint",
|
|
8
|
+
"prettier",
|
|
9
|
+
"jest",
|
|
10
|
+
"config",
|
|
11
|
+
"preset",
|
|
12
|
+
"nestjs"
|
|
13
|
+
],
|
|
14
|
+
"author": "sklv-labs",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/sklv-labs/ts.git",
|
|
19
|
+
"directory": "packages/dev-configs"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public",
|
|
23
|
+
"provenance": true
|
|
24
|
+
},
|
|
25
|
+
"exports": {
|
|
26
|
+
"./presets/base/tsconfig.json": "./presets/base/tsconfig.json",
|
|
27
|
+
"./presets/base/tsconfig.spec.json": "./presets/base/tsconfig.spec.json",
|
|
28
|
+
"./presets/base/prettier.js": "./presets/base/prettier.js",
|
|
29
|
+
"./presets/base/jest.config.js": "./presets/base/jest.config.js",
|
|
30
|
+
"./presets/nestjs/tsconfig.json": "./presets/nestjs/tsconfig.json",
|
|
31
|
+
"./presets/nestjs/tsconfig.spec.json": "./presets/nestjs/tsconfig.spec.json",
|
|
32
|
+
"./presets/nestjs/jest.config.js": "./presets/nestjs/jest.config.js",
|
|
33
|
+
"./eslint/base": "./presets/base/eslint.config.mjs",
|
|
34
|
+
"./eslint/nestjs": "./presets/nestjs/eslint.config.mjs",
|
|
35
|
+
"./configs/git/commitlint.js": "./configs/git/commitlint.js",
|
|
36
|
+
"./configs/git/lint-staged.js": "./configs/git/lint-staged.js"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"presets",
|
|
40
|
+
"configs",
|
|
41
|
+
"README.md",
|
|
42
|
+
"CHANGELOG.md",
|
|
43
|
+
"LICENSE"
|
|
44
|
+
],
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@eslint/js": "^10.0.1",
|
|
47
|
+
"eslint-config-prettier": "^10.1.8",
|
|
48
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
49
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
50
|
+
"globals": "^17.12.0",
|
|
51
|
+
"typescript-eslint": "^8.69.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"eslint": "^9.0.0 || ^10.0.0",
|
|
55
|
+
"jest": "^30.0.0",
|
|
56
|
+
"prettier": "^3.6.0",
|
|
57
|
+
"ts-jest": "^29.0.0",
|
|
58
|
+
"typescript": "^5.9.0 || ^6.0.0"
|
|
59
|
+
},
|
|
60
|
+
"peerDependenciesMeta": {
|
|
61
|
+
"jest": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"ts-jest": {
|
|
65
|
+
"optional": true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=24.0.0"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import { defineConfig } from 'eslint/config';
|
|
3
|
+
import tseslint from 'typescript-eslint';
|
|
4
|
+
import importPlugin from 'eslint-plugin-import-x';
|
|
5
|
+
import globals from 'globals';
|
|
6
|
+
import prettier from 'eslint-config-prettier';
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
// Base recommended configs
|
|
10
|
+
eslint.configs.recommended,
|
|
11
|
+
...tseslint.configs.recommended,
|
|
12
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
13
|
+
|
|
14
|
+
// Global ignores
|
|
15
|
+
{
|
|
16
|
+
ignores: [
|
|
17
|
+
'dist/**',
|
|
18
|
+
'build/**',
|
|
19
|
+
'node_modules/**',
|
|
20
|
+
'coverage/**',
|
|
21
|
+
'*.config.js',
|
|
22
|
+
'*.config.ts',
|
|
23
|
+
'*.config.mjs',
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
// TypeScript files configuration
|
|
28
|
+
{
|
|
29
|
+
files: ['**/*.{ts,tsx}'],
|
|
30
|
+
languageOptions: {
|
|
31
|
+
ecmaVersion: 2024,
|
|
32
|
+
sourceType: 'module',
|
|
33
|
+
globals: {
|
|
34
|
+
...globals.node,
|
|
35
|
+
...globals.es2024,
|
|
36
|
+
},
|
|
37
|
+
parser: tseslint.parser,
|
|
38
|
+
parserOptions: {
|
|
39
|
+
projectService: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
plugins: {
|
|
43
|
+
'@typescript-eslint': tseslint.plugin,
|
|
44
|
+
'import-x': importPlugin,
|
|
45
|
+
},
|
|
46
|
+
rules: {
|
|
47
|
+
// TypeScript specific rules
|
|
48
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
49
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
50
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
51
|
+
'@typescript-eslint/no-unused-vars': [
|
|
52
|
+
'error',
|
|
53
|
+
{
|
|
54
|
+
argsIgnorePattern: '^_',
|
|
55
|
+
varsIgnorePattern: '^_',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
59
|
+
|
|
60
|
+
// General best practices
|
|
61
|
+
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
62
|
+
'no-debugger': 'error',
|
|
63
|
+
'no-duplicate-imports': 'error',
|
|
64
|
+
'no-unused-expressions': 'error',
|
|
65
|
+
'prefer-const': 'error',
|
|
66
|
+
'prefer-arrow-callback': 'error',
|
|
67
|
+
'prefer-template': 'error',
|
|
68
|
+
|
|
69
|
+
// Import order rules
|
|
70
|
+
'import-x/order': [
|
|
71
|
+
'error',
|
|
72
|
+
{
|
|
73
|
+
groups: [
|
|
74
|
+
'builtin',
|
|
75
|
+
'external',
|
|
76
|
+
'internal',
|
|
77
|
+
'parent',
|
|
78
|
+
'sibling',
|
|
79
|
+
'index',
|
|
80
|
+
'object',
|
|
81
|
+
'type',
|
|
82
|
+
],
|
|
83
|
+
'newlines-between': 'always',
|
|
84
|
+
alphabetize: {
|
|
85
|
+
order: 'asc',
|
|
86
|
+
caseInsensitive: true,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
'import-x/no-duplicates': 'error',
|
|
91
|
+
'import-x/no-unresolved': 'off', // TypeScript handles this
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
// Prettier config (must be last to override formatting rules)
|
|
96
|
+
prettier,
|
|
97
|
+
]);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
preset: 'ts-jest',
|
|
3
|
+
testEnvironment: 'node',
|
|
4
|
+
roots: ['<rootDir>/src', '<rootDir>/test'],
|
|
5
|
+
testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
|
|
6
|
+
transform: {
|
|
7
|
+
'^.+\\.ts$': [
|
|
8
|
+
'ts-jest',
|
|
9
|
+
{
|
|
10
|
+
tsconfig: {
|
|
11
|
+
compilerOptions: {
|
|
12
|
+
module: 'nodenext',
|
|
13
|
+
target: 'ES2024',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts', '!src/**/*.test.ts', '!src/**/*.spec.ts'],
|
|
20
|
+
coverageDirectory: 'coverage',
|
|
21
|
+
coverageReporters: ['text', 'lcov', 'html', 'json'],
|
|
22
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
|
|
23
|
+
verbose: true,
|
|
24
|
+
clearMocks: true,
|
|
25
|
+
resetMocks: true,
|
|
26
|
+
restoreMocks: true,
|
|
27
|
+
testTimeout: 10000,
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ES2024",
|
|
5
|
+
"module": "nodenext",
|
|
6
|
+
"lib": ["ES2024"],
|
|
7
|
+
"moduleResolution": "nodenext",
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"checkJs": false,
|
|
11
|
+
"outDir": "./dist",
|
|
12
|
+
"rootDir": "./",
|
|
13
|
+
"strict": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"declarationMap": true,
|
|
19
|
+
"sourceMap": true,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"noImplicitReturns": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
|
24
|
+
"isolatedModules": true,
|
|
25
|
+
"allowSyntheticDefaultImports": true,
|
|
26
|
+
"types": ["node"]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import { defineConfig } from 'eslint/config';
|
|
3
|
+
import tseslint from 'typescript-eslint';
|
|
4
|
+
import importPlugin from 'eslint-plugin-import-x';
|
|
5
|
+
import globals from 'globals';
|
|
6
|
+
import prettier from 'eslint-config-prettier';
|
|
7
|
+
import prettierPlugin from 'eslint-plugin-prettier';
|
|
8
|
+
|
|
9
|
+
export default defineConfig([
|
|
10
|
+
// Base recommended configs
|
|
11
|
+
eslint.configs.recommended,
|
|
12
|
+
...tseslint.configs.recommended,
|
|
13
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
14
|
+
|
|
15
|
+
// Global ignores
|
|
16
|
+
{
|
|
17
|
+
ignores: [
|
|
18
|
+
'dist/**',
|
|
19
|
+
'build/**',
|
|
20
|
+
'node_modules/**',
|
|
21
|
+
'coverage/**',
|
|
22
|
+
'*.config.js',
|
|
23
|
+
'*.config.ts',
|
|
24
|
+
'*.config.mjs',
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
// TypeScript files configuration
|
|
29
|
+
{
|
|
30
|
+
files: ['**/*.ts'],
|
|
31
|
+
languageOptions: {
|
|
32
|
+
ecmaVersion: 2024,
|
|
33
|
+
sourceType: 'module',
|
|
34
|
+
globals: {
|
|
35
|
+
...globals.node,
|
|
36
|
+
...globals.es2024,
|
|
37
|
+
},
|
|
38
|
+
parser: tseslint.parser,
|
|
39
|
+
parserOptions: {
|
|
40
|
+
projectService: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
plugins: {
|
|
44
|
+
'@typescript-eslint': tseslint.plugin,
|
|
45
|
+
'import-x': importPlugin,
|
|
46
|
+
prettier: prettierPlugin,
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
// TypeScript specific rules
|
|
50
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
51
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
52
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
53
|
+
'@typescript-eslint/no-unused-vars': [
|
|
54
|
+
'error',
|
|
55
|
+
{
|
|
56
|
+
argsIgnorePattern: '^_',
|
|
57
|
+
varsIgnorePattern: '^_',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
61
|
+
|
|
62
|
+
// General best practices
|
|
63
|
+
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
64
|
+
'no-debugger': 'error',
|
|
65
|
+
'no-duplicate-imports': 'error',
|
|
66
|
+
'no-unused-expressions': 'error',
|
|
67
|
+
'prefer-const': 'error',
|
|
68
|
+
'prefer-arrow-callback': 'error',
|
|
69
|
+
'prefer-template': 'error',
|
|
70
|
+
|
|
71
|
+
// Import order rules
|
|
72
|
+
'import-x/order': [
|
|
73
|
+
'error',
|
|
74
|
+
{
|
|
75
|
+
groups: [
|
|
76
|
+
'builtin',
|
|
77
|
+
'external',
|
|
78
|
+
'internal',
|
|
79
|
+
'parent',
|
|
80
|
+
'sibling',
|
|
81
|
+
'index',
|
|
82
|
+
'object',
|
|
83
|
+
'type',
|
|
84
|
+
],
|
|
85
|
+
'newlines-between': 'always',
|
|
86
|
+
alphabetize: {
|
|
87
|
+
order: 'asc',
|
|
88
|
+
caseInsensitive: true,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
'import-x/no-duplicates': 'error',
|
|
93
|
+
'import-x/no-unresolved': 'off', // TypeScript handles this
|
|
94
|
+
|
|
95
|
+
// Prettier rules
|
|
96
|
+
'prettier/prettier': 'error',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
// Prettier config (must be last to override formatting rules)
|
|
101
|
+
prettier,
|
|
102
|
+
]);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const baseJest = require('../base/jest.config.js');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
...baseJest,
|
|
5
|
+
roots: ['<rootDir>/src'],
|
|
6
|
+
moduleNameMapper: {
|
|
7
|
+
'^src/(.*)$': '<rootDir>/src/$1',
|
|
8
|
+
},
|
|
9
|
+
testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
|
|
10
|
+
transform: {
|
|
11
|
+
'^.+\\.ts$': [
|
|
12
|
+
'ts-jest',
|
|
13
|
+
{
|
|
14
|
+
tsconfig: 'tsconfig.spec.json',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
collectCoverageFrom: [
|
|
19
|
+
'src/**/*.ts',
|
|
20
|
+
'!src/**/*.d.ts',
|
|
21
|
+
'!src/**/*.spec.ts',
|
|
22
|
+
'!src/**/*.interface.ts',
|
|
23
|
+
'!src/main.ts',
|
|
24
|
+
],
|
|
25
|
+
coverageThreshold: {
|
|
26
|
+
global: {
|
|
27
|
+
branches: 80,
|
|
28
|
+
functions: 80,
|
|
29
|
+
lines: 80,
|
|
30
|
+
statements: 80,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "../base/tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"module": "NodeNext",
|
|
6
|
+
"moduleResolution": "NodeNext",
|
|
7
|
+
"target": "ES2024",
|
|
8
|
+
"lib": ["ES2024"],
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"removeComments": true,
|
|
11
|
+
"emitDecoratorMetadata": true,
|
|
12
|
+
"experimentalDecorators": true,
|
|
13
|
+
"allowSyntheticDefaultImports": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"strictNullChecks": true,
|
|
18
|
+
"strictPropertyInitialization": false,
|
|
19
|
+
"noImplicitAny": true,
|
|
20
|
+
"strictBindCallApply": true,
|
|
21
|
+
"forceConsistentCasingInFileNames": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true,
|
|
23
|
+
"types": ["node", "jest"]
|
|
24
|
+
},
|
|
25
|
+
"files": []
|
|
26
|
+
}
|