Skip to content

Exported lint rule types for Node APIs #816

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

Merged
merged 3 commits into from
Nov 8, 2020
Merged

Exported lint rule types for Node APIs #816

merged 3 commits into from
Nov 8, 2020

Conversation

JoshuaKGoldberg
Copy link
Member

PR Checklist

Overview

Adds comments to and exports all the types in src/lintConfigs/types.ts referring to raw and reported lint rule configurations/options.

@JamesHenry
Copy link
Member

Thanks! It's sort of tangential - but those objects represented by the TSLintRuleOptions interface are only available in TSLint via the CLI right (--print-config), there isn't an equivalent function or set of functions that can be called by importing them from 'tslint'?

Reason being, right now I am having to jump through some hoops in tests for the schematic because of the need to invoke that CLI within the implementation details, would be nice if there was a printConfig() util available!

@JoshuaKGoldberg
Copy link
Member Author

Hmm, good question. In theory it should be possible to export printConfiguration or something up the chain from it: https://github.com/palantir/tslint/blob/bfaf3e2e237f67e2eb6b28eab00e109a68602716/src/runner.ts#L179

...though there's nothing I can find in the current versions of TSLint that folks are using now 😞 .

@JoshuaKGoldberg JoshuaKGoldberg merged commit a250fad into main Nov 8, 2020
@JoshuaKGoldberg JoshuaKGoldberg deleted the lint-types branch November 8, 2020 17:34
@JamesHenry
Copy link
Member

Yeah I tried to trace it through at the time as well, and concluded it was non-trivial to expose it in a programmatic way. All good I've got unit tests working fine in that PR thanks to some jest mocking so it's not worth the hassle of taking it any further I don't think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for reviewer Waiting for a maintainer to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separately export (E|T)TSLintRuleOptions, (E|T)SLintRuleSeverity
2 participants