Giter Site home page Giter Site logo

Comments (11)

mdevils avatar mdevils commented on June 17, 2024

Hi!

  1. I will think about it.
  2. I think It's possible :)
  3. I didn't get your point. Options dont have default values at all. Option can be defined in config (and then the value must be validated) or not defined. Options, which are not in config, are not used.

from node-jscs.

mdevils avatar mdevils commented on June 17, 2024

Thank you for your feedback! 👍

from node-jscs.

gustavohenke avatar gustavohenke commented on June 17, 2024

The 3rd point is related to this:
My config file:

{
    ...,
    "require_line_feed_at_file_end": false
}

Which gives me:

AssertionError: require_line_feed_at_file_end option requires true value or should be removed
    at Object.module.exports.configure (C:\Users\gustavo\AppData\Roaming\npm\node_modules\jscs\lib\rules\require-line-feed-at-file-end.js:12:9)

Also some other options give me the same exception.

from node-jscs.

mdevils avatar mdevils commented on June 17, 2024

Oh, I see, It is probably Usability or Understanding problem.

For every option there is rule validator. If you need to "check line feed at file end", you are adding this option. There is no behavior for "false" value. If you want to ensure that there is no line feed at the end - there must be another option (like "disallow_line_feed_at_file_end").

That is why for "require_line_feed_at_file_end" there is only one valid value for now - true.

In other words, there is no default configuration of JSCS behavior. You can require something using some options or disallow something using another set of options, and there is nothing like "ignore rule" because there are no default rules :) Adding option to config = adding rule.

This is how it works. Probably it's not simple or trivial.

from node-jscs.

gustavohenke avatar gustavohenke commented on June 17, 2024

OK, thanks for the explanation.
I hope to give some pull requests soon :)

from node-jscs.

mdevils avatar mdevils commented on June 17, 2024

Thank you!

from node-jscs.

deepsweet avatar deepsweet commented on June 17, 2024

+1 for the 1 & 2 :)

from node-jscs.

mdevils avatar mdevils commented on June 17, 2024

Camel-case option names will be available in next release.

Rename the config file to .jscsrc

This suggestion was declined as we have valid json unlike jshint. Many tools use correct extensions (like .travis.yml).

Thank you for your feedback.

from node-jscs.

gustavohenke avatar gustavohenke commented on June 17, 2024

OK, thanks ;)

from node-jscs.

deepsweet avatar deepsweet commented on June 17, 2024

so maybe convert config to YAML? there is a good parser js-yaml.

from node-jscs.

mdevils avatar mdevils commented on June 17, 2024

@deepsweet, in YAML C-style naming is preferable. I switched to camelCase to make configuration valid in case of further API usage. So we can have JSON/API compatible naming for the same options.

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.