Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Does not support .csslintrc? #73

Closed
leedorian opened this issue Jan 18, 2016 · 14 comments · Fixed by #79
Closed

Does not support .csslintrc? #73

leedorian opened this issue Jan 18, 2016 · 14 comments · Fixed by #79
Assignees
Labels

Comments

@leedorian
Copy link

Where to set the .csslintrc rules file?

@neilstuartcraig
Copy link

i'm very interested in this also - i tried in the project root but it doesn't seem to work. Does the plugin currently support csslintrc files?

Cheers

@Arcanemagus
Copy link
Member

We're simply executing csslint, if it's not configuring itself we can't really do anything about it.

That being said, since csslint development has finally started up again they may have fixed a bug relating to this recently? We are waiting on CSSLint/csslint#606 and CSSLint/csslint#605 before we can use the main repo again.

@Arcanemagus
Copy link
Member

Marking this as closed due to a complete lack of response. If you have any further information feel free to comment back!

@clamey
Copy link
Contributor

clamey commented Feb 10, 2016

Sorry - didn't know this was waiting on a reply. I don't think those bugs referenced are related to this. This is just csslint basic support for it's config file. The csslint docs say:

"The CSS Lint CLI always checks the current working directory to see if there is a .csslintrc file present."

And

"If no .csslintrc file is present in the current working directory, then only the command line arguments are used."

Usually the .csslintrc file is in the root of the project. So my guess is that Atom is exec'ing csslist not in the project root, so csslint isn't finding it's config file...

@Arcanemagus
Copy link
Member

Yet another instance of csslint doing things bizarrely 😛

csslint is executed in the directory of the file being edited, not the project root. A PR fixing this will be welcome! For now I'll re-open this.

@Arcanemagus
Copy link
Member

Published in v1.3.0.

@netsandbox
Copy link

The fix in #79 actually doesn't work for me on atom 1.5.3.

atom.project.relativizePath(filePath) returns a list where the first item is the project absolute path and the second item the file relative path.

If I change cwd = paths.projectPath to cwd = paths[0], the .csslintrc file in the project dir is used (not sure if this is the correct solution).

@Arcanemagus
Copy link
Member

Well the "correct" solution is for csslint to support configuration files in a sane manner, but as they can't even manage to support stdin input or outputting to JSON yet I have very low hopes for that...

I'll check on this and verify it, thanks for reporting back!

@clamey
Copy link
Contributor

clamey commented Feb 15, 2016

OK - I've submitted another PR with @cloos fix

On Mon, Feb 15, 2016 at 10:26 AM, Landon Abney [email protected]
wrote:

Reopened #73 #73.


Reply to this email directly or view it on GitHub
#73 (comment).

@Arcanemagus
Copy link
Member

v1.3.1 published, hopefully this does the trick for you, if not the specs need fixing 😉.

@matt328
Copy link

matt328 commented Mar 9, 2016

I think the specs need fixing, since it seems to be ignoring my csslintrc file no matter where I put it. Digging around inside the cli.js wrapper around csslint, I don't see how this will ever work, the version of that file that was installed with linter-csslint doesn't even contain logic to parse json. Is there any workaround to supply rules to csslint?

@Arcanemagus
Copy link
Member

Who said anything about JSON @matt328? That would make far too much sense for csslint 😛

The raw lines from the file found by getFullPath() are sent to processArguments().

As for the current directory where csslint will search for that file, it is determined here, which should be the project root of the file you are currently editing as Atom sees it. You can check the cwd by placing a breakpoint within Atom's developer tools. As for debugging csslint itself, you would need to put logging statements inside of it.

@matt328
Copy link

matt328 commented Mar 9, 2016

It seems there are two formats floating around for the csslintrc file. Many examples are a JSON format, so that's where I got confused. I just now was exploring the specs folder and found your example csslintrc file.

@Arcanemagus
Copy link
Member

It's possible those are from one of the many forks of csslint? It was abandoned for over 10 months and only very recently has development started back up again, it's quite possible one of the forks added JSON support for the config files.

I personally moved to stylelint long ago as it is a much better designed linter from the start (modeled similar to eslint, where almost everything can be a plugin vs. csslint where everything is built in... or not at all).

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

Successfully merging a pull request may close this issue.

7 participants