Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSLint rules #11

Open
9 tasks
einari opened this issue Jan 4, 2020 · 4 comments
Open
9 tasks

TSLint rules #11

einari opened this issue Jan 4, 2020 · 4 comments

Comments

@einari
Copy link
Contributor

einari commented Jan 4, 2020

Suggestions to additional rules for consistency on our own code-base:

  • Require Copyright header (https://palantir.github.io/tslint/rules/file-header/) according to our standard (same as for C# defined here, see below for expected header)
  • Single empty line between copyright header and import statements
  • Single empty line between import statements and code
  • Single empty line between end of method/function and next.
  • JSDoc documentation - see below for more details.

JSDoc

  • All documentation lines should end with a . (Think of them as sentences on a page)
  • Require all parameters and return values be documented
  • Require a - separator when documenting parameters and return values
  • Allow for /** @inheritdoc */

Header

// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

Expected texts in documentation

For consistency, we’re expecting documentation to follow suit.

Constructor

/**
  * Initializes a new instance of the {YourClass} class.
  */

Interface

/**
  * Defines...
  */

Implementations

/**
  * Represents an implementation of {IInterface} [for a specific purpose, if any].
  */
@woksin
Copy link
Contributor

woksin commented Jan 4, 2020

Sounds great. Just a heads up, I think that the rules related to the jsdocs is really time consuming. I will check it out and find out what can work

@einari
Copy link
Contributor Author

einari commented Jan 4, 2020

Depends on what the object model provides. If it's similar to the C# Roslyn model, it should be fairly straight forward.

Example:
https://github.com/dolittle-tools/DotNET.Common/blob/master/Source/CodeAnalysis/ExceptionDescriptionShouldFollowStandard/Analyzer.cs

@woksin
Copy link
Contributor

woksin commented Jan 5, 2020

@einari Not time consuming as in amount of work required, I meant that the linting will be really slow

@einari
Copy link
Contributor Author

einari commented Jan 5, 2020

Ahh.. I see.. 😊 Could be, for Roslyn you hardly notice - that compiler is super efficient in running things concurrently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants