TSLint rules
einari opened this issue · comments
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].
*/
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
Depends on what the object model provides. If it's similar to the C# Roslyn model, it should be fairly straight forward.
@einari Not time consuming as in amount of work required, I meant that the linting will be really slow
Ahh.. I see.. 😊 Could be, for Roslyn you hardly notice - that compiler is super efficient in running things concurrently.