Migrate to all newest packages, except for eslint v9#460
Conversation
| { | ||
| "name": "eslint-plugin-sonarjs", | ||
| "version": "0.25.1", | ||
| "version": "0.26.0", |
There was a problem hiding this comment.
I didn't land this version pull after the last release (#455)
| "outDir": "lib", | ||
| "sourceMap": true | ||
| "sourceMap": true, | ||
| "moduleResolution": "nodenext" |
There was a problem hiding this comment.
This is required to allow for the typescript-eslint libs to work. See more details - typescript-eslint/typescript-eslint#7284
| import { ESLintUtils } from '@typescript-eslint/utils'; | ||
|
|
||
| const { RuleTester } = ESLintUtils; | ||
| import { RuleTester } from '@typescript-eslint/rule-tester'; |
There was a problem hiding this comment.
Breaking change, now lives in a separate package - https://typescript-eslint.io/packages/rule-tester/
| expect(configs.recommended.rules).toHaveProperty(`sonarjs/${rule}`); | ||
| }); | ||
| expect(Object.keys(configs.recommended.rules!)).toHaveLength(existingRules.length); | ||
| expect(new Set(Object.values(configs.recommended.rules!))).toEqual(new Set(['off', 'error'])); |
There was a problem hiding this comment.
I added this check, as I would have missed almost exporting "recommended"
| type: 'suggestion', | ||
| docs: { | ||
| description: 'Cognitive Complexity of functions should not be too high', | ||
| recommended: 'error', |
There was a problem hiding this comment.
omitting this value, implies it's not recommended to be turned on. And also, based on this value, we compile our plugin.
|
zglicz
left a comment
There was a problem hiding this comment.
PR should be ready for review. SonarCloud analysis is passing, no more deprecated API's, tests passing and the build issue is unrelated and tracked in: https://sonarsource.atlassian.net/issues/BUILD-4777?jql=ORDER%20BY%20created%20DESC
| docker_arguments: | ||
| CIRRUS_AWS_ACCOUNT: ${CIRRUS_AWS_ACCOUNT} | ||
| cpu: 3 | ||
| cpu: 1 |
There was a problem hiding this comment.
running jest with --runInBand so we don't need more than 1 core
| import { ESLint } from 'eslint'; | ||
| import * as lodash from 'lodash'; | ||
| import * as minimist from 'minimist'; | ||
| import lodash from 'lodash'; |
There was a problem hiding this comment.
the change of moduleResolution: "nodenext" requires we change this.
|
Looks good to me: tests pass locally and build succeeds. As soon as the CI is fixed we can merge IMHO. |
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [eslint-plugin-sonarjs](https://togithub.com/SonarSource/eslint-plugin-sonarjs) | [`0.25.1` -> `1.0.3`](https://renovatebot.com/diffs/npm/eslint-plugin-sonarjs/0.25.1/1.0.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>SonarSource/eslint-plugin-sonarjs (eslint-plugin-sonarjs)</summary> ### [`v1.0.3`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/v1.0.2...004d7944672f249000e1eb1c97acd13e31e455eb) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/v1.0.2...1.0.3) ### [`v1.0.2`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/v1.0.2) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/1.0.0...v1.0.2) #### What's Changed - Export "meta" for plugin by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/472](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/472) ### [`v1.0.0`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/1.0.0) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/0.25.1...1.0.0) Eslint-plugin-sonarjs is compatible with ESLint v9. ##### What's Changed - Migrate to all newest packages, except for eslint v9 by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/460](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/460) - Move from a compile-all to a compile-entry-point pattern by [@​ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/463](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/463) - ESLINTJS-36 Split out tests and analyze into separate steps by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/465](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/465) - Fix breaking no-one-iteration-loop after ESLint v9 breaking change by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/467](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/467) - Resolve ESLINTJS-37 by [@​ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/466](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/466) - Add ruling tests to handle eslint 8 and 9 by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/468](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/468) - Make the exported rules a typed record by [@​ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/469](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/469) **Full Changelog**: SonarSource/eslint-plugin-sonarjs@0.25.1...1.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every weekday" in timezone Etc/UTC, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **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, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ScaleLeap/amazon-marketplaces). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIiLCJsYWJlbHMiOlsicmVub3ZhdGVib3QiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [eslint-plugin-sonarjs](https://togithub.com/SonarSource/eslint-plugin-sonarjs) | [`^0.25.1` -> `^1.0.3`](https://renovatebot.com/diffs/npm/eslint-plugin-sonarjs/0.25.1/1.0.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>SonarSource/eslint-plugin-sonarjs (eslint-plugin-sonarjs)</summary> ### [`v1.0.3`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/1.0.3) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/v1.0.2...1.0.3) #### What's Changed - [ESLINTJS-41](https://sonarsource.atlassian.net/browse/ESLINTJS-41) The package entry points are incorrectly set by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/473](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/473) ### [`v1.0.2`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/v1.0.2) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/1.0.0...v1.0.2) #### What's Changed - [ESLINTJS-40](https://sonarsource.atlassian.net/browse/ESLINTJS-40) Expose the plugin "meta" as expected by ESLint 9 by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/472](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/472) ### [`v1.0.0`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/1.0.0) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/0.25.1...1.0.0) Eslint-plugin-sonarjs is compatible with ESLint v9. ##### What's Changed - Migrate to all newest packages, except for eslint v9 by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/460](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/460) - Move from a compile-all to a compile-entry-point pattern by [@​ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/463](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/463) - ESLINTJS-36 Split out tests and analyze into separate steps by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/465](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/465) - Fix breaking no-one-iteration-loop after ESLint v9 breaking change by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/467](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/467) - Resolve ESLINTJS-37 by [@​ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/466](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/466) - Add ruling tests to handle eslint 8 and 9 by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/468](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/468) - Make the exported rules a typed record by [@​ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/469](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/469) **Full Changelog**: SonarSource/eslint-plugin-sonarjs@0.25.1...1.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 8pm on the first day of the month" in timezone America/Chicago, 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, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/compiler-explorer/compiler-explorer). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [eslint-plugin-sonarjs](https://togithub.com/SonarSource/eslint-plugin-sonarjs) | [`^0.25.1` -> `^1.0.3`](https://renovatebot.com/diffs/npm/eslint-plugin-sonarjs/0.25.1/1.0.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>SonarSource/eslint-plugin-sonarjs (eslint-plugin-sonarjs)</summary> ### [`v1.0.3`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/1.0.3) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/v1.0.2...1.0.3) #### What's Changed - [ESLINTJS-41](https://sonarsource.atlassian.net/browse/ESLINTJS-41) The package entry points are incorrectly set by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/473](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/473) ### [`v1.0.2`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/v1.0.2) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/1.0.0...v1.0.2) #### What's Changed - [ESLINTJS-40](https://sonarsource.atlassian.net/browse/ESLINTJS-40) Expose the plugin "meta" as expected by ESLint 9 by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/472](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/472) ### [`v1.0.0`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/1.0.0) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/0.25.1...1.0.0) Eslint-plugin-sonarjs is compatible with ESLint v9. ##### What's Changed - Migrate to all newest packages, except for eslint v9 by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/460](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/460) - Move from a compile-all to a compile-entry-point pattern by [@​ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/463](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/463) - ESLINTJS-36 Split out tests and analyze into separate steps by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/465](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/465) - Fix breaking no-one-iteration-loop after ESLint v9 breaking change by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/467](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/467) - Resolve ESLINTJS-37 by [@​ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/466](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/466) - Add ruling tests to handle eslint 8 and 9 by [@​zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/468](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/468) - Make the exported rules a typed record by [@​ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/469](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/469) **Full Changelog**: SonarSource/eslint-plugin-sonarjs@0.25.1...1.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 8pm on the first day of the month" in timezone America/Chicago, 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, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/compiler-explorer/compiler-explorer). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…explorer#6578) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [eslint-plugin-sonarjs](https://togithub.com/SonarSource/eslint-plugin-sonarjs) | [`^0.25.1` -> `^1.0.3`](https://renovatebot.com/diffs/npm/eslint-plugin-sonarjs/0.25.1/1.0.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>SonarSource/eslint-plugin-sonarjs (eslint-plugin-sonarjs)</summary> ### [`v1.0.3`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/1.0.3) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/v1.0.2...1.0.3) #### What's Changed - [ESLINTJS-41](https://sonarsource.atlassian.net/browse/ESLINTJS-41) The package entry points are incorrectly set by [@&compiler-explorer#8203;zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/473](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/473) ### [`v1.0.2`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/v1.0.2) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/1.0.0...v1.0.2) #### What's Changed - [ESLINTJS-40](https://sonarsource.atlassian.net/browse/ESLINTJS-40) Expose the plugin "meta" as expected by ESLint 9 by [@&compiler-explorer#8203;zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/472](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/472) ### [`v1.0.0`](https://togithub.com/SonarSource/eslint-plugin-sonarjs/releases/tag/1.0.0) [Compare Source](https://togithub.com/SonarSource/eslint-plugin-sonarjs/compare/0.25.1...1.0.0) Eslint-plugin-sonarjs is compatible with ESLint v9. ##### What's Changed - Migrate to all newest packages, except for eslint v9 by [@&compiler-explorer#8203;zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/460](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/460) - Move from a compile-all to a compile-entry-point pattern by [@&compiler-explorer#8203;ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/463](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/463) - ESLINTJS-36 Split out tests and analyze into separate steps by [@&compiler-explorer#8203;zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/465](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/465) - Fix breaking no-one-iteration-loop after ESLint v9 breaking change by [@&compiler-explorer#8203;zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/467](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/467) - Resolve ESLINTJS-37 by [@&compiler-explorer#8203;ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/466](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/466) - Add ruling tests to handle eslint 8 and 9 by [@&compiler-explorer#8203;zglicz](https://togithub.com/zglicz) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/468](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/468) - Make the exported rules a typed record by [@&compiler-explorer#8203;ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource) in [https://github.com/SonarSource/eslint-plugin-sonarjs/pull/469](https://togithub.com/SonarSource/eslint-plugin-sonarjs/pull/469) **Full Changelog**: SonarSource/eslint-plugin-sonarjs@0.25.1...1.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 8pm on the first day of the month" in timezone America/Chicago, 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, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/compiler-explorer/compiler-explorer). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>



Fixes ESLINTJS-30