Skip to content

Commit

Permalink
test: fix jest config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 28, 2023
1 parent aedf806 commit 3b255c2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
"homepage": "https://jaywcjlove.github.io/rehype-video",
"sideEffects": false,
"type": "module",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"typings": "./lib/index.d.ts",
"exports": "./lib/index.js",
"author": "jaywcjlove",
"license": "MIT",
"scripts": {
"prepack": "npm run build",
"watch": "tsbb watch",
"build": "tsbb build && npm run fix",
"fix": "tsc-esm-fix --target='lib' --ext='.js'",
"build": "tsbb build",
"type-check": "tsc --noEmit",
"test": "tsbb test",
"coverage": "tsbb test --coverage --bail"
Expand All @@ -37,6 +36,10 @@
"unified"
],
"jest": {
"extensionsToTreatAsEsm": [".ts"],
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
"transformIgnorePatterns": [
"<rootDir>/node_modules/?!(.*)"
]
Expand All @@ -55,7 +58,6 @@
"remark-gfm": "~3.0.0",
"remark-parse": "~10.0.0",
"remark-rehype": "~10.1.0",
"tsc-esm-fix": "~2.20.0",
"tsbb": "^4.1.3"
"tsbb": "^4.2.3"
}
}
2 changes: 1 addition & 1 deletion src/detailsNode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Element } from 'hast';
import type { Element } from 'hast';

export function detailsNode(title?: string): Element {
return {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Plugin } from 'unified';
import { Root, Element } from 'hast';
import type { Plugin } from 'unified';
import type { Root, Element } from 'hast';
import { visit } from 'unist-util-visit';
import { detailsNode } from './detailsNode';
import { detailsNode } from './detailsNode.js';

export type RehypeVideoOptions = {
/**
Expand Down
12 changes: 6 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ES2020",
"moduleResolution": "node",
"target": "ES2022",
"module": "node16",
"moduleResolution": "node16",
"sourceMap": true,
"declaration": true,
"noFallthroughCasesInSwitch": true,
"noImplicitThis": true,
"skipLibCheck": true,
"strictBindCallApply": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"stripInternal": true,
"esModuleInterop": false,
"skipLibCheck": true,
"esModuleInterop": true,
"noImplicitAny": true,
"outDir": "lib",
"baseUrl": "."
},
"include": [
"src/**/*"
]
}
}

0 comments on commit 3b255c2

Please sign in to comment.