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

Enable the import/no-commonjs ESLint plugin rule #17117

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

Given the amount of work put into removing require-calls from the code-base, let's ensure that new ones aren't accidentally added in the future.

Note that we still have a couple of files where require is being used, in particular:

  • The Node.js examples, however those will be updated to use import in PR Update the examples/-folder to account for outputting of JavaScript modules (PR 17055 follow-up) #17081.
  • The Webpack examples, and related support files, however I unfortunately don't know enough about Webpack to be able to update those. (Hopefully users of that code will help out here, once version 4 is released.)
  • The statcmp-tool, since some of those require-calls cannot be converted to import without other code changes (and that file is only used during benchmarking).

Please find additional details at https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md

Given the amount of work put into removing `require`-calls from the code-base, let's ensure that new ones aren't accidentally added in the future.

Note that we still have a couple of files where `require` is being used, in particular:
 - The Node.js examples, however those will be updated to use `import` in PR 17081.
 - The Webpack examples, and related support files, however I unfortunately don't know enough about Webpack to be able to update those. (Hopefully users of that code will help out here, once version `4` is released.)
 - The `statcmp`-tool, since *some* of those `require`-calls cannot be converted to `import` without other code changes (and that file is only used during benchmarking).

Please find additional details at https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md
@Snuffleupagus
Copy link
Collaborator Author

/botio lint

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_lint from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/26b1e3e70f93b24/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_lint from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/c0c61994162eb49/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/c0c61994162eb49/output.txt

Total script time: 1.27 mins

  • Lint: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/26b1e3e70f93b24/output.txt

Total script time: 5.87 mins

  • Lint: Passed

@timvandermeij timvandermeij merged commit 23b8dbb into mozilla:master Oct 14, 2023
3 checks passed
@timvandermeij
Copy link
Contributor

Good idea, and thanks for all the work to remove require usage!

@Snuffleupagus Snuffleupagus deleted the eslint-import-no-commonjs branch October 14, 2023 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants