diff --git a/.husky/pre-commit b/.husky/pre-commit index d2ae35e..dc0378c 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -yarn lint-staged +yarn lint-staged \ No newline at end of file diff --git a/package.json b/package.json index 5b0affc..eee4ca2 100644 --- a/package.json +++ b/package.json @@ -74,9 +74,10 @@ "lint-staged": "^13.0.3" }, "lint-staged" : { - "packages/react-app/src/**/*.{js,jsx,css}": [ + "packages/react-app/src/**/*.{js,jsx}": [ "prettier --write", - "yarn react-app:lint" + "eslint --fix", + "eslint --max-warnings=0 --ignore-path packages/react-app/.eslintignore" ] } } diff --git a/packages/react-app/scripts/ipfs.js b/packages/react-app/scripts/ipfs.js index e1e9de5..f8f7c70 100644 --- a/packages/react-app/scripts/ipfs.js +++ b/packages/react-app/scripts/ipfs.js @@ -1,4 +1,4 @@ -const {create, globSource} = require("ipfs-http-client"); +const { create, globSource } = require("ipfs-http-client"); const chalk = require("chalk"); const { clearLine } = require("readline"); @@ -6,24 +6,24 @@ const infura = { host: "ipfs.infura.io", port: "5001", protocol: "https" }; // run your own ipfs daemon: https://docs.ipfs.io/how-to/command-line-quick-start/#install-ipfs // const localhost = { host: "localhost", port: "5001", protocol: "http" }; -const ipfs = create(infura); +const ipfs = create(infura); const ipfsGateway = "https://ipfs.io/ipfs/"; const ipnsGateway = "https://ipfs.io/ipns/"; const addOptions = { pin: true, - wrapWithDirectory: true + wrapWithDirectory: true, }; const pushDirectoryToIPFS = async path => { try { - const file = ipfs.addAll(globSource(path, '**/*'), addOptions) + const file = ipfs.addAll(globSource(path, "**/*"), addOptions); let lastRes; for await (const f of file) { - lastRes = f + lastRes = f; } - return lastRes + return lastRes; } catch (e) { return {}; } diff --git a/packages/react-app/scripts/s3.js b/packages/react-app/scripts/s3.js index 6e108f9..524f25b 100644 --- a/packages/react-app/scripts/s3.js +++ b/packages/react-app/scripts/s3.js @@ -40,40 +40,40 @@ const options = { ///////////// First, let's automatically create the bucket if it doesn't exist... ///////////// -var AWS = require('aws-sdk'); +var AWS = require("aws-sdk"); // Load credentials and set Region from JSON file -AWS.config.loadFromPath('./aws.json'); +AWS.config.loadFromPath("./aws.json"); // Create S3 service object -s3 = new AWS.S3({apiVersion: '2006-03-01'}); +s3 = new AWS.S3({ apiVersion: "2006-03-01" }); // Create params JSON for S3.createBucket var bucketParams = { - Bucket : BUCKETNAME, - ACL : 'public-read' + Bucket: BUCKETNAME, + ACL: "public-read", }; // Create params JSON for S3.setBucketWebsite var staticHostParams = { Bucket: BUCKETNAME, WebsiteConfiguration: { - ErrorDocument: { - Key: 'index.html' - }, - IndexDocument: { - Suffix: 'index.html' + ErrorDocument: { + Key: "index.html", + }, + IndexDocument: { + Suffix: "index.html", + }, }, - } }; // Call S3 to create the bucket -s3.createBucket(bucketParams, function(err, data) { +s3.createBucket(bucketParams, function (err, data) { if (err) { console.log("Error", err); } else { console.log("Bucket URL is ", data.Location); // Set the new policy on the newly created bucket - s3.putBucketWebsite(staticHostParams, function(err, data) { + s3.putBucketWebsite(staticHostParams, function (err, data) { if (err) { // Display error message console.log("Error", err); @@ -85,7 +85,6 @@ s3.createBucket(bucketParams, function(err, data) { /// After the bucket is created, we upload to it: /// s3FolderUpload(directoryName, credentials, options /* , invalidation */); - } }); } diff --git a/packages/react-app/src/App.jsx b/packages/react-app/src/App.jsx index cad9099..a7ef8d4 100644 --- a/packages/react-app/src/App.jsx +++ b/packages/react-app/src/App.jsx @@ -169,8 +169,6 @@ function App(props) { // keep track of a variable from the contract in the local React state: const purpose = useContractReader(readContracts, "YourContract", "purpose"); - const block = 4; - /* const addressFromENS = useResolveName(mainnetProvider, "austingriffith.eth"); console.log("🏷 Resolved austingriffith.eth as:",addressFromENS) diff --git a/packages/react-app/src/hooks/GasPrice.js b/packages/react-app/src/hooks/GasPrice.js index d4b7c7b..f7656c3 100644 --- a/packages/react-app/src/hooks/GasPrice.js +++ b/packages/react-app/src/hooks/GasPrice.js @@ -8,15 +8,15 @@ export default function useGasPrice(targetNetwork, speed) { if (targetNetwork.hasOwnProperty("gasPrice")) { setGasPrice(targetNetwork.gasPrice); } else { - axios - .get("https://ethgasstation.info/json/ethgasAPI.json") - .then(response => { - const newGasPrice = response.data[speed || "fast"] * 100000000; - if (newGasPrice !== gasPrice) { - setGasPrice(newGasPrice); - } - }) - .catch(error => console.log(error)); + axios + .get("https://ethgasstation.info/json/ethgasAPI.json") + .then(response => { + const newGasPrice = response.data[speed || "fast"] * 100000000; + if (newGasPrice !== gasPrice) { + setGasPrice(newGasPrice); + } + }) + .catch(error => console.log(error)); } }; diff --git a/packages/react-app/src/index.css b/packages/react-app/src/index.css index dc4c471..c195a2f 100644 --- a/packages/react-app/src/index.css +++ b/packages/react-app/src/index.css @@ -2,7 +2,6 @@ text-align: center; } - body { margin: 0; }