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

feat(linter): add import/no-commonjs rule #6978

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

pumano
Copy link
Contributor

@pumano pumano commented Oct 28, 2024

No description provided.

Copy link

graphite-app bot commented Oct 28, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Oct 28, 2024
@pumano
Copy link
Contributor Author

pumano commented Oct 28, 2024

This is my first time I trying to port rule, I tried my best, but few cases I can't cover (working with scopes). I added FIXME: labels, where problems exist. Hope someone (more advanced than I) fix it later.

P. S. don't see clippy errors in IDE, only after PR opened. I fix all problems, but I mute warnings that are really harm to code.

Copy link

codspeed-hq bot commented Oct 28, 2024

CodSpeed Performance Report

Merging #6978 will not alter performance

Comparing pumano:feat/import-no-commonjs-rule (c6b23f6) with main (9fd9f4f)

Summary

✅ 30 untouched benchmarks

@pumano pumano force-pushed the feat/import-no-commonjs-rule branch 4 times, most recently from aa7f9e3 to 591be66 Compare October 28, 2024 11:44
Copy link
Contributor

@DonIsaac DonIsaac left a comment

Choose a reason for hiding this comment

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

Looks like there's still a bunch of FIXME comments that need resolving.

crates/oxc_linter/src/rules/import/no_commonjs.rs Outdated Show resolved Hide resolved
crates/oxc_linter/src/rules/import/no_commonjs.rs Outdated Show resolved Hide resolved
@DonIsaac DonIsaac marked this pull request as draft October 28, 2024 18:31
@DonIsaac
Copy link
Contributor

Marking this PR as a draft until FIXMEs are resolved.

@pumano pumano force-pushed the feat/import-no-commonjs-rule branch from 591be66 to af7e943 Compare October 29, 2024 07:12
@pumano pumano force-pushed the feat/import-no-commonjs-rule branch from af7e943 to c6b23f6 Compare October 29, 2024 11:34
@pumano pumano requested a review from DonIsaac October 29, 2024 11:41
@pumano
Copy link
Contributor Author

pumano commented Oct 29, 2024

@DonIsaac Looks like I fix all issues. Please review

@pumano pumano marked this pull request as ready for review October 29, 2024 11:48
@DonIsaac DonIsaac merged commit a6fcd81 into oxc-project:main Oct 30, 2024
27 checks passed
@pumano pumano deleted the feat/import-no-commonjs-rule branch October 30, 2024 05:32
@oxc-bot oxc-bot mentioned this pull request Nov 3, 2024
Boshen added a commit that referenced this pull request Nov 3, 2024
## [0.11.0] - 2024-11-03

- 9fd9f4f linter: [**BREAKING**] Sync sindresorhus/globals; removed
Object.prototype properties from builtin and es* globals (#6991)
(Boshen)

### Features

- 6b619da editor: Listen to config file changes and trigger a
didChangeConfiguration update (#6964) (Nicholas Rayburn)
- 7872927 editor/vscode: Support window/showMessage event (#7085)
(Nicholas Rayburn)
- 2184588 linter: Do not bail for unmatched rules yet (#7093) (Boshen)
- a6fcd81 linter: Add `import/no-commonjs` rule (#6978) (Dmitry
Zakharov)
- 1691cab linter: Support user-configurable secrets for
`oxc-security/api-keys` (#5938) (DonIsaac)
- 610621c linter: Implement `react/style-prop-object` (#6342) (Albert
Kaaman)
- 1e2f012 linter: Add `oxc/no-map-spread` (#6751) (DonIsaac)
- 1c66473 linter: Implement `eslint/prefer-object-has-own` (#6905)
(tomoya yanagibashi)

### Bug Fixes

- ebf3753 editor: Fix onConfigChange to send the correct config for
didChangeConfiguration notification (#6962) (Nicholas Rayburn)
- 79bf74a linter: Check is_reference_to_global_variable in
`no-array-constructor` (#7067) (Naoya Yoshizawa)
- 38d1f78 linter: Remove confusing help text for now (#7081) (Cam
McHenry)
- 147e2e4 linter: Allow replacing rule when none are enabled yet (#7014)
(camchenry)
- 7aa496a linter: Remove unsafe fixer of `no-useless-spread` (#6655)
(dalaoshu)
- f5a7134 linter/no-unused-vars: False positive for discarded reads
within sequences (#6907) (DonIsaac)

### Documentation

- 4551baa linter: Document `rules` (#6983) (Boshen)

### Refactor

- a8dc75d linter: Remove unused CLI result types (#7088) (camchenry)
- 8f1460e linter: Move `LintPlugins` from `LintOptions` to `LintConfig`
(#6932) (DonIsaac)

### Testing

- c35d3f2 linter: Improve test failure output (#6975) (camchenry)

---------

Co-authored-by: Boshen <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants