mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
rename suspicious-method-name to suspicious-method-name-declaration
This commit is contained in:
@@ -33,7 +33,7 @@ and a method called <code>constructor</code>. The interface does not declare
|
||||
a class <code>Point</code> with a constructor, which was likely what the
|
||||
developer meant to create.
|
||||
</p>
|
||||
<sample src="examples/SuspiciousMethodName.ts" />
|
||||
<sample src="examples/SuspiciousMethodNameDeclaration.ts" />
|
||||
|
||||
<p>
|
||||
The below example is a fixed version of the above, where the interface is
|
||||
@@ -41,7 +41,7 @@ instead declared as a class, thereby describing the type the developer meant
|
||||
in the first place.
|
||||
</p>
|
||||
|
||||
<sample src="examples/SuspiciousMethodNameFixed.ts" />
|
||||
<sample src="examples/SuspiciousMethodNameDeclarationFixed.ts" />
|
||||
|
||||
</example>
|
||||
<references>
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @name Suspicious method name
|
||||
* @name Suspicious method name declaration
|
||||
* @description A method having the name "function", "new", or "constructor"
|
||||
* is usually caused by a programmer being confused about the TypeScript syntax.
|
||||
* @kind problem
|
||||
* @problem.severity warning
|
||||
* @id js/suspicious-method-name
|
||||
* @id js/suspicious-method-name-declaration
|
||||
* @precision high
|
||||
* @tags correctness
|
||||
* typescript
|
||||
Reference in New Issue
Block a user