-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: migrate to mocha and eslint 9 #1266
Conversation
Migrates from Jest to mocha and node's own `assert` library. Also updates ESLint to 9.x and bumps TSESLint to do the same.
@@ -26,7 +26,7 @@ | |||
"parse5": "^7.0.0" | |||
}, | |||
"scripts": { | |||
"build:cjs": "tsc --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json" | |||
"build:cjs": "tsc --moduleResolution node10 --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typescript started to complain without this, since you must have module: "node16"
if you have module resolution set to it (which we do)
I guess it got updated in the lockfile while updating tseslint etc and introduced the new behaviour
Nice! Could we use Node's own test runner and skip having any dependencies? |
we could but I wasn't sure what node version matrix we wanted the node test runner is available in 16.x onwards if I remember correctly I'm also not sure off the top of my head how you get it to run typescript (via ts-node still presumably) |
maybe lets go with mocha for now and I can try the node runner in a separate PR? since I feel like it'll be a bit more work |
I’d love all this stuff, but separate PRs makes reviewing this easier! |
there's basically two changes (mocha and eslint). I could open two separate PRs but it gets a bit weird since I need to setup eslint to be happy with jest, knowing it'll go away immediately after it may turn out its as easy as if you're unhappy with it going ahead without me splitting it up though I can have a look |
Right, sure. There are ways around that, with things like I’m not going to block this. But in my experience splitting PRs up into different things helps. |
yes, I think we should go ahead with mocha first though anyway since the node test runner will be more work I'll see if I can split into two PRs it wouldn't be a TODO for removing a workaround for |
Migrates from Jest to mocha and node's own
assert
library.Also updates ESLint to 9.x and bumps TSESLint to do the same.
@fb55 what do you think of this? jest is pretty hefty for what we need, this trims a fair chunk of the dependency weight out. mocha, tinyspy and node
assert
seem pretty clean together to mesimilarly, I dropped most eslint customisation we had and just opted to rely on the recommended configs since prettier should pick up all the stylistic stuff we care about