Skip to content
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

"Danger" bot doesn't need to ask for strict mode for ES Modules #2708

Closed
quantizor opened this issue Jan 26, 2017 · 3 comments · Fixed by #2709
Closed

"Danger" bot doesn't need to ask for strict mode for ES Modules #2708

quantizor opened this issue Jan 26, 2017 · 3 comments · Fixed by #2709

Comments

@quantizor
Copy link
Contributor

The relevant code in dangerfile:

// Ensure the use of 'use strict'; on all files
const noStrictFiles = newJsFiles.filter(filepath => {
  const content = fs.readFileSync(filepath).toString();
  return !includes(content, 'use strict');
});

Basically ES modules are strict mode by default, so the check should look for use of "import"/"export" to determine if flagging is required.

@orta
Copy link
Member

orta commented Jan 26, 2017

Are there any ES modules inside Jest? I thought it was all require etc?

@quantizor
Copy link
Contributor Author

I'm adding some :) #2704

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants