From 9b1de775d2157606c30c4ece3287a42e1e9463a3 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 5 Oct 2024 16:34:49 +0800 Subject: [PATCH] fix: windows sep, fixes #741 Signed-off-by: Innei --- plugins/eslint/eslint-check-i18n-json.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/eslint/eslint-check-i18n-json.js b/plugins/eslint/eslint-check-i18n-json.js index fccdbe1c0..8489d65b0 100644 --- a/plugins/eslint/eslint-check-i18n-json.js +++ b/plugins/eslint/eslint-check-i18n-json.js @@ -1,6 +1,7 @@ // @ts-check /** @type {import("eslint").ESLint.Plugin} */ import fs from "node:fs" +import path from "node:path" export default { rules: { @@ -80,7 +81,7 @@ export default { if (!filename.endsWith(".json")) return - const parts = filename.split("/") + const parts = filename.split(path.sep) const lang = parts.at(-1).split(".")[0] const namespace = parts.at(-2)