Skip to content

Conversation

js07
Copy link
Contributor

@js07 js07 commented Nov 5, 2021

  • Updates the logic of determining if a node is "default export"
  • Changes rule checks from running on Program AST nodes to on ExportDefaultDeclaration nodes
  • Adds test cases to rules.test.js for ESM components with statements before export default declaration
  • Refactors rules.test.js

Fixes #5

js07 added 3 commits November 4, 2021 20:33
Run rule checks on nodes of type `ExportDefaultDeclaration` instead of
`Program`
@dylburger
Copy link
Contributor

@js07 nice!

Could you also help with two related things:

  • Could you add a test case with the case that failed (lines above the export default declaration)
  • Could you add a GitHub action to run jest on PRs? I've wanted to do that but haven't had the time.

Copy link
Contributor

@dylburger dylburger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great and tests are running locally for me!

@js07
Copy link
Contributor Author

js07 commented Nov 8, 2021

😃

For reference, I added test cases for ESM components whose export default declaration was not the first statement in a file, addressing part of this comment.

I think this PR is ready to be merged barring other suggested changes.

@dylburger
Copy link
Contributor

Yes feel free to merge and update the pipedream repo to incorporate the new version.

@dylburger dylburger merged commit eefc907 into PipedreamHQ:master Nov 8, 2021
@dylburger
Copy link
Contributor

Forgot you didn't have write permissions here, so I merged this one and invited you to the repo. I'll also publish the most recent version to npm (another thing we need to automate!)

Let me know if you can merge the GH Actions PR, or if that doesn't work.

@js07
Copy link
Contributor Author

js07 commented Nov 8, 2021

Merging the GH Actions PR worked for me.

@js07 js07 deleted the fix-missing-some-esmodules branch November 8, 2021 23:18
js07 added a commit to js07/pipedream that referenced this pull request Nov 8, 2021
New version adds bug fix for missing ESLint validation on some ESM
components
See PipedreamHQ/eslint-plugin-pipedream#6
js07 added a commit to js07/pipedream that referenced this pull request Nov 8, 2021
New version adds bug fix for missing ESLint validation on some ESM
components
See PipedreamHQ/eslint-plugin-pipedream#6
dylburger pushed a commit to PipedreamHQ/pipedream that referenced this pull request Nov 8, 2021
New version adds bug fix for missing ESLint validation on some ESM
components
See PipedreamHQ/eslint-plugin-pipedream#6
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.

[BUG] Lint rules missing some ESM components

2 participants