From b66c966c7301dd2c2ec570d59e7518ebc6d3039c Mon Sep 17 00:00:00 2001 From: zirkelc Date: Tue, 1 Aug 2023 15:28:43 +0200 Subject: [PATCH] eslint and tsc --- .eslintrc.js | 1 + package.json | 4 ++-- src/index.js | 4 ---- src/index.ts | 4 +++- 4 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 src/index.js diff --git a/.eslintrc.js b/.eslintrc.js index 936146f..c62aa4b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,5 +29,6 @@ module.exports = { "@typescript-eslint" ], "rules": { + "no-console": "error", } } diff --git a/package.json b/package.json index e38891c..904d56f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "lint": "eslint .", - "tsc": "tsc", + "tsc": "tsc --noEmit", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { @@ -25,4 +25,4 @@ "eslint": "^8.46.0", "typescript": "^5.1.6" } -} +} \ No newline at end of file diff --git a/src/index.js b/src/index.js deleted file mode 100644 index e784b9a..0000000 --- a/src/index.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -function add(a, b) { - return a + b; -} diff --git a/src/index.ts b/src/index.ts index d48b7c1..01eb71c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ -export function add(a: number, b: number): number { +export function add(a, b): number { + console.log('add'); + return a + b; } \ No newline at end of file