Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

config csslintrc path with command line #449

Closed
popomore opened this Issue Jan 11, 2014 · 19 comments

Comments

Projects
None yet

Is there any option in command line, I can use global .csslintrc.

Something like

csslint --config path/to/csslinrc

csslint automatically attempts to load command line flags from a .csslintrc file in the current working directory. No need to specify --config path/to/csslintrc.

https://github.com/stubbornella/csslint/wiki/Command-line-interface#configuration-files

See my .csslintrc for a working example.

I mean the global .csslintrc used by all project, not the working directory.

@popomore That's a neat idea, I like it.

If no .csslintrc file is found in the current directory, could csslint look up parent directories, until it gets to HOME (~) or root (/)? JSHint does this, and it's wonderful.

Year, that's good. 

Jshint also support --config that could place jshintrc to any other directory.

Sent from Mailbox for iPhone

On Fri, Jan 17, 2014 at 12:36 AM, apennebaker notifications@github.com
wrote:

@popomore That's a neat idea, I like it.

If no .csslintrc file is found in the current directory, could csslint look up parent directories, until it gets to HOME (~) or root (/)? JSHint does this, and it's wonderful.

Reply to this email directly or view it on GitHub:
stubbornella#449 (comment)

I was just going to open a ticket for that :-).

Considering a case where different css files are located in different folders, it would be logical to have a global .csslintrc file at the root of the project (similar to how it's done with a .jshintrc file).

That would require CSSLint to search not only in the current working directory, but also go up the directory tree to find the config file. As in JSHint:

In case of .jshintrc, JSHint will look for this file in the current working directory and, if not found, will move one level up the directory tree all the way up to the filesystem root.

http://www.jshint.com/docs/

Note that JSHint also supports a --config flag to point to the config file manually, which is what was requested by @popomore.

@alexilyaev alexilyaev referenced this issue in SublimeLinter/SublimeLinter-csslint Jan 22, 2014

Closed

Read configuration from .csslintrc file #1

Most linters start from the linted files's directory or the current working directory and traverse up to root. If the config file is not found, then they look in $HOME.

But in concert with this it's important to have a --config option in case the user wants to use some other location.

Maybe we should separate these into two different feature requests:

  • By default, look for and apply .csslintrc configuration in the current
    directory up to the user's home directory, or the root directory, whichever
    comes first.
  • Offer a command line option to manually specify a path to configuration.

On Wed, Jan 22, 2014 at 4:51 PM, Aparajita Fishman <notifications@github.com

wrote:

But in concert with this it's important to have a --config option in case
the user wants to use some other location.


Reply to this email directly or view it on GitHubhttps://github.com/stubbornella/csslint/issues/449#issuecomment-33072503
.

Cheers,

Andrew Pennebaker
apennebaker@42six.com

Any response?

blatyo commented Mar 4, 2014

I would love a --config option. My specific use case is that I'm bundling up a bunch of style checkers with their configuration into a gem which my company uses on it's projects. The configuration would be in the gem, which would not be in any parent directories or home.

@ghost

ghost commented Apr 2, 2014

Using sublime Text, I would like to be able to put a .csslintrc config in my project root, but that wont work with sublime-linter because it runs csslint from the directory of the document being linted. So if csslint could look back up along the document tree to my project root to find the config file, things would work much better with sublime-linter.
As people have already mentioned, this is the way jshint does it, and it works great with sublime-linter.

@nschonni nschonni added the CLI label Apr 3, 2014

Contributor

dmi3y commented Apr 13, 2014

Sublime css linter is the what exactly I struggled with. So came up with this. Although to have minimal invasion into original code cli has following (csslint flavored) format:
csslint --config=<path to config file> <css to lint>
Is that something appropriate people might be interested in? If so I'll wrap up unit tests and create PR.

@dmi3y dmi3y added a commit to dmi3y/csslint that referenced this issue Apr 16, 2014

@dmi3y dmi3y cli config path #449 517ffe4

@dmi3y dmi3y added a commit to dmi3y/csslint that referenced this issue Apr 20, 2014

@dmi3y dmi3y .csslitnrc lookup from cwd or basefolder #449+
cli folder reorganization to make things easier, unit tests for node,
manually tested for rhino and wsh.

there is no .csslintrc lookdown, ie. scoped options per one cli run
a2072b3

zxqfox commented May 15, 2014

Any chances to have this in npm? ;-(

@nschonni nschonni added this to the 0.11.0 milestone May 16, 2014

Member

nschonni commented May 16, 2014

Fixed in #502

@nschonni nschonni closed this May 16, 2014

@nschonni Thanks, any chance you could bump the npm version? It's been 9 months since the last bump.

@yujinakayama yujinakayama referenced this issue in yujinakayama/atom-lint Jun 4, 2014

Merged

Feature/csslint options #55

FREEZX commented Oct 24, 2014

new npm version please

@nschonni Hi, I see that the 0.11.0 milestone is Past due by 4 months.
May I suggest postponing the open tasks of that milestone to the next version and shipping 0.11.0?

I think that if we'll have shorter release cycles, there will be higher motivation for other to contribute to this project.
As it seems that features like this one, which were implemented long ago, get stuck forever for no reason.

When is 0.11.0 coming? This feature would be perfect for me. 👍

@XhmikosR XhmikosR modified the milestone: 0.11.0, 1.0.0 Jan 9, 2016

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