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

fix: Prefer no duplicate imports and no type imports #21

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

ChaituVR
Copy link
Member

@ChaituVR ChaituVR commented Jul 24, 2024

Context snapshot-labs/sx-monorepo#521 (comment)

Summary:

  • import/no-duplicates to not allow duplicate imports:
    import { CHAIN_IDS } from '@/helpers/constants';
    import { SUPPORTED_VOTING_TYPES } from '@/helpers/constants';
    will resolve to
      import { CHAIN_IDS, SUPPORTED_VOTING_TYPES } from '@/helpers/constants';
  • @typescript-eslint/consistent-type-imports' to not allow import type
    import type { OffchainNetworkConfig } from './types';
    will resolve to
     import { OffchainNetworkConfig } from './types';

How to test:

  • Go to any project, for example, in mono repo, edit package.json,
  • Under eslintConfig add config from this PR (add double quotes)
  • Try to add duplicate imports and imports with type keyword

TODO:

  • Run yarn release to update versions, before merging this PR

@ChaituVR ChaituVR requested review from wa0x6e and Sekhmet July 24, 2024 07:47
Copy link
Member

@Sekhmet Sekhmet left a comment

Choose a reason for hiding this comment

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

tACK

@ChaituVR ChaituVR merged commit 89bf7dc into master Jul 24, 2024
2 checks passed
@ChaituVR ChaituVR deleted the fix-duplicate-and-type-imports branch July 24, 2024 10:59
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