From 42b2a99a938c1cc5bb25fc660e3df9f420ba7288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Wed, 25 Mar 2026 15:32:26 +0900 Subject: [PATCH 1/3] refactor: update TypeScript to v6 --- package.json | 3 ++- src/index.js | 11 +++++------ tests/types/tsconfig.json | 2 ++ tsconfig.json | 3 +++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 93dcbde..a861761 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ }, "devDependencies": { "@arethetypeswrong/cli": "^0.18.2", + "@types/natural-compare": "^1.4.3", "@types/node": "^20.19.0", "c8": "^11.0.0", "dedent": "^1.5.3", @@ -86,7 +87,7 @@ "mdast-util-from-markdown": "^2.0.2", "mocha": "^11.3.0", "prettier": "3.8.1", - "typescript": "^5.9.3", + "typescript": "^6.0.2", "yorkie": "^2.0.0" }, "engines": { diff --git a/src/index.js b/src/index.js index 5599533..849f595 100644 --- a/src/index.js +++ b/src/index.js @@ -30,17 +30,16 @@ const plugin = { configs: { recommended: { name: "@eslint/json/recommended", - plugins: {}, + plugins: /** @type {{}} */ ({ + get json() { + return plugin; + }, + }), rules: recommendedRules, }, }, }; -// eslint-disable-next-line no-lone-blocks -- The block syntax { ... } ensures that TypeScript does not get confused about the type of `plugin`. -{ - plugin.configs.recommended.plugins.json = plugin; -} - export default plugin; export { JSONSourceCode }; export * from "./languages/json-language.js"; diff --git a/tests/types/tsconfig.json b/tests/types/tsconfig.json index 373f9d7..14eb608 100644 --- a/tests/types/tsconfig.json +++ b/tests/types/tsconfig.json @@ -4,6 +4,8 @@ "noEmit": true, "rootDir": "../..", "strict": true, + "strictNullChecks": true, + "useUnknownInCatchVariables": true, "exactOptionalPropertyTypes": true, "verbatimModuleSyntax": true, "erasableSyntaxOnly": true diff --git a/tsconfig.json b/tsconfig.json index d52d3f9..24ed175 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,9 @@ "target": "ESNext", "moduleResolution": "NodeNext", "module": "NodeNext", + "rootDir": "./src", + "strictNullChecks": false, + "useUnknownInCatchVariables": false, "types": [] } } From 35cda36a4aa34d7e6b4b0ef82dd650e368ca22e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Fri, 27 Mar 2026 19:51:31 +0900 Subject: [PATCH 2/3] wip --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 849f595..4b535ee 100644 --- a/src/index.js +++ b/src/index.js @@ -30,6 +30,7 @@ const plugin = { configs: { recommended: { name: "@eslint/json/recommended", + // eslint-disable-next-line jsdoc/ts-no-empty-object-type -- The `@type {{}}` syntax ensures that TypeScript does not get confused about the type of `plugin`. plugins: /** @type {{}} */ ({ get json() { return plugin; From 2d19c3b1e4797670f11e442fd4f74e8e36d64e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Thu, 2 Apr 2026 18:25:45 +0900 Subject: [PATCH 3/3] wip --- src/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index 4b535ee..c9b7310 100644 --- a/src/index.js +++ b/src/index.js @@ -30,17 +30,14 @@ const plugin = { configs: { recommended: { name: "@eslint/json/recommended", - // eslint-disable-next-line jsdoc/ts-no-empty-object-type -- The `@type {{}}` syntax ensures that TypeScript does not get confused about the type of `plugin`. - plugins: /** @type {{}} */ ({ - get json() { - return plugin; - }, - }), + plugins: {}, rules: recommendedRules, }, }, }; +Object.assign(plugin.configs.recommended.plugins, { json: plugin }); + export default plugin; export { JSONSourceCode }; export * from "./languages/json-language.js";