Skip to content

Commit

Permalink
add some linting
Browse files Browse the repository at this point in the history
  • Loading branch information
capt-nemo429 committed Sep 18, 2022
1 parent 8a0a917 commit b940bc7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module.exports = {
"@vue/typescript/recommended",
"@vue/prettier"
],
globals: {
NodeJS: true
},
parserOptions: {
ecmaVersion: 2020
},
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
presets: ["@vue/cli-plugin-babel/preset"]
};
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { mapActions, mapState } from "vuex";
import { ACTIONS } from "./constants/store/actions";
import KyaModal from "./components/KYAModal.vue";
import { isPopup } from "./utils/browserApi";
import { MAINNET } from "./constants/ergo";
import WalletLogo from "./components/WalletLogo.vue";
function runSetInterval(callback: () => void, ms: number): NodeJS.Timer {
Expand Down Expand Up @@ -78,6 +77,8 @@ export default defineComponent({
if (isPopup()) {
return "max-w-365px";
}
return undefined;
}
},
methods: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/DropDown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default defineComponent({
},
calcPosition() {
const clientHeight = window.innerHeight || document.documentElement.clientHeight;
let el = this.$refs.its as HTMLElement;
const el = this.$refs.its as HTMLElement;
if (!el) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class TxSignError extends Error {
}

export class PasswordError extends Error {
constructor(errorMessage: string = "Wrong password.") {
constructor(errorMessage = "Wrong password.") {
super(errorMessage);
this.name = this.constructor.name;
}
Expand Down
8 changes: 4 additions & 4 deletions src/utils/globalFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export const filters = {
return new BigNumber(0);
}

let d = Math.ceil(Math.log10(num < 0 ? -num : num));
let power = n - d;
const d = Math.ceil(Math.log10(num < 0 ? -num : num));
const power = n - d;

let magnitude = Math.pow(10, power);
let shifted = Math.round(num * magnitude);
const magnitude = Math.pow(10, power);
const shifted = Math.round(num * magnitude);
return new BigNumber(shifted / magnitude);
},
walletType(type: WalletType): string {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/objectPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ObjectPool<ObjectType, KeyType> {
item.alive = true;
item.object = object;
} else {
const index = findIndex(this._pool, item => !item.alive);
const index = findIndex(this._pool, (item) => !item.alive);

if (index > -1) {
this._pool[index].object = object;
Expand Down Expand Up @@ -56,7 +56,7 @@ class ObjectPool<ObjectType, KeyType> {
}

public getPoolItem(key: KeyType): PoolItem<ObjectType, KeyType> | undefined {
return find(this._pool, item => item.key === key);
return find(this._pool, (item) => item.key === key);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/bigNumberHelper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe("bigNumber helpers", () => {
});

it("undecimalize numbers with various decimal places", () => {
let base = "1";
const base = "1";
for (let i = 0; i < 20; i++) {
base.padEnd(i, "0");
expect(undecimalize(new BigNumber(base), i).toString()).toEqual(
Expand Down

0 comments on commit b940bc7

Please sign in to comment.