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

Linter should throw if passed a string configuration #1167

Closed
JoshuaKGoldberg opened this issue Apr 25, 2016 · 2 comments
Closed

Linter should throw if passed a string configuration #1167

JoshuaKGoldberg opened this issue Apr 25, 2016 · 2 comments

Comments

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Apr 25, 2016

Feature request

Repro

I did a silly and forgot to call JSON.parse on the value being passed to Linter.

// wrong
let linter = new Linter("file.ts", "...", "{ \"rules\": ... } ");
// correct
let linter = new Linter('file.ts", "...", { rules: ... });

Actual behavior

It ran without error, but reported 0 lint failures.

Expected behavior

It should have blown up and told me I'm an idiot for passing an invalid tslint.json equivalent.

:(

(I'll send a PR for this unless directed otherwise)

@jkillian
Copy link
Contributor

Seems like a good change to make to me 👍

@JoshuaKGoldberg
Copy link
Contributor Author

🎆

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

3 participants