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.
- package/dist/practices/domain/best-practice/package.json +1 -1
- package/dist/practices/lint/best-practice/.eslintrc.js +2 -3
- package/dist/practices/tests/best-practice/.declapract.todo.md +3 -0
- package/dist/practices/tests/best-practice/babel.config.js +12 -0
- package/dist/practices/tests/best-practice/jest.acceptance.config.ts +5 -0
- package/dist/practices/tests/best-practice/jest.integration.config.ts +5 -0
- package/dist/practices/tests/best-practice/jest.unit.config.ts +5 -0
- package/dist/practices/tests/best-practice/package.json +4 -1
- package/package.json +1 -1
|
@@ -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': '
|
|
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': '
|
|
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
|
|
@@ -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.
|
|
5
|
+
"version": "0.39.18",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"repository": "ehmpathy/declapract-typescript-ehmpathy",
|