Skip to content

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

Merged
merged 18 commits into from
Aug 1, 2022
Merged

Update plugin source to TypeScript #71

merged 18 commits into from
Aug 1, 2022

Conversation

mskelton
Copy link
Member

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.

@mskelton mskelton marked this pull request as ready for review July 31, 2022 21:00
Copy link
Collaborator

@mxschmitt mxschmitt left a 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';
Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

@mskelton mskelton merged commit 73c4a1a into main Aug 1, 2022
@mskelton mskelton deleted the typescript branch August 1, 2022 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants