mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
eslint: strict equality
Enforce use of ===/!== and fix existing issues.
This commit is contained in:
committed by
David Lechner
parent
1d9dd82191
commit
e01fb1fbe9
@@ -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
@@ -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
@@ -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),
|
||||
),
|
||||
});
|
||||
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user