-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: apply MetaMask eslint style into snap (#295)
* feat: add new cd workflow * feat: add code scan * chore: update code scan in duel process * chore: merge sonar scan in test workflow * chore: add token for scan * chore: restore report coverage from specific node version * fix: update secret * fix: missing node version on the cache key * chore: update dependency for ui and snap * fix: update yarn lock * fix: update yarn.lock * fix: remove unuse package in get-starknet * fix: remove metamask/rpc-methods * chore: remove metamask/rpc-methods * chore: add eslint config * fix: fix unit test and lint style * chore: update config * chore: update eslint style * chore: update operator in starknetutils * chore: update add erc20 token * fix: update yarn lock * chore: update yarn lock * chore: update yarn.lock * chore: update lint style for snap * chore: update eslint style for wallet ui * chore: update get-starknet eslint * chore: update ignore pattern for snap * chore: fix unit test of snap * chore: remove infura url * chore: update lint style * chore: update ui lint style * chore: add ApiParamsWithKeyDeriver type * fix: move error object into the 2nd args of logger.error * chore: remove readonly from private method * chore: force rpc api to use ApiParamsWithKeyDeriver if it has keyDeriver * fix: fix unit test after adding ApiParamsWithKeyDeriver
- Loading branch information
1 parent
b6f5879
commit 31f0f11
Showing
191 changed files
with
12,225 additions
and
8,306 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module.exports = { | ||
root: true, | ||
|
||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
|
||
extends: ['@metamask/eslint-config'], | ||
|
||
overrides: [ | ||
{ | ||
files: ['*.js'], | ||
extends: ['@metamask/eslint-config-nodejs'], | ||
}, | ||
|
||
{ | ||
files: ['*.ts', '*.tsx'], | ||
extends: ['@metamask/eslint-config-typescript'], | ||
}, | ||
|
||
{ | ||
files: ['*.test.ts', '*.test.js'], | ||
extends: ['@metamask/eslint-config-jest'], | ||
rules: { | ||
'@typescript-eslint/no-shadow': [ | ||
'error', | ||
{ allow: ['describe', 'expect', 'it'] }, | ||
], | ||
}, | ||
}, | ||
], | ||
|
||
ignorePatterns: [ | ||
'!.prettierrc.js', | ||
'**/!.eslintrc.js', | ||
'**/dist*/', | ||
'**/*__GENERATED__*', | ||
'**/build', | ||
'**/public', | ||
'**/.cache', | ||
'**/example', | ||
], | ||
}; |
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,11 +1,8 @@ | ||
// https://prettier.io/docs/en/options.html | ||
// All of these are defaults except singleQuote, but we specify them | ||
// for explicitness | ||
module.exports = { | ||
quoteProps: 'as-needed', | ||
singleQuote: true, | ||
printWidth: 120, | ||
tabWidth: 2, | ||
useTabs: false, | ||
semi: true, | ||
trailingComma: 'all', | ||
bracketSpacing: true, | ||
arrowParens: 'always', | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,2 @@ | ||
dist/ | ||
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,15 +1,42 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
}, | ||
extends: ['plugin:@typescript-eslint/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
extends: ['../../.eslintrc.js'], | ||
|
||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint'], | ||
rules: { | ||
tsconfigRootDir: __dirname, | ||
}, | ||
|
||
overrides: [ | ||
{ | ||
files: ['snap.config.ts'], | ||
extends: ['@metamask/eslint-config-nodejs'], | ||
}, | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
extends: ['@metamask/eslint-config-typescript'], | ||
rules: { | ||
'valid-jsdoc': 'off', | ||
'jsdoc/require-description': 'off', | ||
'jsdoc/require-returns': 'off', | ||
'jsdoc/require-param-description': 'off', | ||
'jsdoc/match-description': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.test.ts'], | ||
extends: ['@metamask/eslint-config-jest'], | ||
rules: { | ||
'@typescript-eslint/no-shadow': ['error', { allow: ['describe', 'expect', 'it'] }], | ||
'@typescript-eslint/unbound-method': 'off', | ||
}, | ||
}, | ||
|
||
{ | ||
files: ['*.ts'], | ||
rules: { | ||
'import/no-nodejs-modules': 'off', | ||
}, | ||
}, | ||
], | ||
|
||
ignorePatterns: ['!.eslintrc.js', 'dist/', '**/test', '.nyc_output/', 'coverage/'], | ||
}; |
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
This file was deleted.
Oops, something went wrong.
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
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
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.