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

🛠️ - Typescript rules against: enums & interfaces #12

Merged
merged 6 commits into from
Oct 4, 2023

Conversation

MaartenBruggink
Copy link
Member

@MaartenBruggink MaartenBruggink commented Oct 4, 2023

Added two Typescript specific eslint rules;

  • no-restricted-syntax - TSEnumDeclaration - Error when using Enums, let's push for as const since it's more declarative that it outputs JS.
  • @typescript-eslint/consistent-type-definitions - Error when using interfaces. The difference between interface and type is minimal and the one additional feature it supports we shouldn't use.

Set nvm version to v18

eslint/configs/typescript.js Outdated Show resolved Hide resolved
Copy link
Contributor

@PauloMFJ PauloMFJ left a comment

Choose a reason for hiding this comment

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

These two rules partially go against the grain on what this package was trying to be:

Extended ESLint Rules

The idea behind this config is to enforce consistency across all projects. We've tried to keep the rules as minimal as possible, and for the most part simply inherit from the recommended rules of the plugins we use. The main exceptions are when it comes to the following. Note: We've purposely only defined rules that are auto fixable, these rules should make it easier to write code, and not get in the way.

Can we update the README to reflect the changes too? Would be nice to also explain the reasoning there.

PauloMFJ
PauloMFJ previously approved these changes Oct 4, 2023
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
MaartenBruggink and others added 3 commits October 4, 2023 18:01
Co-authored-by: Paulo <mfjpaulo@gmail.com>
package.json Show resolved Hide resolved
@MaartenBruggink MaartenBruggink merged commit c5b5729 into main Oct 4, 2023
2 checks passed
@MaartenBruggink MaartenBruggink deleted the feature/typescript-rules branch October 4, 2023 16:45
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.

2 participants