Code Monkey home page Code Monkey logo

Comments (7)

mgechev avatar mgechev commented on August 15, 2024

@buehler thanks! It makes sense to add such rule in the TypeScript section. I agree with you that it makes sense.

tslint's variable-name rule seems to solve this partially so we can extend the tslint.json configuration as well.

We can extend the rule further in ng2lint where we can check whether variable with leading _ is declared with private access modified.

from angular2-style-guide.

buehler avatar buehler commented on August 15, 2024

Yay ;-)

from angular2-style-guide.

buehler avatar buehler commented on August 15, 2024

Perfect, I'll wait for the new package then ;-)
Thanks for the cool styleguide!

Or should I make a PR?
Cheers

from angular2-style-guide.

mgechev avatar mgechev commented on August 15, 2024

You're welcome to open a PR with this addition to the TypeScript section :-)

from angular2-style-guide.

buehler avatar buehler commented on August 15, 2024

I found a styleguide by Microsoft:
https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Classes.md

Well, they say, "name private vars without _ unless it's for a property"

I'll write an appropriate part for the typescript section

from angular2-style-guide.

ludohenin avatar ludohenin commented on August 15, 2024

@mgechev private members lint rule is already available from the angular2 repo.
https://github.com/angular/angular/blob/master/tools/tslint/requireInternalWithUnderscoreRule.ts

from angular2-style-guide.

buehler avatar buehler commented on August 15, 2024

Alright, I documented it in #33
Feel free to comment on the PR if you find something that is missing or needs improvement.

Cheers

from angular2-style-guide.

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.