-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Update examples in docs to use ES Modules #2954
Conversation
I'm trying AVA for the first time and this appears to be the case as of 4.0.
Either work, it depends on whether you're using I do lean towards the ESM syntax, but then I wonder if that'll trip people up who have a default setup of CommonJS. @sindresorhus what do you think? |
I would use ESM syntax. |
@scottdotjs would you be up for converting all the docs? I'd understand if not — but it'd be good to keep the syntax consistent so I'd rather do it all in one go. |
Sure! This PR only covered the first example as that was as far as I'd for at the time. 🙂 |
OK, I've changed the examples to use ES Modules as far as was obvious to me - in the case of other packages, I checked that it worked for them by consulting their issues if it wasn't shown in their documentation, and/or tried it myself. There were several instances I didn't change, however:
JSON imports aren't quite there yet (as I'm sure you know) so it's your call on how to replace this if you want to. There's another JSON file being required in testing-with-selenium-webdriverjs.md
I've never used
I have no Vue experience either so couldn't update this section; also the Vue basic examples don't show Vue being used this way but rather all as |
This one's fine, it's an example with a CJS file after all.
I'll push a commit to replace that with a read-file-sync.
Just
Yea I don't know — but |
Thanks @scottdotjs! |
Ohhh 😂 Well when you put it like that...
You're welcome! |
I'm trying AVA for the first time and this appears to be the case as of 4.0.