From f8a67f9463f98e85cd7ac6032941d30f0b2527ea Mon Sep 17 00:00:00 2001 From: Nanai Jua Date: Tue, 26 Mar 2024 21:59:33 +0900 Subject: [PATCH 1/4] chore(deps): add `globals` --- package.json | 1 + pnpm-lock.yaml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/package.json b/package.json index 165c0b28..bb1812a2 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-vitest": "^0.3.21", + "globals": "^15.0.0", "lefthook": "^1.6.1", "prettier": "^3.2.5", "vitest": "^1.2.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5044592b..185fd44d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,6 +70,9 @@ devDependencies: eslint-plugin-vitest: specifier: ^0.3.21 version: 0.3.26(@typescript-eslint/eslint-plugin@6.21.0)(eslint@8.57.0)(typescript@5.4.3)(vitest@1.4.0) + globals: + specifier: ^15.0.0 + version: 15.0.0 lefthook: specifier: ^1.6.1 version: 1.6.7 @@ -2763,6 +2766,11 @@ packages: engines: {node: '>=18'} dev: true + /globals@15.0.0: + resolution: {integrity: sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==} + engines: {node: '>=18'} + dev: true + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} From 823de425c8405ac66c897b5975415ec9114aaa70 Mon Sep 17 00:00:00 2001 From: Nanai Jua Date: Tue, 26 Mar 2024 22:02:42 +0900 Subject: [PATCH 2/4] refactor: remove needless wildcard --- eslint.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint.config.js b/eslint.config.js index 7000242f..ddb9d2e1 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -12,7 +12,7 @@ export default [ files: ['src/**/**.ts'], }, { - ignores: ['build/**', 'coverage/**', 'node_modules/**'], + ignores: ['build', 'coverage', 'node_modules'], }, // eslint:recommended js.configs.recommended, From ae79532f1910aa042f971cf303a4445bfe3b9c70 Mon Sep 17 00:00:00 2001 From: Nanai Jua Date: Tue, 26 Mar 2024 22:03:19 +0900 Subject: [PATCH 3/4] fix: incorrect target specifing --- eslint.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint.config.js b/eslint.config.js index ddb9d2e1..f84a40a2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -9,7 +9,7 @@ const compat = new FlatCompat(); export default [ { - files: ['src/**/**.ts'], + files: ['**/*.{js,ts}'], }, { ignores: ['build', 'coverage', 'node_modules'], From 1fd73e58a257c4d26e5aae541d1fdeb418015d24 Mon Sep 17 00:00:00 2001 From: Nanai Jua Date: Tue, 26 Mar 2024 22:08:18 +0900 Subject: [PATCH 4/4] chore: append `globals.node` into `.languageOptions.globals` --- eslint.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint.config.js b/eslint.config.js index f84a40a2..0597cdd9 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -4,6 +4,7 @@ import typeScriptESLint from '@typescript-eslint/eslint-plugin'; import typeScriptESLintParser from '@typescript-eslint/parser'; import eslintConfigPrettier from 'eslint-config-prettier'; import vitest from 'eslint-plugin-vitest'; +import globals from 'globals'; const compat = new FlatCompat(); @@ -25,6 +26,7 @@ export default [ project: './tsconfig.json', }, globals: { + ...globals.node, ...vitest.environments.env.globals, }, },