Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

certain formatters return \n when there are no errors #4244

Closed
alan-agius4 opened this issue Oct 23, 2018 · 3 comments
Closed

certain formatters return \n when there are no errors #4244

alan-agius4 opened this issue Oct 23, 2018 · 3 comments

Comments

@alan-agius4
Copy link
Contributor

alan-agius4 commented Oct 23, 2018

Bug Report

  • TSLint version: 5.11.x

Actual behavior

When using the API

Ex:

const Formatter = tslint.findFormatter('prose');
const formatter = new Formatter();
const output = formatter.format(result.failures, result.fixes);

Sometimes it will return \n when no having an failures, or the failures have been fixed. This applies almost to all formatters.

See: https://github.com/palantir/tslint/blob/master/src/formatters/proseFormatter.ts#L34 and
https://github.com/palantir/tslint/blob/master/src/formatters/proseFormatter.ts#L62

Expected behavior

I'd like that this return an empty string so we can test easily for a falsy value and don't emit anything to the console.

I'll happily do a PR to fix these issues, if you agree.

@JoshuaKGoldberg
Copy link
Contributor

Related: #3744, #3837.

Question before this should be considered ready for a PR: are there any uses where \n is the preferred output?

@JoshuaKGoldberg
Copy link
Contributor

☠️ TSLint's time has come! ☠️

TSLint is no longer accepting most feature requests per #4534. See typescript-eslint.io for the new, shiny way to lint your TypeScript code with ESLint. ✨

It was a pleasure open sourcing with you all!

@palantir palantir locked and limited conversation to collaborators Mar 20, 2020
@JoshuaKGoldberg
Copy link
Contributor

🤖 Beep boop! 👉 TSLint is deprecated 👈 (#4534) and you should switch to typescript-eslint! 🤖

🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants