eslint: strict equality

Enforce use of ===/!== and fix existing issues.
This commit is contained in:
David Lechner
2022-11-23 17:20:45 -06:00
committed by David Lechner
parent 1d9dd82191
commit e01fb1fbe9
5 changed files with 7 additions and 6 deletions
+1
View File
@@ -17,6 +17,7 @@ module.exports = {
plugins: ['react'],
rules: {
curly: 'error',
eqeqeq: 'error',
'no-multi-spaces': 'error',
'no-trailing-spaces': 'error',
'no-multiple-empty-lines': 'error',
+1 -1
View File
@@ -128,7 +128,7 @@ const Docs: React.VFC = () => {
? e.metaKey && !e.ctrlKey
: e.ctrlKey && !e.metaKey) &&
!e.altKey &&
e.key == 'd'
e.key === 'd'
) {
e.preventDefault();
// since the iframe is only visible when docs are shown
+2 -2
View File
@@ -205,9 +205,9 @@ function* handleEditorActivateFile(
yield* put(editorOpenFile(action.uuid));
const { didFailToOpen } = yield* race({
didOpen: take(editorDidOpenFile.when((a) => a.uuid == action.uuid)),
didOpen: take(editorDidOpenFile.when((a) => a.uuid === action.uuid)),
didFailToOpen: take(
editorDidFailToOpenFile.when((a) => a.uuid == action.uuid),
editorDidFailToOpenFile.when((a) => a.uuid === action.uuid),
),
});
+1 -1
View File
@@ -177,7 +177,7 @@ function* handleExplorerImportFiles(): Generator {
const result = validateFileName(baseName, pythonFileExtension, []);
if (result != FileNameValidationResult.IsOk) {
if (result !== FileNameValidationResult.IsOk) {
yield* put(renameImportDialogShow(file.name));
const { accepted, cancelled } = yield* race({
+2 -2
View File
@@ -74,7 +74,7 @@ function registerValidSW(swUrl: string, config?: Config): void {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
if (installingWorker === null) {
return;
}
installingWorker.onstatechange = () => {
@@ -122,7 +122,7 @@ function checkValidServiceWorker(swUrl: string, config?: Config): void {
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
(contentType !== null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then((registration) => {