From 602b8e4ea19a44609ae7761274ca015dc7f61131 Mon Sep 17 00:00:00 2001 From: YeonJuan Date: Tue, 19 Nov 2024 22:52:43 +0900 Subject: [PATCH] fix lint errors --- packages/template-parser/eslint.config.mjs | 21 +++++++++++++++++++++ packages/template-parser/package.json | 5 +++-- yarn.lock | 8 ++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 packages/template-parser/eslint.config.mjs diff --git a/packages/template-parser/eslint.config.mjs b/packages/template-parser/eslint.config.mjs new file mode 100644 index 00000000..f563f516 --- /dev/null +++ b/packages/template-parser/eslint.config.mjs @@ -0,0 +1,21 @@ +import js from "@eslint/js"; +import globals from "globals"; +export default [ + js.configs.recommended, + + { + ignores: ["eslint.config.mjs"], + languageOptions: { + ecmaVersion: 2020, + sourceType: "commonjs", + globals: { + ...globals.jest, + }, + }, + + rules: { + "no-unused-vars": "warn", + "no-undef": "warn", + }, + }, +]; diff --git a/packages/template-parser/package.json b/packages/template-parser/package.json index ad705c0e..19dc1f39 100644 --- a/packages/template-parser/package.json +++ b/packages/template-parser/package.json @@ -25,7 +25,7 @@ }, "scripts": { "ts": "tsc", - "lint": "eslint . --ext .js", + "lint": "eslint .", "build": "tsc -p ./tsconfig.build.json", "test": "jest --coverage" }, @@ -41,6 +41,7 @@ "devDependencies": { "@types/estree": "^0.0.47", "eslint": "^9.15.0", - "espree": "^10.3.0" + "espree": "^10.3.0", + "globals": "^15.12.0" } } diff --git a/yarn.lock b/yarn.lock index d63df0fd..78f9368e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1385,6 +1385,7 @@ __metadata: es-html-parser: "npm:^0.0.10" eslint: "npm:^9.15.0" espree: "npm:^10.3.0" + globals: "npm:^15.12.0" languageName: unknown linkType: soft @@ -8598,6 +8599,13 @@ __metadata: languageName: node linkType: hard +"globals@npm:^15.12.0": + version: 15.12.0 + resolution: "globals@npm:15.12.0" + checksum: f34e0a1845b694f45188331742af9f488b07ba7440a06e9d2039fce0386fbbfc24afdbb9846ebdccd4092d03644e43081c49eb27b30f4b88e43af156e1c1dc34 + languageName: node + linkType: hard + "globby@npm:11.1.0, globby@npm:^11.0.3": version: 11.1.0 resolution: "globby@npm:11.1.0"