Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypeScript and Jest config #3

Merged
merged 4 commits into from
Jan 21, 2020
Merged

Add TypeScript and Jest config #3

merged 4 commits into from
Jan 21, 2020

Conversation

whymarrh
Copy link
Contributor

This PR adds a ESLint config for TypeScript and Jest. These can be used by extending them in client projects:[1]

module.exports = {
   root: true,
   extends: [
     '@metamask/eslint-config',
     '@metamask/eslint-config/config/jest',
     '@metamask/eslint-config/config/typescript',
   ],
 };

You can see an example of this in action over at MetaMask/safe-event-emitter#1.

Important notes:

  1. I've simply inlined the MetaMask extension config as the default/base set of rules. In the future we can add all of the core ESLint rules there as the default set of rules (i.e. config/index.js) and disable what we need to. I've created (Explicitly set all of the core ESLint rules #1) to track that work.
  2. I've left out any and all TypeScript rules that require type information. I've left them out because they're "slow" and I don't quite know (yet) how they behave with a project that doesn't compile. I've created (Add settings for all of the TypeScript rules that require type information #2) to track the addition of those rules.

@whymarrh
Copy link
Contributor Author

@Gudahtt @rekmarks my hope here is that we:

  1. Publish the first version of the base config here and introduce that into the extension
  2. Agree that enabling all of the Jest and TypeScript rules is good 😅
  3. Continue to work (in separate PRs) to introduce Mocha/JSON/etc. configurations as appropriate

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

I love it.

To be clear, I have not reviewed the meaning of even 5% of the rules in this repo, but support this effort without reservation. I also agree with all of the points outline by @whymarrh where he tagged me.

config/jest.js Outdated Show resolved Hide resolved
config/typescript.js Outdated Show resolved Hide resolved
config/typescript.js Show resolved Hide resolved
config/typescript.js Outdated Show resolved Hide resolved
config/typescript.js Show resolved Hide resolved
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@whymarrh whymarrh merged commit 7820030 into master Jan 21, 2020
@whymarrh whymarrh deleted the typescript-config branch January 21, 2020 19:16
Sign up for free to 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.

None yet

3 participants