tslint-clean-code
Version:
TSLint rules for enforcing Clean Code
14 lines (11 loc) • 343 B
text/typescript
interface DocumentLikeAPI {
cookie: string;
}
function documentLikeAPIFunction(): DocumentLikeAPI {
return null;
}
// These usages are OK because they are not on the DOM document
var document2: DocumentLikeAPI = documentLikeAPIFunction();
document2.cookie = '...';
document2.cookie = '...';
documentLikeAPIFunction().cookie = '...';