Skip to content

Commit 4ede986

Browse files
chore: make === required (#8251)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent e0037ed commit 4ede986

File tree

23 files changed

+28
-27
lines changed

23 files changed

+28
-27
lines changed

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ export default defineConfig(
220220
tryExtensions: ['.d.ts', '.d.mts', '.d.cts', '.ts', '.cts', '.mts', '.js', '.cjs', '.mjs'],
221221
},
222222
],
223+
eqeqeq: ['error', 'always'],
223224
},
224225
},
225226
{

packages/cspell-eslint-plugin/src/common/logger.cts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ function prefixLines(text: string, prefix: string, startIndex = 1): string {
5656
return text
5757
.split('\n')
5858
.map((line, index) => (index >= startIndex ? prefix + line : line))
59-
.map((line) => (line.trim() == '' ? '' : line))
59+
.map((line) => (line.trim() === '' ? '' : line))
6060
.join('\n');
6161
}

packages/cspell-eslint-plugin/src/spellCheckAST/scope.cts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class AstScopeMatcher {
4444
if (curr.type !== item.type) return 0;
4545
if (curr.childKey && item.childKey && curr.childKey !== item.childKey) return 0;
4646
if (curr.childKey && !item.childKey && matchKey) return 0;
47-
if (curr.childKey && (curr.childKey == item.childKey || !matchKey)) {
47+
if (curr.childKey && (curr.childKey === item.childKey || !matchKey)) {
4848
score += scale;
4949
}
5050
score += scale * 2;

packages/cspell-glob/src/globHelper.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ function gg(...globs: string[]) {
535535
}
536536

537537
function mGlob(g: KnownGlob | Partial<GlobPatternNormalized>[], ...toApply: Partial<GlobPatternNormalized>[]) {
538-
const globs = typeof g == 'string' ? knownGlobs[g] : g;
538+
const globs = typeof g === 'string' ? knownGlobs[g] : g;
539539
return globs.map((glob) => toApply.reduce((a: Partial<GlobPatternNormalized>, b) => ({ ...a, ...b }), glob));
540540
}
541541

packages/cspell-lib/src/lib/Settings/InDocSettings.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('Validate InDocSettings', () => {
121121
${'<!--- cSpell\u003Aflag-words apple -->'} | ${USE_TEST} | ${oc(inDocDict({ flagWords: ['apple', '-->'] }))}
122122
${'# cspell\u003Aignore auto* *labeler'} | ${USE_TEST} | ${oc(inDocDict({ ignoreWords: ['auto*', '*labeler'] }))}
123123
`('detect compound words setting: $test', ({ test, text, expected }) => {
124-
expect(InDoc.getInDocumentSettings(text == USE_TEST ? test : text)).toEqual(expected);
124+
expect(InDoc.getInDocumentSettings(text === USE_TEST ? test : text)).toEqual(expected);
125125
expect([...InDoc.validateInDocumentSettings(text, {})]).toEqual([]);
126126
});
127127

packages/cspell-lib/src/lib/Settings/link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export async function removePathsFromGlobalImports(paths: string[]): Promise<Rem
125125
}
126126

127127
function matchFilename(pathToRemove: string): TestResultToExclude {
128-
return Path.dirname(pathToRemove) != '.'
128+
return Path.dirname(pathToRemove) !== '.'
129129
? ({ filename }) => compareFilenames(filename, pathToRemove)
130130
: () => false;
131131
}

packages/cspell-lib/src/lib/util/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function isError(e: unknown): e is Error {
3434
if (e instanceof Error) return true;
3535
if (!e || typeof e !== 'object') return false;
3636
const ex = <Error>e;
37-
return typeof ex.name == 'string' && typeof ex.message == 'string' && (typeof ex.stack) in allowStringOrUndefined;
37+
return typeof ex.name === 'string' && typeof ex.message === 'string' && (typeof ex.stack) in allowStringOrUndefined;
3838
}
3939

4040
export function toError(e: unknown, errorFactory: UnknownErrorConstructor = UnknownError): Error {

packages/cspell-service-bus/src/bus.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const handlerRetryAgainRequest: Handler = {
7676
};
7777
const handlerThrowErrorOnRequest: Handler = {
7878
fn: (_service: Dispatcher) => (next) => (request) => {
79-
if (request.type == 'throw') throw 'error';
79+
if (request.type === 'throw') throw 'error';
8080
return next(request);
8181
},
8282
name: 'handlerThrowErrorOnRequest',

packages/cspell-tools/src/compiler/createWordsCollection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function buildHasFn(dict: { hasWord: (word: string, caseSensitive: boolean) => b
4040
const r = dict.hasWord(word, true);
4141
if (r || caseSensitive) return r;
4242
const lc = word.toLowerCase();
43-
if (lc == word) return false;
43+
if (lc === word) return false;
4444
return dict.hasWord(lc, true);
4545
}
4646

packages/cspell-tools/src/compiler/splitCamelCaseIfAllowed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function splitCamelCaseIfAllowed(
1212
minCompoundLength: number,
1313
): string[] {
1414
const split = [...splitCamelCase(word)];
15-
if (split.length == 1) return adjustCases(split, allowedWords, keepCase);
15+
if (split.length === 1) return adjustCases(split, allowedWords, keepCase);
1616
const missing = split.some((w) => isUnknown(w, allowedWords));
1717
if (missing) return [word];
1818
const wordIndexes = calcWordIndex(word, split);

0 commit comments

Comments
 (0)