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: account for sourceType: "commonjs" in the strict rule #16308

merged 1 commit into from Sep 16, 2022


Copy link

@mdjermanovic mdjermanovic commented Sep 14, 2022

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Fixes #16304

What changes did you make? (Give an overview)

In the strict rule, I added context.languageOptions.sourceType === "commonjs" as another condition to determine whether a file is a CommonJS module.

Is there anything you'd like reviewers to focus on?

Marked as feat because it changes the behavior of this rule and can produce more warnings in the flat config mode.

I wasn't sure if we should update the docs for this rule a this point, because mentioning languageOptions might be confusing as it doesn't exist in the current eslintrc config format.

@eslint-github-bot eslint-github-bot bot added triage An ESLint team member will look at this issue soon feature This change adds a new feature to ESLint labels Sep 14, 2022
Copy link

netlify bot commented Sep 14, 2022

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 56cb6f4
🔍 Latest deploy log
😎 Deploy Preview
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link

@aladdin-add aladdin-add left a comment


Copy link

@snitin315 snitin315 left a comment


@snitin315 snitin315 added accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Sep 16, 2022
@mdjermanovic mdjermanovic merged commit 1729f9e into main Sep 16, 2022
20 checks passed
@mdjermanovic mdjermanovic deleted the issue16304 branch Sep 16, 2022
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Sep 27, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
| [eslint]( ([source]( | devDependencies | minor | [`8.23.1` -> `8.24.0`]( |


### Release Notes


### [`v8.24.0`](

[Compare Source](eslint/eslint@v8.23.1...v8.24.0)

#### Features

-   [`1729f9e`](eslint/eslint@1729f9e) feat: account for `sourceType: "commonjs"` in the strict rule ([#&#8203;16308](eslint/eslint#16308)) (Milos Djermanovic)
-   [`b0d72c9`](eslint/eslint@b0d72c9) feat: add rule logical-assignment-operators ([#&#8203;16102](eslint/eslint#16102)) (fnx)
-   [`f02bcd9`](eslint/eslint@f02bcd9) feat: `array-callback-return` support `findLast` and `findLastIndex` ([#&#8203;16314](eslint/eslint#16314)) (Sosuke Suzuki)

#### Documentation

-   [`2c152ff`](eslint/eslint@2c152ff) docs: note false positive `Object.getOwnPropertyNames` in prefer-reflect ([#&#8203;16317](eslint/eslint#16317)) (AnnAngela)
-   [`bf7bd88`](eslint/eslint@bf7bd88) docs: fix warn severity description for new config files ([#&#8203;16324](eslint/eslint#16324)) (Nitin Kumar)
-   [`8cc0bbe`](eslint/eslint@8cc0bbe) docs: use more clean link syntax ([#&#8203;16309](eslint/eslint#16309)) (Percy Ma)
-   [`6ba269e`](eslint/eslint@6ba269e) docs: fix typo ([#&#8203;16288](eslint/eslint#16288)) (jjangga0214)

#### Chores

-   [`131e646`](eslint/eslint@131e646) chore: Upgrade [@&#8203;humanwhocodes/config-array]( for perf ([#&#8203;16339](eslint/eslint#16339)) (Nicholas C. Zakas)
-   [`504fe59`](eslint/eslint@504fe59) perf: switch from object spread to `Object.assign` when merging globals ([#&#8203;16311](eslint/eslint#16311)) (Milos Djermanovic)



### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.


 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.


This PR has been generated by [Renovate Bot](

Co-authored-by: cabr2-bot <>
Reviewed-by: Epsilon_02 <>
Co-authored-by: Calciumdibromid Bot <>
Co-committed-by: Calciumdibromid Bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
accepted There is consensus among the team that this change meets the criteria for inclusion feature This change adds a new feature to ESLint
None yet
3 participants