Skip to content

Commit

Permalink
Update lint configs (#4)
Browse files Browse the repository at this point in the history
This updates all files to match the MetaMask code style. I've updated
the ESLint, Prettier, and TypeScript configs, and fixed all lint errors.
  • Loading branch information
Mrtenz authored Feb 29, 2024
1 parent 3c9d6b0 commit 8fb18c6
Show file tree
Hide file tree
Showing 269 changed files with 4,096 additions and 3,512 deletions.
12 changes: 12 additions & 0 deletions .depcheckrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ignores": [
"@lavamoat/allow-scripts",
"@lavamoat/preinstall-always-fail",
"@metamask/auto-changelog",
"@types/*",
"prettier-plugin-packagejson",
"superstruct",
"ts-node",
"typedoc"
]
}
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80
117 changes: 0 additions & 117 deletions .eslintrc

This file was deleted.

45 changes: 45 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = {
root: true,

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

overrides: [
{
files: ['*.ts'],
extends: ['@metamask/eslint-config-typescript'],
},

{
files: ['*.js'],
parserOptions: {
sourceType: 'script',
},
extends: ['@metamask/eslint-config-nodejs'],
},

{
files: ['*.test.ts', '*.test.js'],
extends: [
'@metamask/eslint-config-jest',
'@metamask/eslint-config-nodejs',
],
rules: {
'@typescript-eslint/no-shadow': [
'error',
{
allow: ['describe', 'it'],
},
],
},
},
],

ignorePatterns: [
'!.eslintrc.js',
'!.prettierrc.js',
'dist/',
'docs/',
'.yarn/',
'examples/',
],
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ npm-debug.log
package-lock.json
tmp/

# Optional eslint cache
.eslintcache

# yarn v3 (w/o zero-install)
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
Expand Down
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc

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',
};
Loading

0 comments on commit 8fb18c6

Please sign in to comment.