Skip to content

Commit

Permalink
chore: linting (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev authored Jun 14, 2023
1 parent d3c1cd4 commit 212fae3
Show file tree
Hide file tree
Showing 6 changed files with 1,903 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.yarn
artifacts
cache
coverage
node_modules
typechain-types
47 changes: 47 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const path = require("path");

/**
* @type {import("eslint").Linter.Config}
*/
module.exports = {
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
extends: ["plugin:prettier/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 12,
},
plugins: [
"@typescript-eslint",
"prettier",
"simple-import-sort",
"sort-keys-fix",
"typescript-sort-keys",
],
rules: {
"@typescript-eslint/sort-type-union-intersection-members": "error",
camelcase: "off",
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
"sort-keys-fix/sort-keys-fix": "error",
"typescript-sort-keys/interface": "error",
"typescript-sort-keys/string-enum": "error",
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
},
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
},
typescript: {
project: path.join(__dirname, "tsconfig.json"),
},
},
},
};
5 changes: 0 additions & 5 deletions .npmignore

This file was deleted.

21 changes: 19 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,35 @@
"output": "npx ts-node scripts/output.ts",
"validate": "npx ts-node scripts/validate.ts",
"build": "rm -rf dist && tsc",
"lint:fix": "npx eslint . --ext .js,.ts --fix",
"lint": "npx eslint . --ext .js,.ts",
"prepublishOnly": "npm run build"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/node": "^20.2.0",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"ajv": "^8.12.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"eslint-plugin-typescript-sort-keys": "^2.3.0",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"dependencies": {
"dotenv": "^16.1.4"
}
}
},
"files": [
"dist",
"data"
]
}
8 changes: 4 additions & 4 deletions src/getHardhatConfigNetworks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from "dotenv";
import fs from "fs";
import path from "path";
import * as dotenv from "dotenv";

interface Config {
[key: string]: {
Expand Down Expand Up @@ -54,10 +54,10 @@ export const getHardhatConfigNetworks = (): Config => {
// used by @zetachain/addresses
export const chainNameById = (chainId: number): any => {
return {
7001: "athens",
97: "bsc-testnet",
5: "goerli",
1001: "klaytn-baobab",
5: "goerli",
7001: "athens",
80001: "polygon-mumbai",
97: "bsc-testnet",
}[chainId];
};
Loading

0 comments on commit 212fae3

Please sign in to comment.