Comments (51)
Please, explain this issue.
from node-jscs.
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.
@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.
Have you seen excludeFiles
option?
from node-jscs.
Can't get why excludeFiles
is not enough.
from node-jscs.
@mdevils I want to put ignores to inner directory.
/
.jscs.json
vendor/
.jscsignore
something-dirty.js
...
from node-jscs.
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.
@zxqfox, the original poster, closed it after seeing that excludeFiles matched his use case.
from node-jscs.
;-D yep. I couldn't find a reason to make additional file excluding mechanisms.
@Knotix what's your case?
from node-jscs.
@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.
I really just prefer it for consistency. It would match Git's and JSHint's method of ignoring files.
from node-jscs.
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.
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.
Adding a +1 for a separate .jscsignore
file for the same reason.
from node-jscs.
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.
Any ideas how to load this file and merge with excludeFiles
option?
from node-jscs.
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.
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.
{excludedFiles: '.jshintignore'}
is a good idea.
from node-jscs.
@zxqfox would you like to tackle this for 1.12?
from node-jscs.
@mikesherov yep. I'll do it ;-)
@mdevils Please take a look here, really want to know your thoughts.
from node-jscs.
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.
@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.
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.
@mikesherov I'm agree in common, but e.g. git on windows doesn't support symlinks.
from node-jscs.
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.
@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.
What's the status on this? I'm tempted to close it as orphaned
unless there's a strong objection.
from node-jscs.
Waiting for #1150 to finish this.
Also there is #1159 — I think we should change this logic in 2.0.
from node-jscs.
I still very much want this.
from node-jscs.
I feel OK deprecating exludeFiles
and implementing jshintignore/gitignore
-compatible .jscsignore
file.
from node-jscs.
👍
from node-jscs.
👍
from node-jscs.
How is there no option to specify an ignore file...
from node-jscs.
@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.
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.
If anyone would help us with this ticket, it would be great
from node-jscs.
I'd be interested in helping out with this.
from node-jscs.
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.
@jwhitmarsh friendly ping. Any progress on this?
from node-jscs.
Would love this too!
from node-jscs.
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.
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.
@malandrew Thanks for the info. I will look into it as well.
from node-jscs.
@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.
I put a $200 bounty on this issue. Lets do this folks!
from node-jscs.
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.
@adambuczynski exactly. I personally really only want autofix for style. Anything else does make me a little nervous.
from node-jscs.
+1
from node-jscs.
+1, any updates on this one? seems to be backed on bountysource
from node-jscs.
At this point only major and CST related bugs will be fixed
from node-jscs.
Related Issues (20)
- jscs exlucdeFiles not Work! HOT 1
- Should have exception for disallowSpacesInFunction for anonymous generators HOT 1
- not possible to include extensions with multiple "." characters HOT 7
- Error running rule requirePaddingNewLinesBeforeLineComments HOT 1
- not possible to ignore '.js' files with fileExtensions #2273
- Destructuring with default values in parameters throws an error. HOT 1
- Cannot find module 'babel-runtime/core-js/object/keys' HOT 8
- Error: Symbol is not defined (first character of file) HOT 3
- Add `templateStrings` as an option for the `allExcept` property of the `maximumLineLength` rule HOT 2
- requireSpaceBeforeDestructuredValues does not work in vanilla JS HOT 3
- maximumLineLength should optionally allow string literals to break the rule HOT 2
- validateIndentation should enforce endbrace at the same indentation as the line containing it's corresponding startbrace HOT 2
- Error running rule requireDollarBeforejQueryAssignment HOT 3
- JSCS goes into infinite loop HOT 2
- About jsx curly braces variable HOT 1
- JSCS crashes due to decorators HOT 1
- requireSpaceBetweenArguments doesn't work in constructor of es6. HOT 4
- How to write a rule which makes "case" align to "switch" in switch statement? HOT 1
- jscs.info offline HOT 3
- Disabling Specific Rules For a Single Line not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-jscs.