Support JSON for .csslintrc files. #457

Merged
merged 1 commit into from Feb 27, 2014

8 participants

@scottgonzalez

@stubbornella requested a PR for this 2 days ago. I provided this change 11 months ago, so it may be stale. I honestly haven't tested since then. Hopefully someone else involved in the discussion (@tkellen, @cowboy, @jzaefferer) can check if this still works and how it'd integrate with grunt-contrib-csslint.

@nschonni
CSSLint member

👍 my only concern is whether this will break the WSH version (but maybe that should be dropped anyway)

@nschonni nschonni commented on an outdated diff Feb 24, 2014
src/cli/common.js
if (data) {
+ if (data.charAt(0) === "{") {
+ try {
+ json = JSON.parse(data);
+ data = "";
+ for (var optionName in json) {
+ data += "--" + optionName + "=" + json[optionName].join();
@nschonni
CSSLint member
nschonni added a line comment Feb 24, 2014

Needs hasOwnProperty guard to make JSHint happy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@scottgonzalez

Updated to use hasOwnProperty.

@stubbornella

Can someone test the WSH version? Or any strong feelings about keeping that functionality?

@stubbornella stubbornella merged commit f2abc8b into CSSLint:master Feb 27, 2014

1 check passed

Details default The Travis CI build passed
@joshuaspence

This is great. Can the version number be bumped so that this change is accessible from npm?

@jmeas

👍

@llaumgui
This is great. Can the version number be bumped so that this change is accessible from npm?

+1 to build a RPM for EL and Fedora

@dmi3y

should not be .join(',') ?

That's what .join() does.

Thank you!

@jzaefferer

@nschonni can you look into publishing a new version? Looks like you can tag and publish on npm. Last release was August 2013, with 81 commits to master since then...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment