Skip to content

Commit b89c715

Browse files
committed
update PMD and eslint
1 parent 625fe41 commit b89c715

File tree

10 files changed

+240
-169
lines changed

10 files changed

+240
-169
lines changed

package-lock.json

Lines changed: 146 additions & 123 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/code-analyzer-eslint-engine/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/code-analyzer-eslint-engine",
33
"description": "Plugin package that adds 'eslint' as an engine into Salesforce Code Analyzer",
4-
"version": "0.37.1",
4+
"version": "0.38.0-SNAPSHOT",
55
"author": "The Salesforce Code Analyzer Team",
66
"license": "BSD-3-Clause",
77
"homepage": "https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview",
@@ -13,33 +13,33 @@
1313
"main": "dist/index.js",
1414
"types": "dist/index.d.ts",
1515
"dependencies": {
16-
"@eslint/js": "^9.39.1",
16+
"@eslint/js": "^9.39.2",
1717
"@lwc/eslint-plugin-lwc": "^3.3.0",
1818
"@lwc/eslint-plugin-lwc-platform": "^6.3.0",
1919
"@salesforce-ux/eslint-plugin-slds": "^1.0.7",
2020
"@salesforce/code-analyzer-engine-api": "0.32.0",
2121
"@salesforce/code-analyzer-eslint8-engine": "0.9.0",
22-
"@salesforce/eslint-config-lwc": "^4.1.1",
22+
"@salesforce/eslint-config-lwc": "^4.1.2",
2323
"@salesforce/eslint-plugin-lightning": "^2.0.0",
2424
"@types/node": "^20.0.0",
25-
"@typescript-eslint/eslint-plugin": "^8.47.0",
26-
"@typescript-eslint/parser": "^8.47.0",
27-
"eslint": "^9.39.1",
25+
"@typescript-eslint/eslint-plugin": "^8.50.0",
26+
"@typescript-eslint/parser": "^8.50.0",
27+
"eslint": "^9.39.2",
2828
"eslint-plugin-import": "^2.32.0",
29-
"eslint-plugin-jest": "^29.2.0",
29+
"eslint-plugin-jest": "^29.5.0",
3030
"globals": "^16.5.0",
3131
"semver": "^7.7.3",
3232
"typescript": "^5.9.3",
33-
"typescript-eslint": "^8.47.0"
33+
"typescript-eslint": "^8.50.0"
3434
},
3535
"devDependencies": {
3636
"@types/jest": "^30.0.0",
3737
"@types/semver": "^7.7.1",
3838
"@types/unzipper": "^0.10.11",
3939
"cross-env": "^10.1.0",
4040
"jest": "^30.2.0",
41-
"rimraf": "^6.0.1",
42-
"ts-jest": "^29.4.5",
41+
"rimraf": "^6.1.2",
42+
"ts-jest": "^29.4.6",
4343
"unzipper": "^0.12.3"
4444
},
4545
"engines": {

packages/code-analyzer-eslint-engine/src/rule-mappings.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,10 @@ export const RULE_MAPPINGS: Record<string, {severity: SeverityLevel, tags: strin
14761476
severity: SeverityLevel.High,
14771477
tags: [/* NOT RECOMMENDED */ COMMON_TAGS.CATEGORIES.ERROR_PRONE, COMMON_TAGS.LANGUAGES.TYPESCRIPT]
14781478
},
1479+
"@typescript-eslint/no-useless-default-assignment": {
1480+
severity: SeverityLevel.Moderate,
1481+
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.TYPESCRIPT]
1482+
},
14791483
"@typescript-eslint/no-useless-empty-export": {
14801484
severity: SeverityLevel.Moderate,
14811485
tags: [/* NOT RECOMMENDED */ COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.TYPESCRIPT]

packages/code-analyzer-eslint-engine/test/test-data/rules_OnlyLwcBaseConfig.goldfile.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@
671671
"description": "Enforce assertion to be made in a test body",
672672
"name": "jest/expect-expect",
673673
"resourceUrls": [
674-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/expect-expect.md"
674+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/expect-expect.md"
675675
],
676676
"severityLevel": 5,
677677
"tags": [
@@ -685,7 +685,7 @@
685685
"description": "Disallow alias methods",
686686
"name": "jest/no-alias-methods",
687687
"resourceUrls": [
688-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-alias-methods.md"
688+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-alias-methods.md"
689689
],
690690
"severityLevel": 3,
691691
"tags": [
@@ -699,7 +699,7 @@
699699
"description": "Disallow commented out tests",
700700
"name": "jest/no-commented-out-tests",
701701
"resourceUrls": [
702-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-commented-out-tests.md"
702+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-commented-out-tests.md"
703703
],
704704
"severityLevel": 5,
705705
"tags": [
@@ -713,7 +713,7 @@
713713
"description": "Disallow calling `expect` conditionally",
714714
"name": "jest/no-conditional-expect",
715715
"resourceUrls": [
716-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-conditional-expect.md"
716+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-conditional-expect.md"
717717
],
718718
"severityLevel": 2,
719719
"tags": [
@@ -727,7 +727,7 @@
727727
"description": "Disallow disabled tests",
728728
"name": "jest/no-disabled-tests",
729729
"resourceUrls": [
730-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-disabled-tests.md"
730+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-disabled-tests.md"
731731
],
732732
"severityLevel": 5,
733733
"tags": [
@@ -741,7 +741,7 @@
741741
"description": "Disallow using a callback in asynchronous tests and hooks",
742742
"name": "jest/no-done-callback",
743743
"resourceUrls": [
744-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-done-callback.md"
744+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-done-callback.md"
745745
],
746746
"severityLevel": 3,
747747
"tags": [
@@ -755,7 +755,7 @@
755755
"description": "Disallow using `exports` in files containing tests",
756756
"name": "jest/no-export",
757757
"resourceUrls": [
758-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-export.md"
758+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-export.md"
759759
],
760760
"severityLevel": 3,
761761
"tags": [
@@ -769,7 +769,7 @@
769769
"description": "Disallow focused tests",
770770
"name": "jest/no-focused-tests",
771771
"resourceUrls": [
772-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-focused-tests.md"
772+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-focused-tests.md"
773773
],
774774
"severityLevel": 3,
775775
"tags": [
@@ -783,7 +783,7 @@
783783
"description": "Disallow identical titles",
784784
"name": "jest/no-identical-title",
785785
"resourceUrls": [
786-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-identical-title.md"
786+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-identical-title.md"
787787
],
788788
"severityLevel": 3,
789789
"tags": [
@@ -797,7 +797,7 @@
797797
"description": "Disallow string interpolation inside snapshots",
798798
"name": "jest/no-interpolation-in-snapshots",
799799
"resourceUrls": [
800-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-interpolation-in-snapshots.md"
800+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-interpolation-in-snapshots.md"
801801
],
802802
"severityLevel": 2,
803803
"tags": [
@@ -811,7 +811,7 @@
811811
"description": "Disallow Jasmine globals",
812812
"name": "jest/no-jasmine-globals",
813813
"resourceUrls": [
814-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-jasmine-globals.md"
814+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-jasmine-globals.md"
815815
],
816816
"severityLevel": 3,
817817
"tags": [
@@ -825,7 +825,7 @@
825825
"description": "Disallow manually importing from `__mocks__`",
826826
"name": "jest/no-mocks-import",
827827
"resourceUrls": [
828-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-mocks-import.md"
828+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-mocks-import.md"
829829
],
830830
"severityLevel": 2,
831831
"tags": [
@@ -839,7 +839,7 @@
839839
"description": "Disallow using `expect` outside of `it` or `test` blocks",
840840
"name": "jest/no-standalone-expect",
841841
"resourceUrls": [
842-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-standalone-expect.md"
842+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-standalone-expect.md"
843843
],
844844
"severityLevel": 3,
845845
"tags": [
@@ -853,7 +853,7 @@
853853
"description": "Require using `.only` and `.skip` over `f` and `x`",
854854
"name": "jest/no-test-prefixes",
855855
"resourceUrls": [
856-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/no-test-prefixes.md"
856+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-test-prefixes.md"
857857
],
858858
"severityLevel": 3,
859859
"tags": [
@@ -867,7 +867,7 @@
867867
"description": "Enforce valid `describe()` callback",
868868
"name": "jest/valid-describe-callback",
869869
"resourceUrls": [
870-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/valid-describe-callback.md"
870+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/valid-describe-callback.md"
871871
],
872872
"severityLevel": 2,
873873
"tags": [
@@ -881,7 +881,7 @@
881881
"description": "Enforce valid `expect()` usage",
882882
"name": "jest/valid-expect",
883883
"resourceUrls": [
884-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/valid-expect.md"
884+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/valid-expect.md"
885885
],
886886
"severityLevel": 3,
887887
"tags": [
@@ -895,7 +895,7 @@
895895
"description": "Require promises that have expectations in their chain to be valid",
896896
"name": "jest/valid-expect-in-promise",
897897
"resourceUrls": [
898-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/valid-expect-in-promise.md"
898+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/valid-expect-in-promise.md"
899899
],
900900
"severityLevel": 3,
901901
"tags": [
@@ -909,7 +909,7 @@
909909
"description": "Enforce valid titles",
910910
"name": "jest/valid-title",
911911
"resourceUrls": [
912-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.2.1/docs/rules/valid-title.md"
912+
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/valid-title.md"
913913
],
914914
"severityLevel": 3,
915915
"tags": [

packages/code-analyzer-eslint-engine/test/test-data/rules_OnlyTypeScriptBaseConfig.goldfile.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,19 @@
10831083
"TypeScript"
10841084
]
10851085
},
1086+
{
1087+
"description": "Disallow default values that will never be used",
1088+
"name": "@typescript-eslint/no-useless-default-assignment",
1089+
"resourceUrls": [
1090+
"https://typescript-eslint.io/rules/no-useless-default-assignment"
1091+
],
1092+
"severityLevel": 3,
1093+
"tags": [
1094+
"Recommended",
1095+
"BestPractices",
1096+
"TypeScript"
1097+
]
1098+
},
10861099
{
10871100
"description": "Disallow empty exports that don't change anything in a module file",
10881101
"name": "@typescript-eslint/no-useless-empty-export",

packages/code-analyzer-pmd-engine/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[versions]
99
hamcrest = "3.0"
1010
junit-jupiter = "5.13.4"
11-
pmd = "7.18.0" # !!! IMPORTANT !!! KEEP THIS IN SYNC WITH PMD_VERSION INSIDE OF: src/constants.ts
11+
pmd = "7.19.0" # !!! IMPORTANT !!! KEEP THIS IN SYNC WITH PMD_VERSION INSIDE OF: src/constants.ts
1212

1313
# For the following: Keep in sync with whatever pmd-core pulls in. Basically, we don't want duplicates in our java-lib folder.
1414
# To see pmd-core's dependencies, go to https://mvnrepository.com/artifact/net.sourceforge.pmd/pmd-core

packages/code-analyzer-pmd-engine/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/code-analyzer-pmd-engine",
33
"description": "Plugin package that adds 'pmd' and 'cpd' as engines into Salesforce Code Analyzer",
4-
"version": "0.33.0",
4+
"version": "0.34.0-SNAPSHOT",
55
"author": "The Salesforce Code Analyzer Team",
66
"license": "BSD-3-Clause",
77
"homepage": "https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview",
@@ -16,17 +16,17 @@
1616
"@salesforce/code-analyzer-engine-api": "0.32.0",
1717
"@types/node": "^20.0.0",
1818
"@types/semver": "^7.7.1",
19-
"semver": "^7.7.2"
19+
"semver": "^7.7.3"
2020
},
2121
"devDependencies": {
22-
"@eslint/js": "^9.39.1",
22+
"@eslint/js": "^9.39.2",
2323
"@types/jest": "^30.0.0",
24-
"eslint": "^9.39.1",
24+
"eslint": "^9.39.2",
2525
"jest": "^30.2.0",
2626
"rimraf": "^6.1.2",
27-
"ts-jest": "^29.4.5",
27+
"ts-jest": "^29.4.6",
2828
"typescript": "^5.9.3",
29-
"typescript-eslint": "^8.47.0"
29+
"typescript-eslint": "^8.50.0"
3030
},
3131
"engines": {
3232
"node": ">=20.0.0"

packages/code-analyzer-pmd-engine/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// !!! IMPORTANT !!! KEEP THIS IN SYNC WITH gradle/libs.versions.toml
2-
export const PMD_VERSION: string = '7.18.0';
2+
export const PMD_VERSION: string = '7.19.0';
33

44
export const PMD_ENGINE_NAME: string = "pmd";
55
export const CPD_ENGINE_NAME: string = "cpd";

packages/code-analyzer-pmd-engine/src/pmd-rule-mappings.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ export const RULE_MAPPINGS: Record<string, {severity: SeverityLevel, tags: strin
9696
severity: SeverityLevel.Low,
9797
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.CATEGORIES.PERFORMANCE, COMMON_TAGS.LANGUAGES.APEX]
9898
},
99+
"AvoidFutureAnnotation": {
100+
severity: SeverityLevel.Low,
101+
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.APEX]
102+
},
99103
"AvoidDeeplyNestedIfStmts": {
100104
severity: SeverityLevel.Moderate,
101105
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.CATEGORIES.DESIGN, COMMON_TAGS.LANGUAGES.APEX]
@@ -170,7 +174,7 @@ export const RULE_MAPPINGS: Record<string, {severity: SeverityLevel, tags: strin
170174
},
171175
"ExcessiveClassLength": {
172176
severity: SeverityLevel.Moderate,
173-
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.CATEGORIES.DESIGN, COMMON_TAGS.LANGUAGES.APEX]
177+
tags: [/* NOT RECOMMENDED */ COMMON_TAGS.CATEGORIES.DESIGN, COMMON_TAGS.LANGUAGES.APEX]
174178
},
175179
"ExcessiveParameterList": {
176180
severity: SeverityLevel.Moderate,
@@ -222,11 +226,15 @@ export const RULE_MAPPINGS: Record<string, {severity: SeverityLevel, tags: strin
222226
},
223227
"NcssConstructorCount": {
224228
severity: SeverityLevel.Low,
225-
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.CATEGORIES.DESIGN, COMMON_TAGS.LANGUAGES.APEX]
229+
tags: [/* NOT RECOMMENDED */ COMMON_TAGS.CATEGORIES.DESIGN, COMMON_TAGS.LANGUAGES.APEX]
230+
},
231+
"NcssCount": {
232+
severity: SeverityLevel.Moderate,
233+
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.LANGUAGES.APEX, COMMON_TAGS.CUSTOM]
226234
},
227235
"NcssMethodCount": {
228236
severity: SeverityLevel.Low,
229-
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.CATEGORIES.DESIGN, COMMON_TAGS.LANGUAGES.APEX]
237+
tags: [/* NOT RECOMMENDED */ COMMON_TAGS.CATEGORIES.DESIGN, COMMON_TAGS.LANGUAGES.APEX]
230238
},
231239
"NcssTypeCount": {
232240
severity: SeverityLevel.Low,

0 commit comments

Comments
 (0)