diff --git a/main.ts b/main.ts new file mode 100644 index 0000000..d2b902e --- /dev/null +++ b/main.ts @@ -0,0 +1,14 @@ +var foo = 123 + +function logStuff(input: any) { + console.log("Input is:", input) + debugger +} + +function doNothing() {} + +const process = (value: any) => { + var temp = value + console.log("Processing:", temp) +} + diff --git a/sgconfig.yml b/sgconfig.yml new file mode 100644 index 0000000..c8c540a --- /dev/null +++ b/sgconfig.yml @@ -0,0 +1,33 @@ +rules: + - id: no-console-log + message: Avoid using console.log + severity: warning + language: ts + pattern: console.log($$$) + + - id: no-any-type + message: Avoid using `any` type + severity: warning + language: ts + pattern: ($VAR:identifier): any + + - id: no-var + message: Use `let` or `const` instead of `var` + severity: warning + language: ts + pattern: var $VAR = $$$ + + - id: no-debugger + message: Remove `debugger` statement + severity: warning + language: ts + pattern: debugger + + - id: no-empty-function + message: Avoid using empty functions + severity: warning + language: ts + pattern: | + function $NAME($$$) { + } +