Commit 72294c70 authored by Liam Horne's avatar Liam Horne

style: update configuration to include babel-eslint for .js linting

parent b17cfbe0
This diff is collapsed.
module.exports = { module.exports = {
"extends": "../.eslintrc.js" extends: '../.eslintrc.js',
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"scripts": { "scripts": {
"lint": "yarn lint:fix && yarn lint:check", "lint": "yarn lint:fix && yarn lint:check",
"lint:fix": "yarn lint:check --fix", "lint:fix": "yarn lint:check --fix",
"lint:check": "eslint -c .eslintrc.js --ext .ts .", "lint:check": "eslint .",
"build:integration": "./scripts/build.sh", "build:integration": "./scripts/build.sh",
"build:contracts": "hardhat compile", "build:contracts": "hardhat compile",
"build:contracts:ovm": "hardhat compile --network optimism", "build:contracts:ovm": "hardhat compile --network optimism",
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"docker-compose": "^0.23.8", "docker-compose": "^0.23.8",
"envalid": "^7.1.0", "envalid": "^7.1.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
......
const { DockerComposeNetwork } = require("./shared/docker-compose") const { DockerComposeNetwork } = require('./shared/docker-compose')
before(async () => { before(async () => {
if (!process.env.NO_NETWORK) { if (!process.env.NO_NETWORK) {
......
module.exports = { module.exports = {
"extends": "../../.eslintrc.js" extends: '../../.eslintrc.js',
} }
#!/usr/bin/env node #!/usr/bin/env node
const batchSubmitter = require("../dist/src/exec/run-batch-submitter") const batchSubmitter = require('../dist/src/exec/run-batch-submitter')
batchSubmitter.run() batchSubmitter.run()
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"lint": "yarn lint:fix && yarn lint:check", "lint": "yarn lint:fix && yarn lint:check",
"pre-commit": "lint-staged", "pre-commit": "lint-staged",
"lint:fix": "yarn lint:check --fix", "lint:fix": "yarn lint:check --fix",
"lint:check": "eslint -c .eslintrc.js --ext .ts .", "lint:check": "eslint .",
"test": "hardhat test --show-stack-traces" "test": "hardhat test --show-stack-traces"
}, },
"keywords": [ "keywords": [
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
"@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0", "@typescript-eslint/parser": "^4.26.0",
"chai": "^4.2.0", "chai": "^4.2.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
......
module.exports = { module.exports = {
"extends": "../../.eslintrc.js" extends: '../../.eslintrc.js',
} }
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"all": "yarn clean && yarn build && yarn test && yarn lint:fix && yarn lint", "all": "yarn clean && yarn build && yarn test && yarn lint:fix && yarn lint",
"build": "tsc -p tsconfig.build.json", "build": "tsc -p tsconfig.build.json",
"clean": "rimraf dist/ ./tsconfig.build.tsbuildinfo", "clean": "rimraf dist/ ./tsconfig.build.tsbuildinfo",
"lint:check": "eslint -c .eslintrc.js --ext .ts .", "lint:check": "eslint .",
"lint:fix": "yarn lint:check --fix", "lint:fix": "yarn lint:check --fix",
"lint": "yarn lint:fix && yarn lint:check", "lint": "yarn lint:fix && yarn lint:check",
"pre-commit": "lint-staged", "pre-commit": "lint-staged",
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
"@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0", "@typescript-eslint/parser": "^4.26.0",
"chai": "^4.3.4", "chai": "^4.3.4",
"babel-eslint": "^10.1.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
......
...@@ -23,8 +23,8 @@ export class BaseService<T> { ...@@ -23,8 +23,8 @@ export class BaseService<T> {
protected options: T protected options: T
protected logger: Logger protected logger: Logger
protected metrics: Metrics protected metrics: Metrics
protected initialized: boolean = false protected initialized = false
protected running: boolean = false protected running = false
constructor( constructor(
name: string, name: string,
......
module.exports = { module.exports = {
"extends": "../../.eslintrc.js", extends: '../../.eslintrc.js',
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
}
} }
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
"test:slither": "slither .", "test:slither": "slither .",
"pretest:slither": "rm -f @openzeppelin && rm -f @ens && rm -f hardhat && ln -s ../../node_modules/@openzeppelin @openzeppelin && ln -s ../../node_modules/@ens @ens && ln -s ../../node_modules/hardhat hardhat", "pretest:slither": "rm -f @openzeppelin && rm -f @ens && rm -f hardhat && ln -s ../../node_modules/@openzeppelin @openzeppelin && ln -s ../../node_modules/@ens @ens && ln -s ../../node_modules/hardhat hardhat",
"posttest:slither": "rm -f @openzeppelin && rm -f @ens && rm -f hardhat", "posttest:slither": "rm -f @openzeppelin && rm -f @ens && rm -f hardhat",
"lint:check": "eslint -c .eslintrc.js --ext .ts . ", "lint:check": "eslint .",
"lint:fix": "eslint -c .eslintrc.js --ext .ts . --fix", "lint:fix": "yarn lint:check --fix",
"clean": "rm -rf ./dist ./artifacts ./artifacts-ovm ./cache ./cache-ovm ./tsconfig.build.tsbuildinfo", "clean": "rm -rf ./dist ./artifacts ./artifacts-ovm ./cache ./cache-ovm ./tsconfig.build.tsbuildinfo",
"deploy": "ts-node \"./bin/deploy.ts\" && yarn generate-markdown", "deploy": "ts-node \"./bin/deploy.ts\" && yarn generate-markdown",
"serve": "./bin/serve_dump.sh", "serve": "./bin/serve_dump.sh",
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
"copyfiles": "^2.3.0", "copyfiles": "^2.3.0",
"directory-tree": "^2.2.7", "directory-tree": "^2.2.7",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
......
...@@ -34,8 +34,8 @@ const argv = yargs(hideBin(process.argv)).argv ...@@ -34,8 +34,8 @@ const argv = yargs(hideBin(process.argv)).argv
for (const name of Object.keys(addresses)) { for (const name of Object.keys(addresses)) {
if (addresses[name] !== ethers.constants.AddressZero) { if (addresses[name] !== ethers.constants.AddressZero) {
table.push({ table.push({
name: name, name,
address: addresses[name] address: addresses[name],
}) })
} }
} }
......
...@@ -77,10 +77,10 @@ const networks = { ...@@ -77,10 +77,10 @@ const networks = {
proxiedContracts = [] proxiedContracts = []
for (let i = 0; i < contracts.length; i++) { for (let i = 0; i < contracts.length; i++) {
if (contracts[i] == 'OVM_L1CrossDomainMessenger') { if (contracts[i] === 'OVM_L1CrossDomainMessenger') {
proxiedContracts.push(contracts.splice(i, 1)[0]) proxiedContracts.push(contracts.splice(i, 1)[0])
} }
if (contracts[i] == 'OVM_L1ETHGateway') { if (contracts[i] === 'OVM_L1ETHGateway') {
proxiedContracts.push(contracts.splice(i, 1)[0]) proxiedContracts.push(contracts.splice(i, 1)[0])
} }
} }
......
...@@ -6,7 +6,7 @@ const { hideBin } = require('yargs/helpers') ...@@ -6,7 +6,7 @@ const { hideBin } = require('yargs/helpers')
const argv = yargs(hideBin(process.argv)).argv const argv = yargs(hideBin(process.argv)).argv
const nicknames = { const nicknames = {
'mockOVM_BondManager': 'OVM_BondManager' mockOVM_BondManager: 'OVM_BondManager',
} }
;(async () => { ;(async () => {
...@@ -27,9 +27,11 @@ const nicknames = { ...@@ -27,9 +27,11 @@ const nicknames = {
throw new Error(`unable to get a reference to Lib_AddressManager`) throw new Error(`unable to get a reference to Lib_AddressManager`)
} }
const contracts = dirtree(`./deployments/${argv.network}`).children.filter((child) => { const contracts = dirtree(`./deployments/${argv.network}`)
.children.filter((child) => {
return child.extension === '.json' return child.extension === '.json'
}).map((child) => { })
.map((child) => {
return child.name.replace('.json', '') return child.name.replace('.json', '')
}) })
...@@ -37,7 +39,9 @@ const nicknames = { ...@@ -37,7 +39,9 @@ const nicknames = {
const deployment = require(`../deployments/${argv.network}/${contract}.json`) const deployment = require(`../deployments/${argv.network}/${contract}.json`)
if (contract !== 'Lib_AddressManager') { if (contract !== 'Lib_AddressManager') {
const address = await Lib_AddressManager.getAddress(nicknames[contract] || contract) const address = await Lib_AddressManager.getAddress(
nicknames[contract] || contract
)
if (address !== deployment.address) { if (address !== deployment.address) {
console.log(`✖ ${contract} (ADDRESS MISMATCH DETECTED)`) console.log(`✖ ${contract} (ADDRESS MISMATCH DETECTED)`)
continue continue
......
module.exports = { module.exports = {
"extends": "../../.eslintrc.js" extends: '../../.eslintrc.js',
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"build": "tsc -p tsconfig.build.json", "build": "tsc -p tsconfig.build.json",
"clean": "rimraf dist/ ./tsconfig.build.tsbuildinfo", "clean": "rimraf dist/ ./tsconfig.build.tsbuildinfo",
"lint": "yarn lint:fix && yarn lint:check", "lint": "yarn lint:fix && yarn lint:check",
"lint:check": "eslint -c .eslintrc.js --ext .ts .", "lint:check": "eslint .",
"lint:fix": "yarn lint:check --fix", "lint:fix": "yarn lint:check --fix",
"pre-commit": "lint-staged", "pre-commit": "lint-staged",
"test": "ts-mocha test/**/*.spec.ts" "test": "ts-mocha test/**/*.spec.ts"
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
"@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0", "@typescript-eslint/parser": "^4.26.0",
"chai": "^4.3.0", "chai": "^4.3.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
......
...@@ -16,8 +16,8 @@ export interface WatcherOptions { ...@@ -16,8 +16,8 @@ export interface WatcherOptions {
export class Watcher { export class Watcher {
public l1: Layer public l1: Layer
public l2: Layer public l2: Layer
public pollInterval: number = 3000 public pollInterval = 3000
public NUM_BLOCKS_TO_FETCH: number = 10_000_000 public NUM_BLOCKS_TO_FETCH = 10_000_000
constructor(opts: WatcherOptions) { constructor(opts: WatcherOptions) {
this.l1 = opts.l1 this.l1 = opts.l1
...@@ -36,14 +36,14 @@ export class Watcher { ...@@ -36,14 +36,14 @@ export class Watcher {
public async getL1TransactionReceipt( public async getL1TransactionReceipt(
l2ToL1MsgHash: string, l2ToL1MsgHash: string,
pollForPending: boolean = true pollForPending = true
): Promise<TransactionReceipt> { ): Promise<TransactionReceipt> {
return this.getTransactionReceipt(this.l1, l2ToL1MsgHash, pollForPending) return this.getTransactionReceipt(this.l1, l2ToL1MsgHash, pollForPending)
} }
public async getL2TransactionReceipt( public async getL2TransactionReceipt(
l1ToL2MsgHash: string, l1ToL2MsgHash: string,
pollForPending: boolean = true pollForPending = true
): Promise<TransactionReceipt> { ): Promise<TransactionReceipt> {
return this.getTransactionReceipt(this.l2, l1ToL2MsgHash, pollForPending) return this.getTransactionReceipt(this.l2, l1ToL2MsgHash, pollForPending)
} }
...@@ -76,7 +76,7 @@ export class Watcher { ...@@ -76,7 +76,7 @@ export class Watcher {
public async getTransactionReceipt( public async getTransactionReceipt(
layer: Layer, layer: Layer,
msgHash: string, msgHash: string,
pollForPending: boolean = true pollForPending = true
): Promise<TransactionReceipt> { ): Promise<TransactionReceipt> {
let matches: ethers.providers.Log[] = [] let matches: ethers.providers.Log[] = []
......
module.exports = { module.exports = {
"extends": "../../.eslintrc.js" extends: '../../.eslintrc.js',
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"clean:db": "rimraf ./db", "clean:db": "rimraf ./db",
"lint": "yarn run lint:fix && yarn run lint:check", "lint": "yarn run lint:fix && yarn run lint:check",
"lint:fix": "yarn lint:check --fix", "lint:fix": "yarn lint:check --fix",
"lint:check": "eslint -c .eslintrc.js --ext .ts .", "lint:check": "eslint .",
"start": "ts-node ./src/services/run.ts", "start": "ts-node ./src/services/run.ts",
"start:local": "ts-node ./src/services/run.ts | pino-pretty", "start:local": "ts-node ./src/services/run.ts | pino-pretty",
"test": "hardhat --config test/config/hardhat.config.ts test", "test": "hardhat --config test/config/hardhat.config.ts test",
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
"@typescript-eslint/parser": "^4.26.0", "@typescript-eslint/parser": "^4.26.0",
"chai": "^4.3.4", "chai": "^4.3.4",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"babel-eslint": "^10.1.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
......
module.exports = { module.exports = {
"extends": "../../.eslintrc.js" extends: '../../.eslintrc.js',
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"lint": "yarn run lint:fix && yarn run lint:check", "lint": "yarn run lint:fix && yarn run lint:check",
"pre-commit": "lint-staged", "pre-commit": "lint-staged",
"lint:fix": "yarn lint:check --fix", "lint:fix": "yarn lint:check --fix",
"lint:check": "eslint -c .eslintrc.js --ext .ts ." "lint:check": "eslint ."
}, },
"dependencies": { "dependencies": {
"node-fetch": "^2.6.1" "node-fetch": "^2.6.1"
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
"@types/node-fetch": "^2.5.10", "@types/node-fetch": "^2.5.10",
"@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0", "@typescript-eslint/parser": "^4.26.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
......
module.exports = { module.exports = {
"extends": "../../.eslintrc.js" extends: '../../.eslintrc.js',
} }
#!/usr/bin/env node #!/usr/bin/env node
const main = require("../dist/exec/run").default const main = require('../dist/exec/run').default
;(async () => { ;(async () => {
await main() await main()
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"lint": "yarn lint:fix && yarn lint:check", "lint": "yarn lint:fix && yarn lint:check",
"pre-commit": "lint-staged", "pre-commit": "lint-staged",
"lint:fix": "yarn lint:check --fix", "lint:fix": "yarn lint:check --fix",
"lint:check": "eslint -c .eslintrc.js --ext .ts .", "lint:check": "eslint .",
"test": "hardhat test --show-stack-traces" "test": "hardhat test --show-stack-traces"
}, },
"keywords": [ "keywords": [
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
"hardhat": "^2.3.0", "hardhat": "^2.3.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mocha": "^8.4.0", "mocha": "^8.4.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
"lint-staged": "11.0.0", "lint-staged": "11.0.0",
"prettier": "^2.2.1", "prettier": "^2.2.1",
......
module.exports = { module.exports = {
"extends": "../../.eslintrc.js", extends: '../../.eslintrc.js',
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module"
}
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"lint": "yarn lint:fix && yarn lint:check", "lint": "yarn lint:fix && yarn lint:check",
"pre-commit": "lint-staged", "pre-commit": "lint-staged",
"lint:fix": "yarn lint:check --fix", "lint:fix": "yarn lint:check --fix",
"lint:check": "eslint -c .eslintrc.js --ext .ts .", "lint:check": "eslint .",
"clean": "rimraf ./artifacts ./cache ./dist ./tsconfig.build.tsbuildinfo" "clean": "rimraf ./artifacts ./cache ./dist ./tsconfig.build.tsbuildinfo"
}, },
"peerDependencies": { "peerDependencies": {
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
"@typescript-eslint/eslint-plugin": "^4.26.0", "@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0", "@typescript-eslint/parser": "^4.26.0",
"chai": "^4.3.0", "chai": "^4.3.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.27.0", "eslint": "^7.27.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment