JS: Update OK-style comments to $-style

This commit is contained in:
Asger F
2025-02-06 13:34:01 +01:00
parent 7e5c24a8ec
commit 9be041e27d
536 changed files with 4408 additions and 4762 deletions

View File

@@ -1,4 +1,4 @@
// OK: don't report anything in .js files.
// OK - don't report anything in .js files.
function getStuff(number) {
return {
"new": function() {

View File

@@ -1,11 +1,11 @@
var foo: MyInterface = 123 as any;
interface MyInterface {
function (): number; // OK. Highly unlikely that it is an accident when there are other named methods in the interface.
(): number; // OK: What was probably meant above.
new:() => void; // OK! This is a property, not a method, we ignore those.
constructor(): string; // NOT OK! This a called "constructor"
new(): Date; // OK! This a constructor signature.
function (): number; // OK - Highly unlikely that it is an accident when there are other named methods in the interface.
(): number; // OK - What was probably meant above.
new:() => void; // OK - This is a property, not a method, we ignore those.
constructor(): string; // $ Alert - This a called "constructor"
new(): Date; // OK - This a constructor signature.
myNumber: 123;
}
@@ -13,15 +13,15 @@ interface MyInterface {
var a : MyFunction = null as any;
interface MyFunction {
function(): number; // NOT OK!
function(): number; // $ Alert
}
class Foo {
new(): number { // OK! Highly unlikely that a developer confuses "constructor" and "new" when both are present.
new(): number { // OK - Highly unlikely that a developer confuses "constructor" and "new" when both are present.
return 123;
}
constructor() { // OK! This is a constructor.
constructor() { // OK - This is a constructor.
}
myString = "foobar"
@@ -34,18 +34,18 @@ class Foo {
var b : FunctionClass = new FunctionClass();
declare class FunctionClass {
function(): number; // NOT OK:
function(): number; // $ Alert
}
class Baz {
new(): Baz { // OK! When there is a method body I assume the developer knows what they are doing.
new(): Baz { // OK - When there is a method body I assume the developer knows what they are doing.
return null as any;
}
}
declare class Quz {
new(): Quz; // NOT OK! The developer likely meant to write constructor.
new(): Quz; // $ Alert - The developer likely meant to write constructor.
}
var bla = new Foo();