Skip to content

Commit b741a65

Browse files
documentation changes based on review
Co-Authored-By: shati-patel <42641846+shati-patel@users.noreply.github.com>
1 parent c8d60c9 commit b741a65

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ In TypeScript the keywords <code>constructor</code> and <code>new</code> for
88
member declarations are used to declare constructors in classes and interfaces
99
respectively.
1010
However, a member declaration with the name <code>new</code> in an interface
11-
or <code>constructor</code> in a class, will declare ordinary methods named
12-
<code>new</code> or <code>constructor</code> rather than constructors.
11+
or <code>constructor</code> in a class, will declare an ordinary method named
12+
<code>new</code> or <code>constructor</code> rather than a constructor.
1313
Similarly, the keyword <code>function</code> is used to declare functions in
14-
some contexts, however, using the name <code>function</code> for a class
14+
some contexts. However, using the name <code>function</code> for a class
1515
or interface member declaration declares a method named <code>function</code>.
1616
</p>
1717

@@ -48,8 +48,8 @@ in the first place.
4848
</example>
4949
<references>
5050

51-
<li>TypeScript specification: <a href="https://github.com/microsoft/TypeScript/blob/master/doc/spec.md#3.8.9">Constructor Type Literals</a></li>
52-
<li>TypeScript specification: <a href="https://github.com/microsoft/TypeScript/blob/master/doc/spec.md#8.3.1">Constructor Parameters</a></li>
51+
<li>TypeScript specification: <a href="https://github.com/microsoft/TypeScript/blob/master/doc/spec.md#3.8.9">Constructor Type Literals</a>.</li>
52+
<li>TypeScript specification: <a href="https://github.com/microsoft/TypeScript/blob/master/doc/spec.md#8.3.1">Constructor Parameters</a>.</li>
5353

5454
</references>
5555
</qhelp>

javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Suspicious method name declaration
3-
* @description A method declaration with a name that would be a special keyword in another
3+
* @description A method declaration with a name that is a special keyword in another
44
* context is suspicious.
55
* @kind problem
66
* @problem.severity warning

javascript/ql/test/query-tests/Declarations/SuspiciousMethodNameDeclaration/tst.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var foo: MyInterface = 123 as any;
22

33
interface MyInterface {
44
function (): number; // OK. Highly unlikely that it is an accident when there are other named methods in the interface.
5-
(): number; // OK: What was probaly meant above.
5+
(): number; // OK: What was probably meant above.
66
new:() => void; // OK! This is a property, not a method, we ignore those.
77
constructor(): string; // NOT OK! This a called "constructor"
88
new(): Date; // OK! This a constructor signature.
@@ -49,4 +49,4 @@ declare class Quz {
4949
}
5050

5151
var bla = new Foo();
52-
var blab = new Baz();
52+
var blab = new Baz();

0 commit comments

Comments
 (0)