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

Migrate to all newest packages, except for eslint v9 #460

Merged
merged 10 commits into from
Apr 25, 2024
Merged

Conversation

zglicz
Copy link
Contributor

@zglicz zglicz commented Apr 24, 2024

Fixes ESLINTJS-30

@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-sonarjs",
"version": "0.25.1",
"version": "0.26.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't land this version pull after the last release (#455)

@@ -10,7 +10,8 @@
"allowSyntheticDefaultImports": true,
"noEmit": false,
"outDir": "lib",
"sourceMap": true
"sourceMap": true,
"moduleResolution": "nodenext"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Breaking change, now lives in a separate package - https://typescript-eslint.io/packages/rule-tester/

@@ -29,6 +29,7 @@ it('should declare all rules in recommended config', () => {
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']));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this check, as I would have missed almost exporting "recommended"

@@ -61,13 +62,13 @@ const rule: TSESLint.RuleModule<string, (number | 'metric' | 'sonar-runtime')[]>
type: 'suggestion',
docs: {
description: 'Cognitive Complexity of functions should not be too high',
recommended: 'error',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

omitting this value, implies it's not recommended to be turned on. And also, based on this value, we compile our plugin.

Copy link

sonarcloud bot commented Apr 25, 2024

Copy link
Contributor Author

@zglicz zglicz left a comment

Choose a reason for hiding this comment

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

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

@@ -30,7 +30,7 @@ build_task:
<<: *CONTAINER_DEFINITION
docker_arguments:
CIRRUS_AWS_ACCOUNT: ${CIRRUS_AWS_ACCOUNT}
cpu: 3
cpu: 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

running jest with --runInBand so we don't need more than 1 core

@@ -20,8 +20,8 @@
import * as fs from 'fs';
import * as path from 'path';
import { ESLint } from 'eslint';
import * as lodash from 'lodash';
import * as minimist from 'minimist';
import lodash from 'lodash';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the change of moduleResolution: "nodenext" requires we change this.

@ericmorand-sonarsource
Copy link
Contributor

Looks good to me: tests pass locally and build succeeds. As soon as the CI is fixed we can merge IMHO.

@zglicz zglicz merged commit 67ca4c5 into master Apr 25, 2024
2 of 6 checks passed
@zglicz zglicz deleted the new_packages branch April 25, 2024 13:33
@zglicz zglicz added this to the 1.0.0 milestone May 3, 2024
renovate bot added a commit to ScaleLeap/amazon-marketplaces that referenced this pull request May 8, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](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)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/eslint-plugin-sonarjs/1.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/eslint-plugin-sonarjs/1.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/eslint-plugin-sonarjs/0.25.1/1.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint-plugin-sonarjs/0.25.1/1.0.3?slim=true)](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
[@&#8203;zglicz](https://togithub.com/zglicz) in
[SonarSource/eslint-plugin-sonarjs#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
[@&#8203;zglicz](https://togithub.com/zglicz) in
[SonarSource/eslint-plugin-sonarjs#460
- Move from a compile-all to a compile-entry-point pattern by
[@&#8203;ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource)
in
[SonarSource/eslint-plugin-sonarjs#463
- ESLINTJS-36 Split out tests and analyze into separate steps by
[@&#8203;zglicz](https://togithub.com/zglicz) in
[SonarSource/eslint-plugin-sonarjs#465
- Fix breaking no-one-iteration-loop after ESLint v9 breaking change by
[@&#8203;zglicz](https://togithub.com/zglicz) in
[SonarSource/eslint-plugin-sonarjs#467
- Resolve ESLINTJS-37 by
[@&#8203;ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource)
in
[SonarSource/eslint-plugin-sonarjs#466
- Add ruling tests to handle eslint 8 and 9 by
[@&#8203;zglicz](https://togithub.com/zglicz) in
[SonarSource/eslint-plugin-sonarjs#468
- Make the exported rules a typed record by
[@&#8203;ericmorand-sonarsource](https://togithub.com/ericmorand-sonarsource)
in
[SonarSource/eslint-plugin-sonarjs#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants