From fa184a2b50a7328d6ee66099faeff382af4e26bc Mon Sep 17 00:00:00 2001 From: PierreDemailly <39910767+PierreDemailly@users.noreply.github.com> Date: Sat, 4 Jan 2025 22:15:51 +0100 Subject: [PATCH] feat(eslint): disallow unused vars (#60) --- src/eslint/src/rules/variables.ts | 2 +- src/eslint/test/fixtures/fail.js | 1 + src/eslint/test/fixtures/fail.ts | 1 + src/eslint/test/fixtures/pass.js | 1 + src/eslint/test/fixtures/pass.ts | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/eslint/src/rules/variables.ts b/src/eslint/src/rules/variables.ts index a3121db..1de8137 100644 --- a/src/eslint/src/rules/variables.ts +++ b/src/eslint/src/rules/variables.ts @@ -27,5 +27,5 @@ export default { "no-undefined": "off", // See: https://eslint.org/docs/rules/no-unused-vars - "no-unused-vars": "off" + "no-unused-vars": ["error", { "ignoreRestSiblings": true }] }; diff --git a/src/eslint/test/fixtures/fail.js b/src/eslint/test/fixtures/fail.js index 41e3c6e..c853666 100644 --- a/src/eslint/test/fixtures/fail.js +++ b/src/eslint/test/fixtures/fail.js @@ -1 +1,2 @@ const foo = "bar" +console.log(foo); diff --git a/src/eslint/test/fixtures/fail.ts b/src/eslint/test/fixtures/fail.ts index 3734957..447300c 100644 --- a/src/eslint/test/fixtures/fail.ts +++ b/src/eslint/test/fixtures/fail.ts @@ -1 +1,2 @@ const foo: string = "bar" +console.log(foo); diff --git a/src/eslint/test/fixtures/pass.js b/src/eslint/test/fixtures/pass.js index 4f4b4c8..5b9c13a 100644 --- a/src/eslint/test/fixtures/pass.js +++ b/src/eslint/test/fixtures/pass.js @@ -1 +1,2 @@ const foo = "bar"; +console.log(foo); diff --git a/src/eslint/test/fixtures/pass.ts b/src/eslint/test/fixtures/pass.ts index b0afb69..c1739f8 100644 --- a/src/eslint/test/fixtures/pass.ts +++ b/src/eslint/test/fixtures/pass.ts @@ -1 +1,2 @@ const foo: string = "bar"; +console.log(foo);