Giter Site home page Giter Site logo

.jscsignore about node-jscs HOT 51 CLOSED

jscs-dev avatar jscs-dev commented on September 25, 2024 1
.jscsignore

from node-jscs.

Comments (51)

mdevils avatar mdevils commented on September 25, 2024

Please, explain this issue.

from node-jscs.

qfox avatar qfox commented on September 25, 2024

Possibility to create separate file with ignored files and paths to put all of them to .jscsignore.
I think it's the same as excludeFiles

from node-jscs.

qfox avatar qfox commented on September 25, 2024

@mdevils sorry. Maybe I'm wrong and there is no reason to split it to a separate file. But at the moment we can't provide some additional options, or decline some of commons, for concrete inner directory.

For example, in my cwd I have .jscs.json n.1, but some path in the tree shouldn't be checked because of some reasons. I'm putting there .jscs.json n.2 and nothing happens. ;-)
But it's another issue.

from node-jscs.

mdevils avatar mdevils commented on September 25, 2024

Have you seen excludeFiles option?

from node-jscs.

mdevils avatar mdevils commented on September 25, 2024

Can't get why excludeFiles is not enough.

from node-jscs.

qfox avatar qfox commented on September 25, 2024

@mdevils I want to put ignores to inner directory.

/
  .jscs.json
  vendor/
    .jscsignore
    something-dirty.js
  ...

from node-jscs.

ShimShamSam avatar ShimShamSam commented on September 25, 2024

I'm not sure why this was closed. Not only does it solve the use-case presented by @zxqfox, but it is also more in line with other files like .gitignore and .jshintignore

from node-jscs.

mikesherov avatar mikesherov commented on September 25, 2024

@zxqfox, the original poster, closed it after seeing that excludeFiles matched his use case.

from node-jscs.

qfox avatar qfox commented on September 25, 2024

;-D yep. I couldn't find a reason to make additional file excluding mechanisms.

@Knotix what's your case?

from node-jscs.

qfox avatar qfox commented on September 25, 2024

@mikesherov I'm thinking about using .jshintignore files. jscs requires valid js-code and usually executes after jshint. So... If some files doesn't checked by jshint because of .jshintignore, jscs will fail. What you think about it?

from node-jscs.

ShimShamSam avatar ShimShamSam commented on September 25, 2024

I really just prefer it for consistency. It would match Git's and JSHint's method of ignoring files.

from node-jscs.

andrewdeandrade avatar andrewdeandrade commented on September 25, 2024

Turns out I have a use case for wanting .jscsignore files.

We're trying to write a node_module for our entire organization that encapsulates all our linting rules so every new projects can just npm install our linting module. This means that we are running jscs with the config option pointing to either a .jscsrc file in node_modules/ folder or calling it on a symlink from the project root to the universal .jscsrc file in the node_modules/ folder. This presents two problems:

(1) the excludeFiles array is calculated relative to the path where the .jscsrc file is located.
(2) no ability for a project owner to ignore files on a project by project basis.

FWIW this module makes it really easy to implement ignore files: https://www.npmjs.org/package/fstream-ignore

from node-jscs.

selfcontained avatar selfcontained commented on September 25, 2024

Just adding another voice to the mix in support of a .jsrcignore file, and restating what @malandrew mentions. One of the benefits from supporting an optional ignore file in addition to your config file, like jshint does, is that you can share the same style enforcements across projects, but allow for things like project specific ignore files to be handled in the project.

from node-jscs.

indexzero avatar indexzero commented on September 25, 2024

Adding a +1 for a separate .jscsignore file for the same reason.

from node-jscs.

mikesherov avatar mikesherov commented on September 25, 2024

OK, I'm reopening this considering sufficient user demand and use case. /cc @mdevils @indexzero if you want to take a crack at it... by all means!

from node-jscs.

qfox avatar qfox commented on September 25, 2024

Any ideas how to load this file and merge with excludeFiles option?

from node-jscs.

mikesherov avatar mikesherov commented on September 25, 2024

I'm not really sure. In an ideal world, we'd deprecate excludeFiles in the config and remove in 2.0. Thoughts, @mdevils?

from node-jscs.

qfox avatar qfox commented on September 25, 2024

It looks like some excluding container (object) that can be copied and extended (or replaced) with inner (by fs tree) .jscsignore files, it also should load these files on walking, and it will be used instead of (or with) global excludedFiles.

It's also very close to inner configurations.

btw. Should we use .jshintignore files at the same time with .jscsignore? Just I think it's the same list just because code should be valid. But it can broke jsx and custom esprima parsers so we need to think about it. Maybe just an option in .jscsrc which files JSCS should use as ignore-files?

from node-jscs.

yutin1987 avatar yutin1987 commented on September 25, 2024

{excludedFiles: '.jshintignore'} is a good idea.

from node-jscs.

mikesherov avatar mikesherov commented on September 25, 2024

@zxqfox would you like to tackle this for 1.12?

from node-jscs.

qfox avatar qfox commented on September 25, 2024

@mikesherov yep. I'll do it ;-)

@mdevils Please take a look here, really want to know your thoughts.

from node-jscs.

masi avatar masi commented on September 25, 2024

I think support for .jscsignore is fine, but even better would be if I can name a ignore file. Either in the config or as CLI parameter. Then I could do:

jshint --exclude-path=myjsignore
jscs --exclude-path=myjsignore

a simple myjsignore could look like this:

*_/min.js
*
/minified.js
*
/_packed.js

from node-jscs.

qfox avatar qfox commented on September 25, 2024

@masi Yup. But if you gonna use .jshintignore or .gitignore as .jscsignore you can get troubles with different formats.

Anyone against --excludes-file option name?

from node-jscs.

mikesherov avatar mikesherov commented on September 25, 2024

Yes, I'm against it for now. A symlink can be created at the os level to achieve the same goal without have to add another option to jscs.

from node-jscs.

qfox avatar qfox commented on September 25, 2024

@mikesherov I'm agree in common, but e.g. git on windows doesn't support symlinks.

from node-jscs.

masi avatar masi commented on September 25, 2024

Different formats would indeed be troublesome. In my personal ideal world - :) - jshint and jscs are using the same format as git. But I'm fine with a shared format amongst the JS utilities.

from node-jscs.

qfox avatar qfox commented on September 25, 2024

@masi In ideal world — yes. I'm gonna use and suggest for jshint ignore package. Guys at jshint also going to a .gitignore format (jshint/jshint#1917 and jshint/jshint#1758 (comment)) so I think it's a right way.

Thoughts?

from node-jscs.

mrjoelkemp avatar mrjoelkemp commented on September 25, 2024

What's the status on this? I'm tempted to close it as orphaned unless there's a strong objection.

from node-jscs.

qfox avatar qfox commented on September 25, 2024

Waiting for #1150 to finish this.
Also there is #1159 — I think we should change this logic in 2.0.

from node-jscs.

mikesherov avatar mikesherov commented on September 25, 2024

I still very much want this.

from node-jscs.

mdevils avatar mdevils commented on September 25, 2024

I feel OK deprecating exludeFiles and implementing jshintignore/gitignore-compatible .jscsignore file.

from node-jscs.

jwhitmarsh avatar jwhitmarsh commented on September 25, 2024

👍

from node-jscs.

iamstarkov avatar iamstarkov commented on September 25, 2024

👍

from node-jscs.

shawn-simon avatar shawn-simon commented on September 25, 2024

How is there no option to specify an ignore file...

from node-jscs.

mikesherov avatar mikesherov commented on September 25, 2024

@shawn-simon there is. It's called the excludeFiles option. This ticket is to move to a separate ignore file from the current mechanism.

from node-jscs.

shawn-simon avatar shawn-simon commented on September 25, 2024

That's not a file, it's json. I would like to have all of the ignores in one place, since I'm using jshint as well. Also, for some reason excludeFiles is fired in relation to your current working directory, not the config file. At least it works though!

from node-jscs.

markelog avatar markelog commented on September 25, 2024

If anyone would help us with this ticket, it would be great

from node-jscs.

jwhitmarsh avatar jwhitmarsh commented on September 25, 2024

I'd be interested in helping out with this.

from node-jscs.

mrjoelkemp avatar mrjoelkemp commented on September 25, 2024

One idea for tackling this is to use the newline delimited contents of the jscsignore to populate the excludeFiles configuration array internally.

from node-jscs.

mrjoelkemp avatar mrjoelkemp commented on September 25, 2024

@jwhitmarsh friendly ping. Any progress on this?

from node-jscs.

ronkorving avatar ronkorving commented on September 25, 2024

Would love this too!

from node-jscs.

adamreisnz avatar adamreisnz commented on September 25, 2024

Was reading this and seeing how it was raised in 2013, really hoping that it would be in by now. Either a .jscsignore or to specify a path to the ignore file to use, so that .jshintignore can be recycled. Anyway, +1 from me for consistency with other libraries/tools. Might give it a crack myself later if I have some time.

from node-jscs.

andrewdeandrade avatar andrewdeandrade commented on September 25, 2024

FWIW, I'm no longer +1 on this. I've completely switched over to eslint since it pretty much meets all the needs that jscs used to address.

from node-jscs.

adamreisnz avatar adamreisnz commented on September 25, 2024

@malandrew Thanks for the info. I will look into it as well.

from node-jscs.

indexzero avatar indexzero commented on September 25, 2024

@malandrew that passive aggressive behavior is not welcome here. @adambuczynski would love your contributions if you have time. The biggest win that jscs has over eslint is that the autofix support is much more robust right now.

At GoDaddy we use both eslint and jscs together. eslint strictly for linting and jscs strictly for style. It is a very nice separation that I would recommend adopting.

I am still very much +1 on this as it bit me recently.

from node-jscs.

indexzero avatar indexzero commented on September 25, 2024

I put a $200 bounty on this issue. Lets do this folks!

from node-jscs.

adamreisnz avatar adamreisnz commented on September 25, 2024

I used to think that it's a good thing to have them separate, but I'm not sure anymore. Especially since I find myself just merging the results of jshint and jscs in my gulp tasks anyway. I haven't yet tried the autofix feature, because I'm a bit paranoid about software making coding decisions for me, but if it's only style then perhaps I should give it a go.

from node-jscs.

indexzero avatar indexzero commented on September 25, 2024

@adambuczynski exactly. I personally really only want autofix for style. Anything else does make me a little nervous.

from node-jscs.

dsebastien avatar dsebastien commented on September 25, 2024

+1

from node-jscs.

nescalante avatar nescalante commented on September 25, 2024

+1, any updates on this one? seems to be backed on bountysource

from node-jscs.

markelog avatar markelog commented on September 25, 2024

At this point only major and CST related bugs will be fixed

from node-jscs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.