-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the ESLint config to v8 (#65)
The ESLint config has been updated to v8. The lint scripts have been updated to match the MetaMask module template, and all lint errors have been fixed. The config wasn't updated to v9 because that would involve writing comments for everything. That can wait for a later PR, since all of those manual changes would be difficult to review when mixed in with these changes (which are mostly automatic fixes). Most of the manual lint fixes were pretty straightforward, but one notable case was the use of the bitwise OR operator. I saw that `| 0` was used in a few different places to truncate anything after the decimal point. `Math.floor` is now used instead, as it achieves the same effect and is easier to understand.
- Loading branch information
Showing
21 changed files
with
5,197 additions
and
13,527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
module.exports = { | ||
env: { | ||
es6: true, | ||
browser: true, | ||
}, | ||
extends: [ | ||
'@metamask/eslint-config', | ||
'@metamask/eslint-config/config/nodejs', | ||
root: true, | ||
|
||
extends: ['@metamask/eslint-config', '@metamask/eslint-config-nodejs'], | ||
|
||
overrides: [ | ||
{ | ||
files: ['./example/*.js', './index.js', './util.js'], | ||
globals: { | ||
Blob: true, | ||
document: true, | ||
window: true, | ||
}, | ||
}, | ||
], | ||
plugins: [ | ||
'json', | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
}, | ||
ignorePatterns: [ | ||
'!.eslintrc.js', | ||
'node_modules/', | ||
'bundle.js', | ||
], | ||
rules: { | ||
'no-bitwise': 'off', | ||
}, | ||
} | ||
|
||
ignorePatterns: ['!.eslintrc.js', '!.prettierrc.js', 'bundle.js'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
# Created by https://www.gitignore.io/api/osx,node | ||
# Optional eslint cache | ||
.eslintcache | ||
|
||
### OSX ### | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.