Skip to content

Commit

Permalink
Update lint dependencies and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Jun 25, 2021
1 parent f0e5c17 commit 178a9b5
Show file tree
Hide file tree
Showing 9 changed files with 920 additions and 644 deletions.
41 changes: 20 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
module.exports = {
root: true,

env: {
'browser': true,
},
parserOptions: {
'ecmaVersion': 2018,
browser: true,
},

globals: {
'ethereum': 'readonly',
ethereum: 'readonly',
},
plugins: [
'json',
],
extends: [
'@metamask/eslint-config',
'@metamask/eslint-config/config/nodejs',
],
overrides: [{
'files': ['src/*.js'],
'parserOptions': {
'sourceType': 'module',

extends: ['@metamask/eslint-config', '@metamask/eslint-config-nodejs'],

overrides: [
{
files: ['src/*.js'],
parserOptions: {
sourceType: 'module',
},
rules: {
camelcase: ['error'],
},
},
}],
ignorePatterns: [
'!.eslintrc.js',
'dist',
],
}

ignorePatterns: ['!.eslintrc.js', 'dist'],
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ package-lock.json
node_modules
.vscode
dist
.eslintcache
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// All of these are defaults except singleQuote, but we specify them
// for explicitness
module.exports = {
quoteProps: 'as-needed',
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
};
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ This means that appearances can be misleading.
For example, consider this old bug:

```html
<button class="btn btn-primary btn-lg btn-block mb-3" id="approveTokensWithoutGas" disabled>Approve Tokens
Without Gas</button>
<button
class="btn btn-primary btn-lg btn-block mb-3"
id="approveTokensWithoutGas"
disabled
>
Approve Tokens Without Gas
</button>
```

This appears on the page as `Approve Tokens Without Gas`. In reality, the value included the whitespace on the second line, and caused XPath queries for the intended value to fail.
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
"scripts": {
"setup": "yarn install && yarn allow-scripts",
"deploy": "./deploy.sh",
"lint": "eslint . --ext js,json && prettier ./src -c",
"lint:fix": "eslint . --fix --ext js,json && prettier ./src -c --write",
"lint:eslint": "eslint . --cache --ext js,ts",
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' --ignore-path .gitignore",
"lint": "yarn lint:eslint && yarn lint:misc --check",
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
"start": "webpack-dev-server",
"build": "webpack --mode production",
"test": "yarn lint",
Expand All @@ -34,19 +36,21 @@
"dependencies": {},
"devDependencies": {
"@lavamoat/allow-scripts": "^1.0.6",
"@metamask/eslint-config": "^4.0.0",
"@metamask/eslint-config": "^6.0.0",
"@metamask/eslint-config-nodejs": "^6.0.0",
"@metamask/onboarding": "^1.0.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^6.0.2",
"eslint": "^7.7.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-json": "^2.0.1",
"eslint": "^7.29.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eth-sig-util": "^2.5.3",
"ethereumjs-util": "^5.1.1",
"ethers": "^5.0.32",
"gh-pages": "^3.1.0",
"prettier": "^2.0.5",
"prettier": "^2.3.1",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.2"
Expand Down
Loading

0 comments on commit 178a9b5

Please sign in to comment.