benjamn / benjamn/recast

Add a semicolon to ReturnStatement

Open
#718 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.3k
Forks
363
Avg merge
3d 8h
Merged PRs (30d)
3

Description

Because I used eslint rules
`
"rules": {
"semi": [1, "never"]
}
`

'return do something' is printed as 'return do something ;'

I have found it https://github.com/benjamn/recast/blob/master/lib/printer.ts#L643

`
"parts.push(";");"
`

Would you add optional ?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at lib/printer.ts around line 643, where ReturnStatement output adds a semicolon. Review nearby printer behavior and available options, then determine how an optional semicolon setting should affect this output. Done means return statements can be printed without a semicolon for the reported eslint semi-never case.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.