@html-validate/jest-config 3.13.1 → 3.14.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/README.md CHANGED
@@ -31,11 +31,12 @@ In your `package.json` file:
31
31
 
32
32
  ### Presets
33
33
 
34
- | Preset | Description |
35
- | ------------------------------------------ | ------------------------- |
36
- | @html-validate/jest-config | Alias for presets/default |
37
- | @html-validate/jest-config/presets/default | Default preset |
38
- | @html-validate/jest-config/presets/esm | Experimental ESM support |
34
+ | Preset | Description |
35
+ | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
36
+ | @html-validate/jest-config | Alias for presets/default |
37
+ | @html-validate/jest-config/presets/default | Default preset |
38
+ | @html-validate/jest-config/presets/esm | Experimental ESM support |
39
+ | @html-validate/jest-config/presets/typestripping | Experimental native typestripping support, bypassing `ts-jest`. Note: requires nodejs v22.13 or later! |
39
40
 
40
41
  ### Transpiling ESM in `node_modules/`
41
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/jest-config",
3
- "version": "3.13.1",
3
+ "version": "3.14.0",
4
4
  "description": "Jest sharable preset used by the various HTML-validate packages",
5
5
  "keywords": [
6
6
  "jest"
@@ -0,0 +1,17 @@
1
+ const { commonConfig } = require("../../lib");
2
+
3
+ const preset = {
4
+ ...commonConfig,
5
+ transform: {
6
+ "\\.[jt]s$": require.resolve("./transform.mjs"),
7
+ },
8
+ transformIgnorePatterns: [],
9
+ extensionsToTreatAsEsm: [".ts"],
10
+ };
11
+
12
+ if (require.main === module) {
13
+ /* eslint-disable-next-line no-console */
14
+ console.log(JSON.stringify(preset, null, 2));
15
+ }
16
+
17
+ module.exports = preset;
@@ -0,0 +1,12 @@
1
+ import { stripTypeScriptTypes } from "node:module";
2
+
3
+ export default {
4
+ process(sourceText, sourcePath) {
5
+ const code = stripTypeScriptTypes(sourceText, {
6
+ mode: "transform",
7
+ sourceMap: true,
8
+ sourceUrl: sourcePath,
9
+ });
10
+ return { code };
11
+ },
12
+ };