Skip to content

Commit

Permalink
enable strict equal lint rule (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
duranb authored Nov 9, 2023
1 parent d9e41bb commit d1b1bc0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' }],
curly: 2,
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-undef': 'off',
'sort-keys': ['error', 'asc', { caseSensitive: true, natural: false, minKeys: 2 }],
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/activity/ActivityDirectiveChangelog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
{formatParameterValue(activityRevisionChangeMap[i].name, activityRevisionChangeMap[i].currentValue)}
</div>
<div class="actions">
{#if i == 0}
{#if i === 0}
<span>Current Revision</span>
{:else}
<button
Expand Down
2 changes: 1 addition & 1 deletion src/components/activity/ActivityFormPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}
const revision: ActivityDirectiveRevision = event.detail;
const activityType = $activityTypes.find(type => type.name == $selectedActivityDirective?.type);
const activityType = $activityTypes.find(type => type.name === $selectedActivityDirective?.type);
const changedKeys: string[] = [];
const potentialChanges: Array<keyof ActivityDirective & keyof ActivityDirectiveRevision> = [
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function modalBodyClickListener(): void {
export function modalBodyKeyListener(event: KeyboardEvent): void {
if (browser) {
const target: ModalElement | null = document.querySelector('#svelte-modal');
if (target && target.resolve && event.key == 'Escape' && target.getAttribute('data-dismissible') !== 'false') {
if (target && target.resolve && event.key === 'Escape' && target.getAttribute('data-dismissible') !== 'false') {
target.replaceChildren();
target.resolve({ confirm: false });
target.resolve = null;
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/useActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function useActions(node: HTMLElement | SVGElement, actions: ActionArray)
},

update(actions: ActionArray) {
if (((actions && actions.length) || 0) != actionReturns.length) {
if (((actions && actions.length) || 0) !== actionReturns.length) {
throw new Error('You must not change the length of an actions array.');
}

Expand Down
2 changes: 1 addition & 1 deletion src/workers/workerHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function validateInteger(value: string, name: string, range: NumericRange | null
if ((error_string = validateFloat(value, name, range)) !== false) {
return error_string;
}
if (Number(value) % 1 != 0) {
if (Number(value) % 1 !== 0) {
return CustomErrorCodes.InvalidInteger(name, value);
}

Expand Down

0 comments on commit d1b1bc0

Please sign in to comment.