linkedin / linkedin/css-blocks
Add custom linter for `for ... of` in preference to forEach with a local function.
- Dominant language
- TypeScript
- Stars
- 6.3k
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
I couldn't find a linter that would check for `forEach`.
You can use [this rule](https://palantir.github.io/tslint/rules/ban/) to ban methods with specific names, but it would ban `forEach` even when used with a predefined function (as opposed to a local function definition).
This is being filed because it was too complex to fit into https://github.com/css-blocks/css-blocks/pull/65
Contributor guide
Research direction
Review the requested distinction between forEach calls using predefined functions and local function definitions, then read the approach discussed in pull request 65. Identify the repository's linter entry point and any existing rule tests before defining the rule's exact matching cases; done means the custom rule prefers for...of without banning valid predefined-function uses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100