Coder Social home page Coder Social logo

Split whitespace rule about tslint HOT 10 CLOSED

palantir avatar palantir commented on July 24, 2024
Split whitespace rule

from tslint.

Comments (10)

Bartvds avatar Bartvds commented on July 24, 2024

I also get an error similar to this that can't be toggled with the whitespace rule:

if (condition){

}

Note the lack of space after the conditional, it triggers 'missing whitespace'.

from tslint.

ashwinr avatar ashwinr commented on July 24, 2024

this is handled by the "oneline" rule, and should be optional. I'm making it so, now. thanks!

from tslint.

ashwinr avatar ashwinr commented on July 24, 2024

I think it's useful to have optional arguments to rules. So in this case, the "oneline" rule would have an optional rule argument to also check for preceding whitespace. I am going to slightly break the configuration file format for such rules to allow for additional rule options like eslint.

So rules like "indent" would now have to be written as indent: [true, 4].

from tslint.

Bartvds avatar Bartvds commented on July 24, 2024

I've been following ESLint for some time and I agree, it allows for more detailed configuration.

Maybe also nest the rules in a "rules" element for future-proofing.

I also like how they split problems in multiple levels, like warning and errors.

from tslint.

ashwinr avatar ashwinr commented on July 24, 2024

sure. ESLint's rule names also are clearer in some cases, so I'm going to reconsider a few rule names of our own (I named them for consistency with JSHint, but that might not be a big concern).

from tslint.

Bartvds avatar Bartvds commented on July 24, 2024

Personally I have great hopes for ESLint, it feels like it is the next-gen linter, based on the experience from using JSHint.

I also like their idea of pluggable rules, it lets many contributors add all kinds of rules; it really benefits the project.

from tslint.

ashwinr avatar ashwinr commented on July 24, 2024

rules now have optional arguments. the oneline rule with whitespace checks is now written as: oneline: [true, "check-whitespace"]. Also, 0.2 of tslint and grunt-tslint are out and incompatible with rule files from 0.1.

from tslint.

Bartvds avatar Bartvds commented on July 24, 2024

I see the 0.2 update, checks out.

But doesn't that leave the splitting of this rule open? As some of the cases it covers are not really same thing (like we discussed above).

from tslint.

ashwinr avatar ashwinr commented on July 24, 2024

Sure, we can make each individual check an option of the "whitespace" rule.

from tslint.

ashwinr avatar ashwinr commented on July 24, 2024

fixed by 129e917

from tslint.

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.