Skip to content

Commit b3e8b8e

Browse files
Merge pull request #1329 from forcedotcom/jf/W-23928423
fix: rejiggered eslint.config.mjs (W-23928423)
2 parents b13d584 + 15dc4f8 commit b3e8b8e

55 files changed

Lines changed: 1358 additions & 1375 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

Lines changed: 0 additions & 14 deletions
This file was deleted.

eslint-suppressions.json

Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
{
2+
"src/config/config.ts": {
3+
"@typescript-eslint/no-base-to-string": {
4+
"count": 1
5+
}
6+
},
7+
"src/config/configAggregator.ts": {
8+
"@typescript-eslint/prefer-nullish-coalescing": {
9+
"count": 1
10+
}
11+
},
12+
"src/config/configFile.ts": {
13+
"@typescript-eslint/no-unused-vars": {
14+
"count": 3
15+
},
16+
"@typescript-eslint/prefer-nullish-coalescing": {
17+
"count": 2
18+
}
19+
},
20+
"src/config/configStore.ts": {
21+
"@typescript-eslint/prefer-nullish-coalescing": {
22+
"count": 1
23+
}
24+
},
25+
"src/crypto/crypto.ts": {
26+
"@typescript-eslint/ban-types": {
27+
"count": 1
28+
},
29+
"@typescript-eslint/no-empty-object-type": {
30+
"count": 2
31+
},
32+
"@typescript-eslint/prefer-nullish-coalescing": {
33+
"count": 2
34+
}
35+
},
36+
"src/crypto/keyChain.ts": {
37+
"@typescript-eslint/no-unused-vars": {
38+
"count": 1
39+
}
40+
},
41+
"src/crypto/keyChainImpl.ts": {
42+
"@typescript-eslint/no-unused-vars": {
43+
"count": 1
44+
},
45+
"@typescript-eslint/prefer-optional-chain": {
46+
"count": 2
47+
}
48+
},
49+
"src/deviceOauthService.ts": {
50+
"@typescript-eslint/ban-types": {
51+
"count": 1
52+
},
53+
"@typescript-eslint/prefer-nullish-coalescing": {
54+
"count": 2
55+
}
56+
},
57+
"src/global.ts": {
58+
"@typescript-eslint/no-unused-vars": {
59+
"count": 1
60+
}
61+
},
62+
"src/lifecycleEvents.ts": {
63+
"@typescript-eslint/prefer-nullish-coalescing": {
64+
"count": 2
65+
}
66+
},
67+
"src/logger/logger.ts": {
68+
"@typescript-eslint/switch-exhaustiveness-check": {
69+
"count": 1
70+
}
71+
},
72+
"src/logger/transformStream.ts": {
73+
"@typescript-eslint/no-require-imports": {
74+
"count": 1
75+
}
76+
},
77+
"src/messageTransformer.ts": {
78+
"import/no-extraneous-dependencies": {
79+
"count": 1
80+
}
81+
},
82+
"src/messages.ts": {
83+
"@typescript-eslint/no-require-imports": {
84+
"count": 1
85+
},
86+
"@typescript-eslint/no-unused-vars": {
87+
"count": 1
88+
}
89+
},
90+
"src/org/authInfo.ts": {
91+
"@typescript-eslint/no-base-to-string": {
92+
"count": 1
93+
},
94+
"@typescript-eslint/no-unused-vars": {
95+
"count": 4
96+
},
97+
"@typescript-eslint/prefer-nullish-coalescing": {
98+
"count": 2
99+
},
100+
"no-useless-assignment": {
101+
"count": 1
102+
}
103+
},
104+
"src/org/connection.ts": {
105+
"@typescript-eslint/no-unused-vars": {
106+
"count": 1
107+
}
108+
},
109+
"src/org/org.ts": {
110+
"@typescript-eslint/no-unused-vars": {
111+
"count": 5
112+
},
113+
"@typescript-eslint/prefer-nullish-coalescing": {
114+
"count": 2
115+
},
116+
"@typescript-eslint/unbound-method": {
117+
"count": 1
118+
},
119+
"no-useless-assignment": {
120+
"count": 1
121+
}
122+
},
123+
"src/org/scratchOrgCreate.ts": {
124+
"@typescript-eslint/no-base-to-string": {
125+
"count": 1
126+
}
127+
},
128+
"src/org/scratchOrgInfoGenerator.ts": {
129+
"@typescript-eslint/no-unused-vars": {
130+
"count": 3
131+
},
132+
"complexity": {
133+
"count": 1
134+
}
135+
},
136+
"src/org/user.ts": {
137+
"@typescript-eslint/no-base-to-string": {
138+
"count": 1
139+
},
140+
"@typescript-eslint/prefer-promise-reject-errors": {
141+
"count": 1
142+
}
143+
},
144+
"src/schema/validator.ts": {
145+
"@typescript-eslint/switch-exhaustiveness-check": {
146+
"count": 1
147+
}
148+
},
149+
"src/sfProject.ts": {
150+
"@typescript-eslint/prefer-nullish-coalescing": {
151+
"count": 4
152+
}
153+
},
154+
"src/status/pollingClient.ts": {
155+
"@typescript-eslint/only-throw-error": {
156+
"count": 2
157+
}
158+
},
159+
"src/status/streamingClient.ts": {
160+
"@typescript-eslint/prefer-nullish-coalescing": {
161+
"count": 1
162+
},
163+
"@typescript-eslint/prefer-optional-chain": {
164+
"count": 1
165+
},
166+
"@typescript-eslint/prefer-promise-reject-errors": {
167+
"count": 2
168+
}
169+
},
170+
"src/testSetup.ts": {
171+
"@typescript-eslint/no-misused-promises": {
172+
"count": 1
173+
},
174+
"@typescript-eslint/no-require-imports": {
175+
"count": 1
176+
},
177+
"@typescript-eslint/no-unused-vars": {
178+
"count": 1
179+
},
180+
"@typescript-eslint/prefer-nullish-coalescing": {
181+
"count": 1
182+
},
183+
"import/no-extraneous-dependencies": {
184+
"count": 2
185+
},
186+
"preserve-caught-error": {
187+
"count": 1
188+
}
189+
},
190+
"src/util/fileLocking.ts": {
191+
"@typescript-eslint/no-unused-vars": {
192+
"count": 1
193+
}
194+
},
195+
"src/util/sfdc.ts": {
196+
"@typescript-eslint/no-unused-vars": {
197+
"count": 1
198+
}
199+
},
200+
"src/util/structuredWriter.ts": {
201+
"@typescript-eslint/member-ordering": {
202+
"count": 1
203+
}
204+
},
205+
"src/webOAuthServer.ts": {
206+
"@typescript-eslint/prefer-promise-reject-errors": {
207+
"count": 3
208+
}
209+
},
210+
"test/unit/config/configAggregator.test.ts": {
211+
"@typescript-eslint/no-unused-vars": {
212+
"count": 1
213+
}
214+
},
215+
"test/unit/config/configStore.test.ts": {
216+
"@typescript-eslint/no-base-to-string": {
217+
"count": 1
218+
}
219+
},
220+
"test/unit/crypto/cryptoTest.test.ts": {
221+
"@typescript-eslint/ban-types": {
222+
"count": 1
223+
},
224+
"@typescript-eslint/no-empty-object-type": {
225+
"count": 1
226+
},
227+
"@typescript-eslint/only-throw-error": {
228+
"count": 1
229+
},
230+
"preserve-caught-error": {
231+
"count": 1
232+
}
233+
},
234+
"test/unit/deviceOauthService.test.ts": {
235+
"@typescript-eslint/no-base-to-string": {
236+
"count": 12
237+
}
238+
},
239+
"test/unit/lifecycleEvents.test.ts": {
240+
"@typescript-eslint/ban-types": {
241+
"count": 1
242+
}
243+
},
244+
"test/unit/org/authInfo.test.ts": {
245+
"@typescript-eslint/ban-types": {
246+
"count": 1
247+
},
248+
"@typescript-eslint/no-empty-object-type": {
249+
"count": 3
250+
}
251+
},
252+
"test/unit/org/org.test.ts": {
253+
"@typescript-eslint/no-unused-vars": {
254+
"count": 4
255+
}
256+
},
257+
"test/unit/status/pollingClient.test.ts": {
258+
"@typescript-eslint/no-unsafe-return": {
259+
"count": 1
260+
},
261+
"@typescript-eslint/no-unused-vars": {
262+
"count": 3
263+
}
264+
}
265+
}

eslint.config.mjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import tsconfigs from 'eslint-config-salesforce-typescript';
2+
3+
const configs = [
4+
...tsconfigs,
5+
{
6+
files: ['./test/**/*'],
7+
rules: {
8+
// Allow assert style expressions. i.e. expect(true).to.be.true
9+
'no-unused-expressions': 'off',
10+
'@typescript-eslint/no-explicit-any': 'off',
11+
12+
// Tests usually access private or protected methods/variables
13+
'@typescript-eslint/ban-ts-comment': 'off',
14+
15+
// It is common for tests to stub out method.
16+
'@typescript-eslint/camelcase': 'off',
17+
'@typescript-eslint/restrict-template-expressions': 'off',
18+
'@typescript-eslint/unbound-method': 'off',
19+
20+
// Return types are defined by the source code. Allows for quick overwrites.
21+
'@typescript-eslint/explicit-function-return-type': 'off',
22+
// Mocked out the methods that shouldn't do anything in the tests.
23+
'@typescript-eslint/no-empty-function': 'off',
24+
// Easily return a promise in a mocked method.
25+
'@typescript-eslint/require-await': 'off',
26+
},
27+
},
28+
];
29+
30+
export default configs;

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,21 @@
8383
"zod": "^4.1.12"
8484
},
8585
"devDependencies": {
86-
"@salesforce/dev-scripts": "^11.0.4",
86+
"@salesforce/dev-scripts": "^13.0.2",
8787
"@salesforce/ts-sinon": "^1.4.31",
8888
"@types/benchmark": "^2.1.5",
89+
"@types/chai": "^4.3.17",
8990
"@types/fast-levenshtein": "^0.0.4",
9091
"@types/jsonwebtoken": "9.0.10",
92+
"@types/mocha": "^10.0.10",
93+
"@types/node": "^18",
9194
"@types/proper-lockfile": "^4.1.4",
9295
"@types/semver": "^7.7.1",
96+
"@types/sinon": "^10.0.20",
9397
"benchmark": "^2.1.4",
9498
"esbuild": "^0.28.0",
99+
"eslint": "^10.4.0",
100+
"eslint-config-salesforce-typescript": "^6.0.0",
95101
"mocha": "^11.7.5",
96102
"ts-node": "^10.9.2",
97103
"ts-patch": "^3.3.0",
@@ -150,6 +156,7 @@
150156
"src/**/*.ts",
151157
"test/**/*.ts",
152158
"messages/**",
159+
"**/eslint.config.*",
153160
"**/.eslint*",
154161
"**/tsconfig.json"
155162
],

src/config/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export class Config extends ConfigFile<ConfigFile.Options, ConfigProperties> {
437437
await super.read(false, force);
438438
if (Global.SFDX_INTEROPERABILITY) {
439439
// will exist if Global.SFDX_INTEROPERABILITY is enabled
440-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
440+
441441
this.contents.merge(stateFromSfdxFileSync(this.sfdxPath!, this));
442442
}
443443
await this.cryptProperties(false);
@@ -451,7 +451,7 @@ export class Config extends ConfigFile<ConfigFile.Options, ConfigProperties> {
451451
super.readSync(false, force);
452452
if (Global.SFDX_INTEROPERABILITY) {
453453
// will exist if Global.SFDX_INTEROPERABILITY is enabled
454-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
454+
455455
this.contents.merge(stateFromSfdxFileSync(this.sfdxPath!, this));
456456
}
457457

@@ -471,7 +471,7 @@ export class Config extends ConfigFile<ConfigFile.Options, ConfigProperties> {
471471

472472
if (Global.SFDX_INTEROPERABILITY) {
473473
// will exist if Global.SFDX_INTEROPERABILITY is enabled
474-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
474+
475475
await writeToSfdx(this.sfdxPath!, this.getContents());
476476
}
477477
await this.cryptProperties(false);
@@ -562,7 +562,7 @@ export class Config extends ConfigFile<ConfigFile.Options, ConfigProperties> {
562562
*
563563
* @param propertyName The name of the property.
564564
*/
565-
// eslint-disable-next-line class-methods-use-this
565+
566566
public getPropertyConfig(propertyName: string): ConfigPropertyMeta {
567567
const prop = Config.propertyConfigMap()[propertyName];
568568

0 commit comments

Comments
 (0)