Skip to content

Commit 4d8a7cd

Browse files
committed
fix lint.js and some lints
1 parent ac93773 commit 4d8a7cd

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
## Contributing
2+
23
TypeScript-Handbook is accepting contributions. If you've submitted a PR for an existing issue, please post a comment in the issue to avoid duplication of effort.
34

45

56
## Housekeeping
7+
68
Your pull request should:
79

810
* Include a description of what your change intends to do.

lint.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ var options = {
77
MD001: false, // Header levels should only increment by one level at a time
88
MD002: false, // First header should be a h1 header
99
MD003: false, // Header style
10-
MD004: "asterisk", // Unordered list style
10+
MD004: {style: "asterisk"}, // Unordered list style
1111
MD005: true, // Inconsistent indentation for list items at the same level
1212
MD006: true, // Consider starting bulleted lists at the beginning of the line
13-
MD007: 4, // Unordered list indentation
13+
MD007: {indent: 4}, // Unordered list indentation
1414
MD009: true, // Trailing spaces
1515
MD010: true, // Hard tabs
1616
MD011: true, // Reversed link syntax
@@ -25,10 +25,10 @@ var options = {
2525
MD023: true, // Headers must start at the beginning of the line
2626
MD024: false, // Multiple headers with the same content
2727
MD025: false, // Multiple top level headers in the same document
28-
MD026: ".,;:!?", // Trailing punctuation in header
28+
MD026: {punctuation: ".,;:!?"}, // Trailing punctuation in header
2929
MD027: true, // Multiple spaces after blockquote symbol
3030
MD028: false, // Blank line inside blockquote
31-
MD029: "ordered", // Ordered list item prefix
31+
MD029: {style: "ordered"}, // Ordered list item prefix
3232
MD030: true, // Spaces after list markers
3333
MD031: true, // Fenced code blocks should be surrounded by blank lines
3434
MD032: true, // Lists should be surrounded by blank lines

pages/Basic Types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ notSure = false; // okay, definitely a boolean
119119
```
120120

121121
The `any` type is a powerful way to work with existing JavaScript, allowing you to gradually opt-in and opt-out of type-checking during compilation.
122-
You might expect `Object` to play a similar role, as it does in other languages.
122+
You might expect `Object` to play a similar role, as it does in other languages.
123123
But variables of type `Object` only allow you to assign any value to them -- you can't call arbitrary methods on them, even ones that actually exist:
124124

125125
```TypeScript
126126
var notSure: any = 4;
127127
notSure.ifItExists(); // okay, ifItExists might exist at runtime
128128
notSure.toFixed(); // okay, toFixed exists (but the compiler doesn't check)
129129
var prettySure: Object = 4;
130-
prettySure.toFixed(); // Error: Property 'toFixed' doesn't exist on type 'Object'.
130+
prettySure.toFixed(); // Error: Property 'toFixed' doesn't exist on type 'Object'.
131131
```
132132

133133
The `any` type is also handy if you know some part of the type, but perhaps not all of it.

pages/Classes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var greeter = new Greeter("world");
2323
```
2424

2525
The syntax should look familiar if you've used C# or Java before.
26-
We declare a new class `Greeter`. This class has three members: a property called `greeting`, a constructor, and a method `greet`.
26+
We declare a new class `Greeter`. This class has three members: a property called `greeting`, a constructor, and a method `greet`.
2727

2828
You'll notice that in the class when we refer to one of the members of the class we prepend `this.`.
2929
This denotes that it's a member access.
@@ -119,7 +119,7 @@ new Animal("Cat").name; // Error: 'name' is private;
119119
```
120120

121121
TypeScript is a structural type system.
122-
When we compare two different types, regardless of where they came from, if the types of all members are compatible, then we say the types themselves are compatible.
122+
When we compare two different types, regardless of where they came from, if the types of all members are compatible, then we say the types themselves are compatible.
123123

124124
However, when comparing types that have `private` and `protected` members, we treat these types differently.
125125
For two types to be considered compatible, if one of them has a `private` member, then the other must have a `private` member that originated in the same declaration.
@@ -139,7 +139,7 @@ class Rhino extends Animal {
139139

140140
class Employee {
141141
private name: string;
142-
constructor(theName: string) { this.name = theName; }
142+
constructor(theName: string) { this.name = theName; }
143143
}
144144

145145
var animal = new Animal("Goat");
@@ -228,7 +228,7 @@ if (employee.fullName) {
228228
}
229229
```
230230

231-
While allowing people to randomly set fullName directly is pretty handy, this might get us in trouble if we people can change names on a whim.
231+
While allowing people to randomly set fullName directly is pretty handy, this might get us in trouble if we people can change names on a whim.
232232

233233
In this version, we check to make sure the user has a secret passcode available before we allow them to modify the employee.
234234
We do this by replacing the direct access to fullName with a `set` that will check the passcode.
@@ -243,7 +243,7 @@ class Employee {
243243
get fullName(): string {
244244
return this._fullName;
245245
}
246-
246+
247247
set fullName(newName: string) {
248248
if (passcode && passcode == "secret passcode") {
249249
this._fullName = newName;

0 commit comments

Comments
 (0)