// code snippet
/**
* Documentation
*/
interface ISomething {
/**
* Documentation
*/
mySecondAttribute: string;
}
class Something {
public myAttribute: string;
}
with tslint.json configuration:
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended",
"tslint-config-prettier"
],
"jsRules": {},
"rules": {
"completed-docs": [true, "interfaces", "properties"],
"prettier": [true, ".prettierrc"],
"no-magic-numbers": [true, 0, 1, 2]
},
"rulesDirectory": [
"tslint-plugin-prettier"
]
}
Documentation must exist for properties.
No TSLint errors. I just want documentation for the properties of the interfaces and the interface itself
I'm having the same issue. I want to require documentation for the interface properties and I can't do it. The maximum that I get it's requirement for all properties using: "completed-docs": [true, "interfaces", "properties"],
Interesting. This configuration should work to only enforce documentation on interface properties:
{
"rules": {
"completed-docs": [
true,
{
"interfaces": {
"properties": true
}
}
]
}
}
Does that work for you?
@JoshuaKGoldberg Hi, thank you for the response, but for me I still not complaining for the interfaces properties, only for the interface itself. So in this example it's fine:
/**
* Foo
*/
export interface IFoo {
foo: string;
}
but I want this as the correct one:
export interface IFoo {
/**
* Foo
*/
foo: string;
}
โ ๏ธ TSLint's time has come! โ ๏ธ
TSLint is no longer accepting most feature requests per #4534. See typescript-eslint.io for the new, shiny way to lint your TypeScript code with ESLint. โจ
It was a pleasure open sourcing with you all!
๐ค Beep boop! ๐ TSLint is deprecated ๐ _(#4534)_ and you should switch to typescript-eslint! ๐ค
๐ This issue is being locked to prevent further unnecessary discussions. Thank you! ๐
Most helpful comment
@JoshuaKGoldberg Hi, thank you for the response, but for me I still not complaining for the interfaces properties, only for the interface itself. So in this example it's fine:
but I want this as the correct one: