Skip to content

Commit 14169f6

Browse files
authored
Fix remaining lint issues (#3128)
1 parent 52f0d57 commit 14169f6

File tree

71 files changed

+129
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+129
-84
lines changed

eslint.config.mjs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ import typescript from '@metamask/eslint-config-typescript';
66

77
const config = createConfig([
88
{
9-
ignores: ['**/coverage', '**/dist', '**/docs', '**/public', '.yarn'],
9+
ignores: [
10+
'**/assembly',
11+
'**/coverage',
12+
'**/dist',
13+
'**/docs',
14+
'**/public',
15+
'.yarn',
16+
],
1017
},
1118

1219
// Base configuration
@@ -24,6 +31,30 @@ const config = createConfig([
2431
settings: {
2532
'import-x/extensions': ['.js', '.mjs'],
2633
},
34+
35+
rules: {
36+
// This allows `Promise.catch().finally()` to be used without a return
37+
// statement.
38+
// TODO: Upstream this change to `@metamask/eslint-config`.
39+
'promise/catch-or-return': [
40+
'error',
41+
{
42+
allowFinally: true,
43+
},
44+
],
45+
46+
// By default the `resolve` and `reject` parameters of a Promise are
47+
// expected to be named `resolve` and `reject`. This rule allows the
48+
// parameters to be named `resolveSomething` and `rejectSomething`.
49+
// TODO: Upstream this change to `@metamask/eslint-config`.
50+
'promise/param-names': [
51+
'error',
52+
{
53+
resolvePattern: '^_?resolve',
54+
rejectPattern: '^_?reject',
55+
},
56+
],
57+
},
2758
},
2859

2960
// TypeScript source files

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"lint:dependencies": "yarn workspaces foreach --all --parallel --verbose run lint:dependencies && yarn dedupe --check",
3030
"lint:eslint": "eslint . --cache",
3131
"lint:fix": "yarn workspaces foreach --all --parallel run lint:eslint --fix && yarn lint:misc --write && yarn lint:tsconfig && yarn constraints --fix && yarn dedupe",
32-
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn '**/*.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' '**/*.html'",
32+
"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn '**/*.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' '**/*.html'",
3333
"lint:tsconfig": "node scripts/verify-tsconfig.mjs",
3434
"prepare-preview-builds": "./scripts/prepare-preview-builds.sh",
3535
"publish-previews": "yarn workspaces foreach --all --parallel --verbose run publish:preview",

packages/create-snap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"lint:dependencies": "depcheck",
5050
"lint:eslint": "eslint . --cache",
5151
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
52-
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" --ignore-path ../../.gitignore",
52+
"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" --ignore-path ../../.gitignore",
5353
"publish:package": "../../scripts/publish-package.sh",
5454
"publish:preview": "yarn npm publish --tag preview",
5555
"since-latest-release": "../../scripts/since-latest-release.sh",

packages/examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"lint:dependencies": "depcheck",
3131
"lint:eslint": "eslint . --cache",
3232
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
33-
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!packages/**\" --ignore-path ../../.gitignore",
33+
"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!packages/**\" --ignore-path ../../.gitignore",
3434
"since-latest-release": "../../scripts/since-latest-release.sh",
3535
"start": "yarn workspaces foreach --worktree --parallel --verbose --interlaced --no-private --jobs unlimited run start",
3636
"start:test": "yarn start",

packages/examples/packages/bip32/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"lint:dependencies": "depcheck",
3434
"lint:eslint": "eslint . --cache",
3535
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
36-
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
36+
"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
3737
"publish:preview": "yarn npm publish --tag preview",
3838
"since-latest-release": "../../../../scripts/since-latest-release.sh",
3939
"start": "mm-snap watch",

packages/examples/packages/bip44/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"lint:dependencies": "depcheck",
3434
"lint:eslint": "eslint . --cache",
3535
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
36-
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
36+
"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
3737
"publish:preview": "yarn npm publish --tag preview",
3838
"since-latest-release": "../../../../scripts/since-latest-release.sh",
3939
"start": "mm-snap watch",

packages/examples/packages/browserify-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"lint:dependencies": "depcheck",
3434
"lint:eslint": "eslint . --cache",
3535
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
36-
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
36+
"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
3737
"publish:preview": "yarn npm publish --tag preview",
3838
"since-latest-release": "../../../../scripts/since-latest-release.sh",
3939
"test": "jest --reporters=jest-silent-reporter",

packages/examples/packages/browserify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"lint:dependencies": "depcheck",
3434
"lint:eslint": "eslint . --cache",
3535
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
36-
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
36+
"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
3737
"publish:preview": "yarn npm publish --tag preview",
3838
"since-latest-release": "../../../../scripts/since-latest-release.sh",
3939
"start": "mm-snap watch",

packages/examples/packages/client-status/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"lint:dependencies": "depcheck",
3434
"lint:eslint": "eslint . --cache",
3535
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
36-
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
36+
"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
3737
"publish:preview": "yarn npm publish --tag preview",
3838
"since-latest-release": "../../../../scripts/since-latest-release.sh",
3939
"start": "mm-snap watch",

packages/examples/packages/cronjobs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"lint:dependencies": "depcheck",
3434
"lint:eslint": "eslint . --cache",
3535
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
36-
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
36+
"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
3737
"publish:preview": "yarn npm publish --tag preview",
3838
"since-latest-release": "../../../../scripts/since-latest-release.sh",
3939
"start": "mm-snap watch",

0 commit comments

Comments
 (0)