From 6c8b38575572254b4ce32d092576c88ea9e6fdc9 Mon Sep 17 00:00:00 2001 From: Alexey Murz Korepov Date: Tue, 23 Jun 2026 11:04:17 +0400 Subject: [PATCH] chore: Add eslint config to pass the tests with no manual configs --- eslint.config.js | 25 +++++++++++++++++++++++++ package.json | 2 ++ pnpm-lock.yaml | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 eslint.config.js diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..ffd8be57 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,25 @@ +import { defineConfig } from "eslint/config"; +import js from "@eslint/js"; +import tseslint from "typescript-eslint"; + +export default defineConfig([ + { + files: ["**/*.js"], + plugins: { js }, + extends: ["js/recommended"], + rules: { + "no-unused-vars": "warn", + "no-undef": "warn", + }, + }, + ...tseslint.configs.recommended.map((config) => ({ + ...config, + files: ["**/*.{ts,tsx}"], + })), + { + files: ["**/*.{ts,tsx}"], + rules: { + "@typescript-eslint/no-unused-vars": "warn", + }, + }, +]); diff --git a/package.json b/package.json index e2ecea84..35b66864 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,10 @@ "devDependencies": { "@changesets/changelog-github": "^0.6.0", "@changesets/cli": "^2.29.8", + "@eslint/js": "^9.39.1", "@types/node": "^22.15.3", "eslint": "^9.39.1", + "typescript-eslint": "^8.50.0", "husky": "^9.1.7", "lint-staged": "^16.4.0", "prettier": "^3.7.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08162885..a051d0db 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,6 +21,9 @@ importers: '@changesets/cli': specifier: ^2.29.8 version: 2.29.8(@types/node@22.15.3) + '@eslint/js': + specifier: ^9.39.1 + version: 9.39.2 '@types/node': specifier: ^22.15.3 version: 22.15.3 @@ -45,6 +48,9 @@ importers: typescript: specifier: 5.9.2 version: 5.9.2 + typescript-eslint: + specifier: ^8.50.0 + version: 8.51.0(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.2) vitest: specifier: ^4.0.18 version: 4.1.0(@types/node@22.15.3)(jsdom@28.1.0(@noble/hashes@1.8.0))(msw@2.12.7(@types/node@22.15.3)(typescript@5.9.2))(vite@8.0.1(@types/node@22.15.3)(esbuild@0.27.2)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.2))