MetaMask / MetaMask/eslint-config

(TypeScript) Enforce source order

Open
#281 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12
Forks
21
PR merge metrics
No merged PRs in 30d

Description

To make files look the same, we should enforce the following order:

1. Types
2. Enums
3. Constants
4. Functions

In test files, the order should look like this:

1. Module mocks (using `jest.mock`)
2. Typed module mocks (using `jest.mocked`)
3. Types
4. Enums
5. Constants
6. Tests
7. Functions

In some cases, a file may be so long that the author may wish to locate a type next to the place in which it's used, such as options for a function. Instead of doing this, this should act as a code smell and should indicate that we ought to move the function along with its type to a separate file.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Start by locating the TypeScript rules in this shareable ESLint config and compare current ordering behavior with the requested production and test-file sequences. Done means linting enforces both sequences, including jest.mock and jest.mocked ordering, with exceptions resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.