Skip to content

Update lint configs - #4

Merged
Mrtenz merged 5 commits into
mainfrom
mrtenz/metamask-code-style
Feb 29, 2024
Merged

Update lint configs#4
Mrtenz merged 5 commits into
mainfrom
mrtenz/metamask-code-style

Conversation

@Mrtenz

Copy link
Copy Markdown
Member

Blocked by #3.

This updates all files to match the MetaMask code style. I've updated the ESLint, Prettier, and TypeScript configs, and fixed all lint errors.

@MrtenzMrtenz changed the title Mrtenz/metamask code styleUpdate lint configsFeb 29, 2024
mcmire
mcmire previously approved these changes Feb 29, 2024

@mcmiremcmire left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Base automatically changed from mrtenz/yarn to mainFebruary 29, 2024 22:23
@Mrtenz
Mrtenz dismissed mcmire’s stale reviewFebruary 29, 2024 22:23

The base branch was changed.

@Mrtenz
Mrtenzforce-pushed the mrtenz/metamask-code-style branch from c5894e6 to 519adeaCompareFebruary 29, 2024 22:24
@Mrtenz
Mrtenz marked this pull request as ready for review February 29, 2024 22:24
@socket-security

socket-securityBot commented Feb 29, 2024

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

mcmire
mcmire previously requested changes Feb 29, 2024

@mcmiremcmire left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry, I didn't notice the CI failure.

Comment threadpackage.json
"validator"
],
"repository": "git://github.com/MetaMask/superstruct.git",
"type": "module",

@mcmiremcmireFeb 29, 2024

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we're no longer using ESM. Is that intentional? Should we stick with ESM in this PR and then remove it in another PR?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning to swap out Rollup for tsup using the same configs we use in the module template, which doesn't use type: module.

Comment threadtsconfig.json
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2020"],
"module": "CommonJS",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting an error from Rollup. It looks like module and moduleResolution need to remain as esnext, not CommonJS, at least in this PR.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to fix Rollup, but it seems like it's more effort than it's worth at this point since I'm planning to remove it in the next PR. Changing module and moduleResolution alone doesn't seem to fix it at least.

@mcmire
mcmire dismissed their stale reviewFebruary 29, 2024 22:35

We'll be removing Rollup later anyway.

@Mrtenz
Mrtenz merged commit 8fb18c6 into mainFeb 29, 2024
@Mrtenz
Mrtenz deleted the mrtenz/metamask-code-style branch February 29, 2024 22:40
@MrtenzMrtenz mentioned this pull request Mar 1, 2024
Mrtenz added a commit that referenced this pull request Mar 1, 2024
I made a few small mistakes in #4, causing the tests to break. This
fixes it.
Blocked by #5.
Comment threadpackage.json
"build": "rm -rf ./dist && rollup --config ./rollup.config.mjs",
"clean": "rm -rf ./{dist,node_modules}",
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog",
"lint:changelog": "auto-changelog validate --prettier",

@legobeatlegobeatMar 2, 2024

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm aware: #6 (comment)

Will fix this in a PR soon, and also update the changelog.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Mrtenz@mcmire@legobeat