Skip to content

Provide node API for config conversion logic #729

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

Closed
JamesHenry opened this issue Oct 2, 2020 · 1 comment · Fixed by #732
Closed

Provide node API for config conversion logic #729

JamesHenry opened this issue Oct 2, 2020 · 1 comment · Fixed by #732
Assignees
Labels
area: node API Using tslint-to-eslint-config as an npm dependency status: accepting prs Please, send in a PR to resolve this! ✨ type: enhancement New feature or request
Milestone

Comments

@JamesHenry
Copy link
Member

🚀 Feature Request

Existing Behavior

The library can be leveraged via a CLI and interacts directly with disk.

Change Proposal

Provide the option of leveraging (part of) the library in code via a node API which would only focus on the config conversion process.

After discussing this with @JoshuaKGoldberg it seems we essentially want to expose (potentially after some tweaks) the convertLintConfig function:

export const convertLintConfig = async (

@JoshuaKGoldberg JoshuaKGoldberg added area: node API Using tslint-to-eslint-config as an npm dependency status: accepting prs Please, send in a PR to resolve this! ✨ type: enhancement New feature or request labels Oct 2, 2020
@JoshuaKGoldberg
Copy link
Member

Just posting notes from our chat: this is definitely doable and something we'd want to expose. There are actually quite a few pieces that go into converting to an output ESLint config:

  • Original TSLint rules, both as the raw tslint.json contents and the result of tslint --print-config
  • Original ESLint rules, if a config already exists (originalConfigurations.eslint)
  • TypeScript settings (tsconfig.json)
  • Node package contents (package.json)

Out of those, only the (reported?) tslint.json ones are really necessary. I don’t quite remember off the top of my head why both are there, but IIRC there was a reason. More investigation required 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: node API Using tslint-to-eslint-config as an npm dependency status: accepting prs Please, send in a PR to resolve this! ✨ type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants