From 2f39219801e0cc1deb332b7189ab76a8bcbc315e Mon Sep 17 00:00:00 2001
From: "deepsource-autofix[bot]"
<62050782+deepsource-autofix[bot]@users.noreply.github.com>
Date: Wed, 6 Jan 2021 14:03:37 +0000
Subject: [PATCH] Format code with prettier
This commit fixes the style issues introduced in 6a6fa81 according to the output
from prettier.
Details: https://deepsource.io/gh/moulik-deepsource/demo-javascript/transform/67bf48eb-1475-4d9f-8c53-b0ba375891c2/
---
index.js | 100 +++++++++----------
packages/demo-react/src/App.test.js | 6 +-
packages/demo-react/src/components/header.js | 6 +-
packages/demo-react/src/components/home.js | 6 +-
packages/demo-react/src/index.css | 6 +-
packages/demo-react/src/index.js | 12 +--
packages/demo-react/src/reportWebVitals.js | 4 +-
packages/demo-react/src/setupTests.js | 2 +-
8 files changed, 69 insertions(+), 73 deletions(-)
diff --git a/index.js b/index.js
index 6c6d6b10..86cbae45 100644
--- a/index.js
+++ b/index.js
@@ -1,73 +1,69 @@
-function isEven(x){
- if(x = 2 || x % 2 == 0){
- console.log(`${x} is even`)
- } else
- console.log(`${x} is odd`)
+function isEven(x) {
+ if ((x = 2 || x % 2 == 0)) {
+ console.log(`${x} is even`);
+ } else console.log(`${x} is odd`);
}
-function isNumber(num){
- let x = undefined
- x= num % 2
- if(false) {
- console.log("Number is false")
- } else if (!!x) {
- console.log(`Number: ${x}`)
- } else if(2 == x){}
+function isNumber(num) {
+ let x = undefined;
+ x = num % 2;
+ if (false) {
+ console.log("Number is false");
+ } else if (!!x) {
+ console.log(`Number: ${x}`);
+ } else if (2 == x) {
+ }
}
function isTruthy(x) {
- debugger;
- return Boolean(x);
-};
+ debugger;
+ return Boolean(x);
+}
function area(r) {
- let math = Math()
- return math.PI * r * r;
+ let math = Math();
+ return math.PI * r * r;
}
-function isFooAvailable(obj){
- console.log(`Value of obj[foo]: ${obj['foo']}`)
- return obj.hasOwnProperty('foo')
+function isFooAvailable(obj) {
+ console.log(`Value of obj[foo]: ${obj["foo"]}`);
+ return obj.hasOwnProperty("foo");
}
-function findFooBar(){
- var re = /=foo bar/;
- re.test('foobar')
+function findFooBar() {
+ var re = /=foo bar/;
+ re.test("foobar");
}
-function consoleFoo(num){
- while((num != 3)){
- break;
- console.log(num--)
- }
-
+function consoleFoo(num) {
+ while (num != 3) {
+ break;
+ console.log(num--);
+ }
}
-function isGreaterThan(arr, x){
- if(Array.isArray(arr)){
- arr.map((n) => {
- return !(n > x) ? n : arguments.callee(n-1) * n;
- });
- };
+function isGreaterThan(arr, x) {
+ if (Array.isArray(arr)) {
+ arr.map((n) => {
+ return !(n > x) ? n : arguments.callee(n - 1) * n;
+ });
+ }
}
-function callHiEveryMinutes(x){
- if(!window && x){
- setTimeout("alert('Hi')", x * 1000)
-
- } else window.setTimeout("alert('Hi')", x * 1000)
+function callHiEveryMinutes(x) {
+ if (!window && x) {
+ setTimeout("alert('Hi')", x * 1000);
+ } else window.setTimeout("alert('Hi')", x * 1000);
}
let result = isFooAvailable({
- 'bar': 'bar',
- 'z': 'z'
-})
+ bar: "bar",
+ z: "z",
+})((function () {})(), 0);
-(function(){ }(), 0);
-
-function checkYoda(){
- let yoda = true;
- if(true == yoda){
- console.log("I am yoda")
- }
-}
\ No newline at end of file
+function checkYoda() {
+ let yoda = true;
+ if (true == yoda) {
+ console.log("I am yoda");
+ }
+}
diff --git a/packages/demo-react/src/App.test.js b/packages/demo-react/src/App.test.js
index 1f03afee..9382b9ad 100644
--- a/packages/demo-react/src/App.test.js
+++ b/packages/demo-react/src/App.test.js
@@ -1,7 +1,7 @@
-import { render, screen } from '@testing-library/react';
-import App from './App';
+import { render, screen } from "@testing-library/react";
+import App from "./App";
-test('renders learn react link', () => {
+test("renders learn react link", () => {
render(