benjamn / benjamn/recast

Infer options.useTabs when not specified

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

Description

It would be awesome if recast inferred `options.useTabs` from the file contents, just like it does with `options.tabWidth` right now.

Right now, in a tab-indented file with `useTabs` not set to true, newly injected statements will be space-indented (using, I believe, a 4-space tab width by default). It would be great if `useTabs` were inferred as being true for newly injected statements in that case.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the existing tabWidth inference in recast and identify where indentation for newly injected statements is selected. Check how file contents indicate tab indentation. Done means omitted options.useTabs follows the input file's indentation style, with coverage for tab-indented files.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.