Skip to content

Commit

Permalink
fix: Support ESM and CommonJS (#185)
Browse files Browse the repository at this point in the history
* ES module interop

* Move dist

* Fix types

* Fix types

* Fix test
  • Loading branch information
mskelton authored Dec 10, 2023
1 parent b54e7df commit 5bc9a33
Show file tree
Hide file tree
Showing 27 changed files with 632 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
lib/
dist/
examples/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules/
lib/
dist/
*.tgz
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
lib/
dist/
pnpm-lock.yaml
8 changes: 7 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.ts?$': ['ts-jest', { isolatedModules: true }],
'^.+\\.ts?$': [
'ts-jest',
{
isolatedModules: true,
tsconfig: { moduleResolution: 'classic' },
},
],
},
};
25 changes: 19 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,37 @@
"name": "eslint-plugin-playwright",
"description": "ESLint plugin for Playwright testing.",
"version": "0.0.0-semantically-released",
"packageManager": "[email protected]",
"main": "lib/index.js",
"repository": "https://github.com/playwright-community/eslint-plugin-playwright",
"author": "Mark Skelton <[email protected]>",
"packageManager": "[email protected]",
"contributors": [
"Max Schmitt <[email protected]>"
],
"license": "MIT",
"workspaces": [
"examples"
],
"types": "./dist/index.d.ts",
"exports": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"files": [
"lib",
"!lib/**/*.spec.js"
"dist"
],
"scripts": {
"build": "tsc --project tsconfig.build.json",
"build": "tsup src/index.ts --format cjs,esm --dts --out-dir dist",
"lint": "eslint .",
"format": "prettier --write .",
"format:check": "prettier --check .",
"test": "jest",
"ts": "tsc"
"ts": "tsc --noEmit"
},
"devDependencies": {
"@mskelton/eslint-config": "^8.4.0",
Expand All @@ -35,6 +47,7 @@
"prettier": "^3.0.3",
"semantic-release": "^22.0.5",
"ts-jest": "^29.1.1",
"tsup": "^8.0.1",
"typescript": "^5.2.2"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 5bc9a33

Please sign in to comment.