Skip to content

Commit eb73e9f

Browse files
committed
add eslint; fix undeclared vars, run pre-commit on all files
1 parent 8b4ea18 commit eb73e9f

30 files changed

+4081
-764
lines changed

.eslintrc.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module.exports = {
2+
env: {
3+
commonjs: true,
4+
es6: true,
5+
node: true,
6+
},
7+
plugins: ['prettier'],
8+
extends: [
9+
'eslint:recommended',
10+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
11+
],
12+
parserOptions: {
13+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
14+
sourceType: 'module', // Allows for the use of imports
15+
},
16+
rules: {
17+
'prettier/prettier': 'error',
18+
'no-unused-vars': 'warn',
19+
'prefer-const': [2, { destructuring: 'all' }],
20+
'object-curly-spacing': ['error', 'always'],
21+
},
22+
overrides: [
23+
{
24+
files: ['*.ts', '*.tsx'],
25+
parser: '@typescript-eslint/parser',
26+
extends: [
27+
'eslint:recommended',
28+
'plugin:@typescript-eslint/recommended',
29+
'prettier/@typescript-eslint',
30+
'plugin:prettier/recommended',
31+
],
32+
plugins: ['@typescript-eslint', 'prettier'],
33+
rules: {
34+
'no-empty-pattern': 'warn',
35+
'prettier/prettier': ['error', { singleQuote: true }],
36+
'@typescript-eslint/member-delimiter-style': ['off'],
37+
'@typescript-eslint/no-explicit-any': ['warn'],
38+
'@typescript-eslint/no-use-before-define': ['off'],
39+
'@typescript-eslint/no-non-null-assertion': ['off'],
40+
'@typescript-eslint/ban-ts-comment': ['warn'],
41+
},
42+
},
43+
],
44+
}

.prettierrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
semi: false,
3+
trailingComma: 'es5',
4+
singleQuote: true,
5+
printWidth: 80,
6+
tabWidth: 2,
7+
arrowParens: 'avoid',
8+
bracketSpacing: true,
9+
overrides: [
10+
{
11+
files: '*.sol',
12+
options: {
13+
printWidth: 100,
14+
tabWidth: 4,
15+
useTabs: false,
16+
singleQuote: false,
17+
bracketSpacing: true,
18+
explicitTypes: 'always',
19+
},
20+
},
21+
],
22+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ yarn install
1212

1313
## What's included?
1414

15-
:white_check_mark: Cross chain Greeter contract
15+
:white_check_mark: Cross chain Greeter contract
1616
:white_check_mark: Hardhat configured to Arbitrum's latest testnet
1717
:white_check_mark: Solidity interfaces for the Inbox and ArbSys
18-
:white_check_mark: `arb-ts` Typescript tooling for cross-layer interactions
18+
:white_check_mark: `arb-ts` Typescript tooling for cross-layer interactions

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919
"packages/token_deposit",
2020
"packages/token_withdraw",
2121
"packages/demo-dapp-pet-shop"
22-
2322
]
2423
},
2524
"scripts": {
2625
"compile:greeter": "yarn workspace greeter build",
2726
"compile:eth_deposit": "yarn workspace eth_deposit build",
2827
"compile:eth_withdraw": "yarn workspace eth_withdraw build"
29-
3028
}
3129
}

packages/arb-shared-dependencies/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
"devDependencies": {
99
"@nomiclabs/hardhat-ethers": "^2.0.2",
1010
"arb-ts": "0.0.9",
11+
"eslint": "^7.30.0",
1112
"ethers": "^5.1.2",
12-
"hardhat": "^2.2.0"
13+
"hardhat": "^2.2.0",
14+
"prettier": "^2.3.2"
1315
},
1416
"dependencies": {
15-
"dotenv": "^8.2.0"
17+
"dotenv": "^8.2.0",
18+
"eslint-plugin-prettier": "^3.4.0"
1619
}
1720
}
18-
19-
20-
21-

0 commit comments

Comments
 (0)