Skip to content

Commit 0b3bde5

Browse files
FIX: @W-19990843@ Turn off jest/no-deprecated-functions rule (#372)
1 parent 37a667b commit 0b3bde5

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

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

Lines changed: 1 addition & 1 deletion
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.34.0",
4+
"version": "0.35.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",

packages/code-analyzer-eslint-engine/src/base-config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ export class BaseConfigFactory {
7171
// Swap out eslintJs.configs.recommended with eslintJs.configs.all
7272
configs[1] = eslintJs.configs.all;
7373

74+
// This one rule makes eslint throw an exception if the user doesn't have jest installed (which should be
75+
// optional), so we turn it off for now. See https://github.com/salesforce/eslint-config-lwc/issues/161
76+
configs[3].rules = {
77+
...configs[3].rules,
78+
'jest/no-deprecated-functions': 'off'
79+
}
80+
7481
// This one rule is broken and thus, we need to turn it off for now.
7582
// See https://git.soma.salesforce.com/lwc/eslint-plugin-lwc-platform/issues/152
7683
configs[5].rules = {

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,10 +1040,13 @@ export const RULE_MAPPINGS: Record<string, {severity: SeverityLevel, tags: strin
10401040
severity: SeverityLevel.High,
10411041
tags: [COMMON_TAGS.RECOMMENDED, LWC, COMMON_TAGS.CATEGORIES.ERROR_PRONE, COMMON_TAGS.LANGUAGES.JAVASCRIPT]
10421042
},
1043-
"jest/no-deprecated-functions": {
1044-
severity: SeverityLevel.Moderate,
1045-
tags: [COMMON_TAGS.RECOMMENDED, LWC, COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.JAVASCRIPT]
1046-
},
1043+
1044+
// This one rule makes eslint throw an exception if the user doesn't have jest installed (which should be
1045+
// optional), so we turn it off for now. See https://github.com/salesforce/eslint-config-lwc/issues/161
1046+
// "jest/no-deprecated-functions": {
1047+
// severity: SeverityLevel.Moderate,
1048+
// tags: [COMMON_TAGS.RECOMMENDED, LWC, COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.JAVASCRIPT]
1049+
// },
10471050
"jest/no-disabled-tests": {
10481051
severity: SeverityLevel.Info,
10491052
tags: [COMMON_TAGS.RECOMMENDED, LWC, COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.JAVASCRIPT]

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -685,20 +685,6 @@
685685
"JavaScript"
686686
]
687687
},
688-
{
689-
"description": "Disallow use of deprecated functions",
690-
"name": "jest/no-deprecated-functions",
691-
"resourceUrls": [
692-
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.0.1/docs/rules/no-deprecated-functions.md"
693-
],
694-
"severityLevel": 3,
695-
"tags": [
696-
"Recommended",
697-
"LWC",
698-
"BestPractices",
699-
"JavaScript"
700-
]
701-
},
702688
{
703689
"description": "Disallow disabled tests",
704690
"name": "jest/no-disabled-tests",

0 commit comments

Comments
 (0)