-
Notifications
You must be signed in to change notification settings - Fork 42
Update plugin source to TypeScript #71
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
Conversation
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.
should we migrate the tests to @playwright/test
at some point?
@@ -1,14 +1,12 @@ | |||
const { runRuleTester, wrapInTest } = require('../lib/utils/rule-tester'); | |||
const rule = require('../lib/rules/no-page-pause'); | |||
import { runRuleTester, wrapInTest } from '../../utils/rule-tester'; |
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.
not a strong opinion on it, but I think it would be nice to have tests inside /tests
and actual impl source inside /src
like we had before. At least thats what we do in Playwright usually.
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.
The reason I moved away from that was because it introduces more complexity with building the output files since multiple root directories result in a non-flat structure so it would end up like lib/src/index.js
as the output path. This can be solved by adding a separate tsconfig file for building so that you can type check src and tests but when building outputs it will ignore the test folder. Having __tests__
inside src
makes it a little easier since a simple glob in the files
array will ignore the spec files.
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.
Okay, so after I thought more about it, I decided to move it back 😄. It will make it more organized for when we do the migration to @playwright/test
.
This updates the plugin source to use TypeScript. There are a lot of new rules coming soon and writing in TypeScript will improve the developer experience of writing those rules.