declapract-typescript-ehmpathy 0.39.16 → 0.39.18

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "domain-objects": "@declapract{check.minVersion('0.22.1')}",
3
+ "domain-objects": "@declapract{check.minVersion('0.25.7')}",
4
4
  "joi": "@declapract{check.minVersion('17.4.0')}",
5
5
  "type-fns": "@declapract{check.minVersion('1.17.0')}"
6
6
  }
@@ -17,7 +17,7 @@ module.exports = {
17
17
  'sort-imports': 'off',
18
18
  'import/prefer-default-export': 'off', // default export = bad
19
19
  'import/no-default-export': 'error', // require named exports - they make it easier to refactor, enforce consistency, and increase constraints
20
- '@typescript-eslint/no-non-null-assertion': 'off', // we use these to help typescript out when we know something it doesnt, and cant easily express that
20
+ '@typescript-eslint/no-non-null-assertion': 'error', // forbid non-null assertion operators for safer code; you can always `?? UnexpectedCodePathError.throw(...)` to fail fast instead
21
21
  'import/no-extraneous-dependencies': [
22
22
  'error',
23
23
  {
@@ -30,14 +30,13 @@ module.exports = {
30
30
  ],
31
31
  },
32
32
  ],
33
- '@typescript-eslint/no-explicit-any': 'off', // sometimes this is a valid definition
33
+ '@typescript-eslint/no-explicit-any': 'error', // forbid any type for better type safety; you can use `never` or `unknown` instead when its truly unknown or never needed to be known
34
34
  '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
35
35
  'import/no-cycle': 'off',
36
36
  'max-classes-per-file': 'off',
37
37
  '@typescript-eslint/no-use-before-define': 'off',
38
38
  '@typescript-eslint/no-floating-promises': 'error',
39
39
  'prefer-destructuring': 'off',
40
- '@typescript-eslint/no-non-null-assertion': 'off',
41
40
  'lines-between-class-members': 'off',
42
41
  '@typescript-eslint/lines-between-class-members': 'off',
43
42
  'no-return-await': 'off', // this does not help anything and actually leads to bugs if we subsequently wrap the return in a try catch without remembering to _then_ add await
@@ -0,0 +1,3 @@
1
+ cutover to vitest
2
+
3
+ its faster and has native esm + ts support
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ presets: [
3
+ [
4
+ '@babel/preset-env',
5
+ {
6
+ targets: {
7
+ node: 'current',
8
+ },
9
+ },
10
+ ],
11
+ ],
12
+ };
@@ -13,7 +13,12 @@ const config: Config = {
13
13
  moduleFileExtensions: ['js', 'ts'],
14
14
  transform: {
15
15
  '^.+\\.tsx?$': 'ts-jest', // https://kulshekhar.github.io/ts-jest/docs/getting-started/presets
16
+ '^.+\\.(js|jsx|mjs)$': 'babel-jest', // transform esm modules with babel
16
17
  },
18
+ transformIgnorePatterns: [
19
+ // here's an example of how to ignore esm module transformation, when needed
20
+ // 'node_modules/(?!(@octokit|universal-user-agent|before-after-hook)/)',
21
+ ],
17
22
  testMatch: ['**/*.acceptance.test.ts'],
18
23
  setupFiles: ['core-js'],
19
24
  setupFilesAfterEnv: ['./jest.acceptance.env.ts'],
@@ -13,7 +13,12 @@ const config: Config = {
13
13
  moduleFileExtensions: ['js', 'ts'],
14
14
  transform: {
15
15
  '^.+\\.tsx?$': 'ts-jest', // https://kulshekhar.github.io/ts-jest/docs/getting-started/presets
16
+ '^.+\\.(js|jsx|mjs)$': 'babel-jest', // transform esm modules with babel
16
17
  },
18
+ transformIgnorePatterns: [
19
+ // here's an example of how to ignore esm module transformation, when needed
20
+ // 'node_modules/(?!(@octokit|universal-user-agent|before-after-hook)/)',
21
+ ],
17
22
  testMatch: ['**/*.integration.test.ts'],
18
23
  setupFiles: ['core-js'],
19
24
  setupFilesAfterEnv: ['./jest.integration.env.ts'],
@@ -13,7 +13,12 @@ const config: Config = {
13
13
  moduleFileExtensions: ['js', 'ts'],
14
14
  transform: {
15
15
  '^.+\\.tsx?$': 'ts-jest', // https://kulshekhar.github.io/ts-jest/docs/getting-started/presets
16
+ '^.+\\.(js|jsx|mjs)$': 'babel-jest', // transform esm modules with babel
16
17
  },
18
+ transformIgnorePatterns: [
19
+ // here's an example of how to ignore esm module transformation, when needed
20
+ // 'node_modules/(?!(@octokit|universal-user-agent|before-after-hook)/)',
21
+ ],
17
22
  testMatch: [
18
23
  // note: order matters
19
24
  '**/*.test.ts',
@@ -5,7 +5,10 @@
5
5
  "test-fns": "@declapract{check.minVersion('1.4.2')}",
6
6
  "ts-jest": "@declapract{check.minVersion('29.1.3')}",
7
7
  "ts-node": "@declapract{check.minVersion('10.9.2')}",
8
- "core-js": "@declapract{check.minVersion('3.26.1')}"
8
+ "core-js": "@declapract{check.minVersion('3.26.1')}",
9
+ "@babel/core": "@declapract{check.minVersion('7.28.5')}",
10
+ "@babel/preset-env": "@declapract{check.minVersion('7.28.5')}",
11
+ "babel-jest": "@declapract{check.minVersion('30.2.0')}"
9
12
  },
10
13
  "scripts": {
11
14
  "test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "declapract-typescript-ehmpathy",
3
3
  "author": "ehmpathy",
4
4
  "description": "declapract best practices declarations for typescript",
5
- "version": "0.39.16",
5
+ "version": "0.39.18",
6
6
  "license": "MIT",
7
7
  "main": "src/index.js",
8
8
  "repository": "ehmpathy/declapract-typescript-ehmpathy",