From 53fc40fe4f9d0144f5a5977206aaec8e5447af42 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:09:13 +0900 Subject: [PATCH 01/25] chore(repo): normalize package.json field order across packages --- packages/@d-zero/cspell-config/package.json | 16 +++++++------- packages/@d-zero/cz-config/package.json | 22 +++++++++---------- packages/@d-zero/pug-lint-config/package.json | 16 +++++++------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/@d-zero/cspell-config/package.json b/packages/@d-zero/cspell-config/package.json index 012a5bb3..3681dda7 100644 --- a/packages/@d-zero/cspell-config/package.json +++ b/packages/@d-zero/cspell-config/package.json @@ -2,24 +2,24 @@ "name": "@d-zero/cspell-config", "version": "6.0.0-alpha.2", "description": "Configurations of CSpell", + "license": "MIT", + "author": "D-ZERO Co., Ltd.", "repository": { "type": "git", "url": "https://github.com/d-zero-dev/linters.git", "directory": "packages/@d-zero/cspell-config" }, - "author": "D-ZERO Co., Ltd.", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "engines": { - "node": ">=22.0.0" - }, "files": [ "cspell.json" ], "main": "cspell.json", + "publishConfig": { + "access": "public" + }, "dependencies": { "cspell": "10.0.1" + }, + "engines": { + "node": ">=22.0.0" } } diff --git a/packages/@d-zero/cz-config/package.json b/packages/@d-zero/cz-config/package.json index ad7cdf6f..6c99c310 100644 --- a/packages/@d-zero/cz-config/package.json +++ b/packages/@d-zero/cz-config/package.json @@ -2,30 +2,30 @@ "name": "@d-zero/cz-config", "version": "6.0.0-alpha.2", "description": "Configurations of cz-customizable", + "license": "MIT", + "author": "D-ZERO Co., Ltd.", "repository": { "type": "git", "url": "https://github.com/d-zero-dev/linters.git", "directory": "packages/@d-zero/cz-config" }, - "author": "D-ZERO Co., Ltd.", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "engines": { - "node": ">=22.0.0" - }, + "files": [ + "*.js" + ], "type": "commonjs", "exports": { ".": "./index.js", "./ui": "./ui.js", "./scopes": "./scopes.js" }, - "files": [ - "*.js" - ], + "publishConfig": { + "access": "public" + }, "dependencies": { "commitizen": "4.3.2", "cz-customizable": "7.5.4" + }, + "engines": { + "node": ">=22.0.0" } } diff --git a/packages/@d-zero/pug-lint-config/package.json b/packages/@d-zero/pug-lint-config/package.json index 48d74e81..aaf40c0e 100644 --- a/packages/@d-zero/pug-lint-config/package.json +++ b/packages/@d-zero/pug-lint-config/package.json @@ -2,24 +2,24 @@ "name": "@d-zero/pug-lint-config", "version": "6.0.0-alpha.2", "description": "Configurations of pug-lint", + "license": "MIT", + "author": "D-ZERO Co., Ltd.", "repository": { "type": "git", "url": "https://github.com/d-zero-dev/linters.git", "directory": "packages/@d-zero/pug-lint-config" }, - "author": "D-ZERO Co., Ltd.", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "engines": { - "node": ">=22.0.0" - }, "files": [ "index.js" ], "main": "index.js", + "publishConfig": { + "access": "public" + }, "dependencies": { "pug-lint": "2.7.0" + }, + "engines": { + "node": ">=22.0.0" } } From 0afd4cb6a5c668d58759f1074f4abed9dc5ce476 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:09:25 +0900 Subject: [PATCH 02/25] chore(github): normalize line endings to lf via .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..6313b56c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf From 173bd8010d70694283441925da695fc3fba4306e Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:09:31 +0900 Subject: [PATCH 03/25] chore(github): run ci on v6 branch pushes and pull requests --- .github/workflows/publish.yml | 4 ++-- .github/workflows/test.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1fedd751..1446ca6c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: Publish on: push: tags: - - "v*" + - 'v*' concurrency: group: publish @@ -27,7 +27,7 @@ jobs: uses: actions/setup-node@v6 with: node-version: 24 - registry-url: "https://registry.npmjs.org" + registry-url: 'https://registry.npmjs.org' - name: Install dependencies run: yarn install --immutable - name: Build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23843ad0..8b7c5e29 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - v6 pull_request: branches: - main From a57fd53f9fa50897bc16cca5572124d86e9f638d Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:10:18 +0900 Subject: [PATCH 04/25] feat(oxlint): add shared oxlint configuration package --- packages/@d-zero/oxlint-config/README.md | 53 +++++++ packages/@d-zero/oxlint-config/index.js | 148 ++++++++++++++++++++ packages/@d-zero/oxlint-config/package.json | 25 ++++ 3 files changed, 226 insertions(+) create mode 100644 packages/@d-zero/oxlint-config/README.md create mode 100644 packages/@d-zero/oxlint-config/index.js create mode 100644 packages/@d-zero/oxlint-config/package.json diff --git a/packages/@d-zero/oxlint-config/README.md b/packages/@d-zero/oxlint-config/README.md new file mode 100644 index 00000000..c84ffde1 --- /dev/null +++ b/packages/@d-zero/oxlint-config/README.md @@ -0,0 +1,53 @@ +# `@d-zero/oxlint-config` + +## 個別インストール + +```sh +npm install -D @d-zero/oxlint-config +``` + +## 使い方 + +`oxlint.config.mts`(TypeScript を使わないプロジェクトでは`oxlint.config.mjs`)を作成し、`import`から設定を読み込みます。 + +```ts +import config from '@d-zero/oxlint-config'; + +export default { + ...config, +}; +``` + +### 拡張 + +プロジェクトに合わせて設定を追加します。 + +```ts +import config from '@d-zero/oxlint-config'; + +export default { + ...config, + rules: { + ...config.rules, + // 例: no-consoleを無効にする + 'no-console': 'off', + }, +}; +``` + +### `@d-zero/oxlint-plugin`との併用 + +D-ZERO 独自ルールを利用する場合は[`@d-zero/oxlint-plugin`](../oxlint-plugin/)を`jsPlugins`に追加します。 + +```ts +import config from '@d-zero/oxlint-config'; + +export default { + ...config, + jsPlugins: ['@d-zero/oxlint-plugin'], + rules: { + ...config.rules, + '@d-zero/no-click-event': 'warn', + }, +}; +``` diff --git a/packages/@d-zero/oxlint-config/index.js b/packages/@d-zero/oxlint-config/index.js new file mode 100644 index 00000000..c3bd4fc9 --- /dev/null +++ b/packages/@d-zero/oxlint-config/index.js @@ -0,0 +1,148 @@ +/** + * oxlint はプラグインを有効にしても correctness カテゴリ以外のルールはデフォルトで無効なため、 + * このリストで個別に有効化している。severity は`@d-zero/eslint-config`にそろえている。 + * @type {import('oxlint').OxlintConfig} + */ +export default { + plugins: ['eslint', 'typescript', 'unicorn', 'import', 'jsdoc'], + categories: { + correctness: 'error', + }, + rules: { + 'import/no-duplicates': 'warn', + 'import/no-named-as-default-member': 'warn', + 'jsdoc/check-access': 'warn', + 'jsdoc/empty-tags': 'warn', + 'jsdoc/require-param': 'warn', + 'jsdoc/require-param-name': 'warn', + 'jsdoc/require-throws-type': 'warn', + 'jsdoc/require-yields-type': 'warn', + 'no-array-constructor': 'error', + 'no-case-declarations': 'error', + 'no-console': 'warn', + 'no-empty': 'error', + 'no-fallthrough': 'error', + 'no-prototype-builtins': 'error', + 'no-regex-spaces': 'error', + 'no-unexpected-multiline': 'error', + 'no-var': 'error', + 'prefer-const': 'error', + 'prefer-regex-literals': 'error', + 'prefer-rest-params': 'error', + 'prefer-spread': 'error', + 'typescript/adjacent-overload-signatures': 'error', + 'typescript/consistent-type-imports': 'warn', + 'typescript/no-empty-object-type': 'error', + 'typescript/no-explicit-any': 'warn', + 'typescript/no-namespace': 'error', + 'typescript/no-require-imports': 'error', + 'typescript/no-unnecessary-type-assertion': 'error', + 'typescript/no-unnecessary-type-constraint': 'error', + 'typescript/no-unsafe-function-type': 'error', + 'typescript/no-var-requires': 'error', + 'typescript/require-await': 'error', + 'unicorn/catch-error-name': 'error', + 'unicorn/consistent-assert': 'error', + 'unicorn/consistent-date-clone': 'error', + 'unicorn/consistent-empty-array-spread': 'error', + 'unicorn/consistent-existence-index-check': 'error', + 'unicorn/empty-brace-spaces': 'error', + 'unicorn/error-message': 'error', + 'unicorn/escape-case': 'error', + 'unicorn/explicit-length-check': 'error', + 'unicorn/filename-case': 'error', + 'unicorn/import-style': 'error', + 'unicorn/new-for-builtins': 'error', + 'unicorn/no-abusive-eslint-disable': 'error', + 'unicorn/no-accessor-recursion': 'error', + 'unicorn/no-array-for-each': 'error', + 'unicorn/no-array-method-this-argument': 'error', + 'unicorn/no-array-reduce': 'error', + 'unicorn/no-array-reverse': 'error', + 'unicorn/no-array-sort': 'error', + 'unicorn/no-await-expression-member': 'error', + 'unicorn/no-console-spaces': 'error', + 'unicorn/no-document-cookie': 'error', + 'unicorn/no-hex-escape': 'error', + 'unicorn/no-immediate-mutation': 'error', + 'unicorn/no-instanceof-builtins': 'error', + 'unicorn/no-lonely-if': 'error', + 'unicorn/no-magic-array-flat-depth': 'error', + 'unicorn/no-negated-condition': 'error', + 'unicorn/no-negation-in-equality-check': 'error', + 'unicorn/no-new-buffer': 'error', + 'unicorn/no-object-as-default-parameter': 'error', + 'unicorn/no-static-only-class': 'error', + 'unicorn/no-this-assignment': 'error', + 'unicorn/no-typeof-undefined': 'error', + 'unicorn/no-unnecessary-array-flat-depth': 'error', + 'unicorn/no-unnecessary-array-splice-count': 'error', + 'unicorn/no-unnecessary-slice-end': 'error', + 'unicorn/no-unreadable-array-destructuring': 'error', + 'unicorn/no-unreadable-iife': 'error', + 'unicorn/no-useless-collection-argument': 'error', + 'unicorn/no-useless-error-capture-stack-trace': 'error', + 'unicorn/no-useless-promise-resolve-reject': 'error', + 'unicorn/no-useless-switch-case': 'error', + 'unicorn/no-useless-undefined': 'error', + 'unicorn/no-zero-fractions': 'error', + 'unicorn/number-literal-case': 'error', + 'unicorn/numeric-separators-style': 'error', + 'unicorn/prefer-add-event-listener': 'error', + 'unicorn/prefer-array-find': 'error', + 'unicorn/prefer-array-flat': 'error', + 'unicorn/prefer-array-flat-map': 'error', + 'unicorn/prefer-array-index-of': 'error', + 'unicorn/prefer-array-some': 'error', + 'unicorn/prefer-at': 'error', + 'unicorn/prefer-bigint-literals': 'error', + 'unicorn/prefer-blob-reading-methods': 'error', + 'unicorn/prefer-class-fields': 'error', + 'unicorn/prefer-classlist-toggle': 'error', + 'unicorn/prefer-code-point': 'error', + 'unicorn/prefer-date-now': 'error', + 'unicorn/prefer-default-parameters': 'error', + 'unicorn/prefer-dom-node-append': 'error', + 'unicorn/prefer-dom-node-dataset': 'error', + 'unicorn/prefer-dom-node-remove': 'error', + 'unicorn/prefer-dom-node-text-content': 'error', + 'unicorn/prefer-event-target': 'error', + 'unicorn/prefer-export-from': 'error', + 'unicorn/prefer-includes': 'error', + 'unicorn/prefer-keyboard-event-key': 'error', + 'unicorn/prefer-logical-operator-over-ternary': 'error', + 'unicorn/prefer-math-min-max': 'error', + 'unicorn/prefer-math-trunc': 'error', + 'unicorn/prefer-modern-dom-apis': 'error', + 'unicorn/prefer-modern-math-apis': 'error', + 'unicorn/prefer-module': 'error', + 'unicorn/prefer-native-coercion-functions': 'error', + 'unicorn/prefer-negative-index': 'error', + 'unicorn/prefer-node-protocol': 'error', + 'unicorn/prefer-number-properties': 'error', + 'unicorn/prefer-object-from-entries': 'error', + 'unicorn/prefer-optional-catch-binding': 'error', + 'unicorn/prefer-prototype-methods': 'error', + 'unicorn/prefer-reflect-apply': 'error', + 'unicorn/prefer-regexp-test': 'error', + 'unicorn/prefer-response-static-json': 'error', + 'unicorn/prefer-set-has': 'error', + 'unicorn/prefer-single-call': 'error', + 'unicorn/prefer-spread': 'error', + 'unicorn/prefer-string-replace-all': 'error', + 'unicorn/prefer-string-slice': 'error', + 'unicorn/prefer-string-trim-start-end': 'error', + 'unicorn/prefer-structured-clone': 'error', + 'unicorn/prefer-top-level-await': 'error', + 'unicorn/prefer-type-error': 'error', + 'unicorn/relative-url-style': 'error', + 'unicorn/require-array-join-separator': 'error', + 'unicorn/require-module-attributes': 'error', + 'unicorn/require-module-specifiers': 'error', + 'unicorn/require-number-to-fixed-digits-argument': 'error', + 'unicorn/switch-case-braces': 'error', + 'unicorn/text-encoding-identifier-case': 'error', + 'unicorn/throw-new-error': 'error', + }, + ignorePatterns: ['**/lib/**/*'], +}; diff --git a/packages/@d-zero/oxlint-config/package.json b/packages/@d-zero/oxlint-config/package.json new file mode 100644 index 00000000..091b9a4b --- /dev/null +++ b/packages/@d-zero/oxlint-config/package.json @@ -0,0 +1,25 @@ +{ + "name": "@d-zero/oxlint-config", + "version": "6.0.0-alpha.2", + "description": "Configurations of Oxlint", + "license": "MIT", + "author": "D-ZERO Co., Ltd.", + "repository": { + "type": "git", + "url": "https://github.com/d-zero-dev/linters.git", + "directory": "packages/@d-zero/oxlint-config" + }, + "files": [ + "index.js" + ], + "type": "module", + "exports": { + ".": "./index.js" + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=22.0.0" + } +} From 149213ec00ccd6a4be8288427d83e805df29fb73 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:10:28 +0900 Subject: [PATCH 05/25] feat(oxlint-plugin): add custom oxlint rules package --- packages/@d-zero/oxlint-plugin/README.md | 43 ++++++++++ packages/@d-zero/oxlint-plugin/index.js | 70 ++++++++++++++++ packages/@d-zero/oxlint-plugin/index.spec.js | 85 ++++++++++++++++++++ packages/@d-zero/oxlint-plugin/package.json | 31 +++++++ 4 files changed, 229 insertions(+) create mode 100644 packages/@d-zero/oxlint-plugin/README.md create mode 100644 packages/@d-zero/oxlint-plugin/index.js create mode 100644 packages/@d-zero/oxlint-plugin/index.spec.js create mode 100644 packages/@d-zero/oxlint-plugin/package.json diff --git a/packages/@d-zero/oxlint-plugin/README.md b/packages/@d-zero/oxlint-plugin/README.md new file mode 100644 index 00000000..a9c388fc --- /dev/null +++ b/packages/@d-zero/oxlint-plugin/README.md @@ -0,0 +1,43 @@ +# `@d-zero/oxlint-plugin` + +Custom Oxlint rules for D-ZERO. + +## Installation + +```sh +npm install @d-zero/oxlint-plugin --save-dev +``` + +## Configuration + +Add the following to your `oxlint.config.mts`: + +```ts +import config from '@d-zero/oxlint-config'; + +export default { + ...config, + jsPlugins: ['@d-zero/oxlint-plugin'], + rules: { + ...config.rules, + '@d-zero/no-click-event': 'warn', + }, +}; +``` + +## Rules + +### `@d-zero/no-click-event` + +Disallows click event handlers in favor of the [Invoker Commands API](https://developer.mozilla.org/docs/Web/API/Invoker_Commands_API). + +**Detected patterns:** + +- `addEventListener('click', ...)` +- `element.onclick = ...` +- jQuery `.on('click', ...)` and `.click(handler)` +- React `onClick={...}` + +**Not detected (v6):** + +- Vue `@click` and `v-on:click` — see [MIGRATION-v6.md](../../../MIGRATION-v6.md) diff --git a/packages/@d-zero/oxlint-plugin/index.js b/packages/@d-zero/oxlint-plugin/index.js new file mode 100644 index 00000000..50e1e621 --- /dev/null +++ b/packages/@d-zero/oxlint-plugin/index.js @@ -0,0 +1,70 @@ +import { readFileSync } from 'node:fs'; + +const packageJson = JSON.parse( + readFileSync(new URL('package.json', import.meta.url), 'utf8'), +); + +const message = + 'Avoid using click events. Consider using the Invoker Commands API instead. See: https://developer.mozilla.org/docs/Web/API/Invoker_Commands_API'; + +export default { + meta: { + name: '@d-zero/oxlint-plugin', + version: packageJson.version, + }, + rules: { + 'no-click-event': { + meta: { + type: 'suggestion', + docs: { + description: 'Disallow click event handlers in favor of Invoker Commands API', + }, + messages: { + noClickEvent: message, + }, + schema: [], + }, + create(context) { + const report = (node) => context.report({ node, messageId: 'noClickEvent' }); + + return { + 'CallExpression[callee.property.name="addEventListener"]'(node) { + if ( + node.arguments[0]?.type === 'Literal' && + node.arguments[0].value === 'click' + ) { + report(node); + } + }, + 'AssignmentExpression[left.type="MemberExpression"][left.property.name="onclick"]': + report, + 'CallExpression[callee.type="MemberExpression"][callee.property.name="on"]'( + node, + ) { + if ( + node.arguments[0]?.type === 'Literal' && + node.arguments[0].value === 'click' + ) { + report(node); + } + }, + 'CallExpression[callee.type="MemberExpression"][callee.property.name="click"]'( + node, + ) { + if (node.arguments.length === 0) return; + const object = node.callee.object; + if ( + (object.type === 'CallExpression' && + object.callee.type === 'Identifier' && + (object.callee.name === '$' || object.callee.name === 'jQuery')) || + (object.type === 'Identifier' && object.name.startsWith('$')) + ) { + report(node); + } + }, + 'JSXAttribute[name.name="onClick"]': report, + }; + }, + }, + }, +}; diff --git a/packages/@d-zero/oxlint-plugin/index.spec.js b/packages/@d-zero/oxlint-plugin/index.spec.js new file mode 100644 index 00000000..fd6637e6 --- /dev/null +++ b/packages/@d-zero/oxlint-plugin/index.spec.js @@ -0,0 +1,85 @@ +import { Linter } from 'eslint'; +import { describe, test, expect } from 'vitest'; + +import plugin from './index.js'; + +const linter = new Linter(); + +/** + * @param {string} code + * @param {{ jsx?: boolean }} [options] + */ +function lint(code, { jsx = false } = {}) { + const messages = linter.verify(code, { + languageOptions: { + ecmaVersion: 2023, + sourceType: 'module', + parserOptions: jsx ? { ecmaFeatures: { jsx: true } } : undefined, + }, + plugins: { '@d-zero': plugin }, + rules: { '@d-zero/no-click-event': 'error' }, + }); + + return messages.map((message) => message.messageId); +} + +describe('no-click-event', () => { + test.each([ + ['element.addEventListener("focus", handler)'], + ['element.onfocus = handler'], + ['$element.on("hover", handler)'], + ['document.body.click()'], + ['element.click()'], + ['document.getElementById("btn").click()'], + ['$element.click()'], + ['$(".button").click()'], + ['jQuery("#btn").click()'], + ['button.commandfor = "target-id"'], + ['button.command = "show-modal"'], + ])('valid: %s', (code) => { + expect(lint(code)).toStrictEqual([]); + }); + + test.each([ + ['', { jsx: true }], + ['', { jsx: true }], + ])('valid (jsx): %s', (code, options) => { + expect(lint(code, options)).toStrictEqual([]); + }); + + test.each([ + ['element.addEventListener("click", handler)'], + ["element.addEventListener('click', () => {})"], + ])('invalid: addEventListener pattern - %s', (code) => { + expect(lint(code)).toStrictEqual(['noClickEvent']); + }); + + test.each([ + ['element.onclick = handler'], + ['document.getElementById("btn").onclick = () => {}'], + ])('invalid: onclick property pattern - %s', (code) => { + expect(lint(code)).toStrictEqual(['noClickEvent']); + }); + + test.each([ + ['$element.on("click", handler)'], + ["jQuery('#btn').on('click', function() {})"], + ])('invalid: jQuery .on("click") pattern - %s', (code) => { + expect(lint(code)).toStrictEqual(['noClickEvent']); + }); + + test.each([ + ['$element.click(handler)'], + ['$(".button").click(function() {})'], + ['jQuery("#btn").click(handler)'], + ])('invalid: jQuery .click(handler) pattern - %s', (code) => { + expect(lint(code)).toStrictEqual(['noClickEvent']); + }); + + test.each([ + ['', { jsx: true }], + ['
console.log("clicked")}>Click
', { jsx: true }], + ])('invalid: React onClick pattern - %s', (code, options) => { + expect(lint(code, options)).toStrictEqual(['noClickEvent']); + }); +}); diff --git a/packages/@d-zero/oxlint-plugin/package.json b/packages/@d-zero/oxlint-plugin/package.json new file mode 100644 index 00000000..67323990 --- /dev/null +++ b/packages/@d-zero/oxlint-plugin/package.json @@ -0,0 +1,31 @@ +{ + "name": "@d-zero/oxlint-plugin", + "version": "6.0.0-alpha.2", + "description": "Custom Oxlint rules for D-ZERO", + "license": "MIT", + "author": "D-ZERO Co., Ltd.", + "repository": { + "type": "git", + "url": "https://github.com/d-zero-dev/linters.git", + "directory": "packages/@d-zero/oxlint-plugin" + }, + "files": [ + "index.js" + ], + "type": "module", + "exports": { + ".": "./index.js" + }, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "eslint": "9.39.5" + }, + "peerDependencies": { + "oxlint": ">=1.0.0" + }, + "engines": { + "node": ">=22.0.0" + } +} From 1cd2949d4adcba9c60c148c6a0b3d91e78bc778b Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:10:38 +0900 Subject: [PATCH 06/25] feat(prettier): add astro formatting support --- packages/@d-zero/prettier-config/README.md | 15 +++++---- packages/@d-zero/prettier-config/astro.js | 3 ++ packages/@d-zero/prettier-config/index.js | 4 ++- packages/@d-zero/prettier-config/package.json | 33 +++++++++++-------- 4 files changed, 33 insertions(+), 22 deletions(-) create mode 100644 packages/@d-zero/prettier-config/astro.js diff --git a/packages/@d-zero/prettier-config/README.md b/packages/@d-zero/prettier-config/README.md index 729e060d..53b7c690 100644 --- a/packages/@d-zero/prettier-config/README.md +++ b/packages/@d-zero/prettier-config/README.md @@ -3,10 +3,10 @@ ## 個別インストール ```sh -npm install -D @d-zero/prettier-config @prettier/plugin-pug +npm install -D @d-zero/prettier-config @prettier/plugin-pug prettier-plugin-astro ``` -`@d-zero/prettier-config/base`を利用する場合は、`@prettier/plugin-pug`をインストールする必要はありません。 +`@d-zero/prettier-config/base`を利用する場合は、`@prettier/plugin-pug`と`prettier-plugin-astro`をインストールする必要はありません。 ## 使い方 @@ -32,11 +32,12 @@ export default { ## 種類別プリセット -| パッケージパス | 用途 | -| ------------------------------ | -------------------------- | -| `@d-zero/prettier-config` | フルセット(ベース + Pug) | -| `@d-zero/prettier-config/base` | 基本セット(Pugなし) | -| `@d-zero/prettier-config/pug` | Pug関連設定のみ | +| パッケージパス | 用途 | +| ------------------------------- | ---------------------------------- | +| `@d-zero/prettier-config` | フルセット(ベース + Pug + Astro) | +| `@d-zero/prettier-config/base` | 基本セット(Pugなし) | +| `@d-zero/prettier-config/astro` | Astro関連設定のみ | +| `@d-zero/prettier-config/pug` | Pug関連設定のみ | `@d-zero/prettier-config`はすべての設定を含んでいるので、一部の設定のみを利用する場合は、それぞれ種類別のものを利用します。 diff --git a/packages/@d-zero/prettier-config/astro.js b/packages/@d-zero/prettier-config/astro.js new file mode 100644 index 00000000..86dd776b --- /dev/null +++ b/packages/@d-zero/prettier-config/astro.js @@ -0,0 +1,3 @@ +export default { + plugins: ['prettier-plugin-astro'], +}; diff --git a/packages/@d-zero/prettier-config/index.js b/packages/@d-zero/prettier-config/index.js index 8c13b960..7b05f281 100644 --- a/packages/@d-zero/prettier-config/index.js +++ b/packages/@d-zero/prettier-config/index.js @@ -1,9 +1,11 @@ +import astro from './astro.js'; import base from './base.js'; import pug from './pug.js'; export default { ...base, ...pug, - plugins: [...(base.plugins ?? []), ...(pug.plugins ?? [])], + ...astro, + plugins: [...(base.plugins ?? []), ...(pug.plugins ?? []), ...(astro.plugins ?? [])], overrides: [...(base.overrides ?? []), ...(pug.overrides ?? [])], }; diff --git a/packages/@d-zero/prettier-config/package.json b/packages/@d-zero/prettier-config/package.json index 6079bb8d..94e5a3f6 100644 --- a/packages/@d-zero/prettier-config/package.json +++ b/packages/@d-zero/prettier-config/package.json @@ -2,19 +2,16 @@ "name": "@d-zero/prettier-config", "version": "6.0.0-alpha.2", "description": "Configurations of Prettier", + "license": "MIT", + "author": "D-ZERO Co., Ltd.", "repository": { "type": "git", "url": "https://github.com/d-zero-dev/linters.git", "directory": "packages/@d-zero/prettier-config" }, - "author": "D-ZERO Co., Ltd.", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "engines": { - "node": ">=22.0.0" - }, + "files": [ + "*.js" + ], "type": "module", "exports": { ".": { @@ -23,20 +20,28 @@ "./base": { "import": "./base.js" }, + "./astro": { + "import": "./astro.js" + }, "./pug": { "import": "./pug.js" } }, - "files": [ - "*.js" - ], + "publishConfig": { + "access": "public" + }, "dependencies": { "prettier": "3.9.6" }, + "devDependencies": { + "@prettier/plugin-pug": "3.4.2", + "prettier-plugin-astro": "0.14.1" + }, "optionalDependencies": { - "@prettier/plugin-pug": ">=3.0.0" + "@prettier/plugin-pug": ">=3.0.0", + "prettier-plugin-astro": ">=0.14.1" }, - "devDependencies": { - "@prettier/plugin-pug": "3.4.2" + "engines": { + "node": ">=22.0.0" } } From 28c919b58b823934f96cbaf427181f99ce0ec8dd Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:10:49 +0900 Subject: [PATCH 07/25] feat(lint-staged): switch default command mapping to oxlint and oxfmt --- .../@d-zero/lint-staged-config/package.json | 22 +++---- .../lint-staged-config/src/commands.ts | 2 + .../lint-staged-config/src/default-mapping.ts | 38 +++++------ .../lint-staged-config/src/index.spec.ts | 65 ++++++++++++++++++- .../@d-zero/lint-staged-config/src/types.ts | 10 ++- 5 files changed, 103 insertions(+), 34 deletions(-) diff --git a/packages/@d-zero/lint-staged-config/package.json b/packages/@d-zero/lint-staged-config/package.json index 64e110dc..33931943 100644 --- a/packages/@d-zero/lint-staged-config/package.json +++ b/packages/@d-zero/lint-staged-config/package.json @@ -2,31 +2,31 @@ "name": "@d-zero/lint-staged-config", "version": "6.0.0-alpha.2", "description": "Configurations of lint-staged", + "license": "MIT", + "author": "D-ZERO Co., Ltd.", "repository": { "type": "git", "url": "https://github.com/d-zero-dev/linters.git", "directory": "packages/@d-zero/lint-staged-config" }, - "author": "D-ZERO Co., Ltd.", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "engines": { - "node": ">=22.0.0" - }, + "files": [ + "dist" + ], "type": "module", "exports": { "import": "./dist/index.js", "types": "./dist/index.d.ts" }, - "files": [ - "dist" - ], + "publishConfig": { + "access": "public" + }, "scripts": { "build": "tsc" }, "dependencies": { "lint-staged": "17.3.0" + }, + "engines": { + "node": ">=22.0.0" } } diff --git a/packages/@d-zero/lint-staged-config/src/commands.ts b/packages/@d-zero/lint-staged-config/src/commands.ts index e9d62135..d72cf3f0 100644 --- a/packages/@d-zero/lint-staged-config/src/commands.ts +++ b/packages/@d-zero/lint-staged-config/src/commands.ts @@ -4,6 +4,8 @@ export const commands: Record = { cspell: 'cspell --no-must-find-files --show-suggestions', eslint: 'eslint --fix', markuplint: 'markuplint', + oxfmt: 'oxfmt --write', + oxlint: 'oxlint --fix', prettier: 'prettier --write', puglint: 'pug-lint', stylelint: 'stylelint --fix', diff --git a/packages/@d-zero/lint-staged-config/src/default-mapping.ts b/packages/@d-zero/lint-staged-config/src/default-mapping.ts index e57fe2df..00a5a4e4 100644 --- a/packages/@d-zero/lint-staged-config/src/default-mapping.ts +++ b/packages/@d-zero/lint-staged-config/src/default-mapping.ts @@ -1,24 +1,24 @@ import type { CommandMappings } from './types.js'; export const defaultMapping: CommandMappings = { - astro: ['eslint', 'markuplint', 'prettier', 'cspell'], - cjs: ['eslint', 'prettier', 'cspell'], - css: ['stylelint', 'prettier', 'cspell'], - cts: ['eslint', 'prettier', 'cspell'], - html: ['markuplint', 'prettier', 'cspell'], - js: ['eslint', 'prettier', 'cspell'], - json: ['prettier', 'cspell'], - jsx: ['eslint', 'markuplint', 'prettier', 'cspell'], - md: ['prettier', 'textlint', 'cspell'], - mdx: ['prettier', 'textlint', 'cspell'], - mjs: ['eslint', 'prettier', 'cspell'], - mts: ['eslint', 'prettier', 'cspell'], + astro: ['oxlint', 'markuplint', 'prettier', 'cspell'], + cjs: ['oxlint', 'oxfmt', 'cspell'], + css: ['stylelint', 'oxfmt', 'cspell'], + cts: ['oxlint', 'oxfmt', 'cspell'], + html: ['markuplint', 'oxfmt', 'cspell'], + js: ['oxlint', 'oxfmt', 'cspell'], + json: ['oxfmt', 'cspell'], + jsx: ['oxlint', 'markuplint', 'oxfmt', 'cspell'], + md: ['oxfmt', 'textlint', 'cspell'], + mdx: ['oxfmt', 'textlint', 'cspell'], + mjs: ['oxlint', 'oxfmt', 'cspell'], + mts: ['oxlint', 'oxfmt', 'cspell'], pug: ['markuplint', 'prettier', 'cspell'], - scss: ['stylelint', 'prettier', 'cspell'], - svelte: ['eslint', 'markuplint', 'prettier', 'cspell'], - ts: ['eslint', 'prettier', 'cspell'], - tsx: ['eslint', 'markuplint', 'prettier', 'cspell'], - vue: ['eslint', 'markuplint', 'prettier', 'cspell'], - yaml: ['cspell'], - yml: ['cspell'], + scss: ['stylelint', 'oxfmt', 'cspell'], + svelte: ['oxlint', 'markuplint', 'oxfmt', 'cspell'], + ts: ['oxlint', 'oxfmt', 'cspell'], + tsx: ['oxlint', 'markuplint', 'oxfmt', 'cspell'], + vue: ['oxlint', 'markuplint', 'oxfmt', 'cspell'], + yaml: ['oxfmt', 'cspell'], + yml: ['oxfmt', 'cspell'], }; diff --git a/packages/@d-zero/lint-staged-config/src/index.spec.ts b/packages/@d-zero/lint-staged-config/src/index.spec.ts index ea0edef1..34fc16e6 100644 --- a/packages/@d-zero/lint-staged-config/src/index.spec.ts +++ b/packages/@d-zero/lint-staged-config/src/index.spec.ts @@ -26,7 +26,7 @@ describe('lintStagedConfigGenerator', () => { const config = lintStagedConfigGenerator(); const commands = toRelativePath(...config([resolve('README.md')])); expect(commands).toStrictEqual([ - 'prettier --write "./README.md"', + 'oxfmt --write "./README.md"', 'textlint "./README.md"', 'cspell --no-must-find-files --show-suggestions "./README.md"', ]); @@ -44,12 +44,71 @@ describe('lintStagedConfigGenerator', () => { ); expect(commands).toStrictEqual([ - 'prettier --write "./packages/@d-zero/lint-staged-config/CHANGELOG.md"', + 'oxfmt --write "./packages/@d-zero/lint-staged-config/CHANGELOG.md"', 'textlint "./packages/@d-zero/lint-staged-config/CHANGELOG.md"', 'cspell --no-must-find-files --show-suggestions "./packages/@d-zero/lint-staged-config/CHANGELOG.md"', ]); }); + test('ts extension mapping uses oxlint and oxfmt', () => { + const config = lintStagedConfigGenerator(); + const commands = toRelativePath(...config([resolve('src', 'index.ts')])); + expect(commands).toStrictEqual([ + 'oxlint --fix "./src/index.ts"', + 'oxfmt --write "./src/index.ts"', + 'cspell --no-must-find-files --show-suggestions "./src/index.ts"', + ]); + }); + + test('vue extension mapping uses oxlint, markuplint and oxfmt', () => { + const config = lintStagedConfigGenerator(); + const commands = toRelativePath(...config([resolve('src', 'App.vue')])); + expect(commands).toStrictEqual([ + 'oxlint --fix "./src/App.vue"', + 'markuplint "./src/App.vue"', + 'oxfmt --write "./src/App.vue"', + 'cspell --no-must-find-files --show-suggestions "./src/App.vue"', + ]); + }); + + test('css extension mapping uses stylelint and oxfmt', () => { + const config = lintStagedConfigGenerator(); + const commands = toRelativePath(...config([resolve('src', 'style.css')])); + expect(commands).toStrictEqual([ + 'stylelint --fix "./src/style.css"', + 'oxfmt --write "./src/style.css"', + 'cspell --no-must-find-files --show-suggestions "./src/style.css"', + ]); + }); + + test('html extension mapping uses markuplint and oxfmt', () => { + const config = lintStagedConfigGenerator(); + const commands = toRelativePath(...config([resolve('src', 'index.html')])); + expect(commands).toStrictEqual([ + 'markuplint "./src/index.html"', + 'oxfmt --write "./src/index.html"', + 'cspell --no-must-find-files --show-suggestions "./src/index.html"', + ]); + }); + + test('json extension mapping uses oxfmt (no oxlint)', () => { + const config = lintStagedConfigGenerator(); + const commands = toRelativePath(...config([resolve('package.json')])); + expect(commands).toStrictEqual([ + 'oxfmt --write "./package.json"', + 'cspell --no-must-find-files --show-suggestions "./package.json"', + ]); + }); + + test('yaml extension mapping uses oxfmt', () => { + const config = lintStagedConfigGenerator(); + const commands = toRelativePath(...config([resolve('config.yaml')])); + expect(commands).toStrictEqual([ + 'oxfmt --write "./config.yaml"', + 'cspell --no-must-find-files --show-suggestions "./config.yaml"', + ]); + }); + test('ignore option (IgnoreMap)', () => { const config = lintStagedConfigGenerator({ ignore: [ @@ -67,7 +126,7 @@ describe('lintStagedConfigGenerator', () => { ); expect(commands).toStrictEqual([ - 'prettier --write "./packages/@d-zero/lint-staged-config/CHANGELOG.md"', + 'oxfmt --write "./packages/@d-zero/lint-staged-config/CHANGELOG.md"', 'cspell --no-must-find-files --show-suggestions "./packages/@d-zero/lint-staged-config/CHANGELOG.md"', ]); }); diff --git a/packages/@d-zero/lint-staged-config/src/types.ts b/packages/@d-zero/lint-staged-config/src/types.ts index eea66377..a11dc7a8 100644 --- a/packages/@d-zero/lint-staged-config/src/types.ts +++ b/packages/@d-zero/lint-staged-config/src/types.ts @@ -21,7 +21,15 @@ export type TargetFileExtension = | 'yml'; export type CommandType = - 'cspell' | 'eslint' | 'markuplint' | 'prettier' | 'puglint' | 'stylelint' | 'textlint'; + | 'cspell' + | 'eslint' + | 'markuplint' + | 'oxfmt' + | 'oxlint' + | 'prettier' + | 'puglint' + | 'stylelint' + | 'textlint'; export type CommandMappings = Readonly< Partial> From f3130a127e29a7e4ea18076fab08dea34f8e2bdc Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:10:58 +0900 Subject: [PATCH 08/25] refactor(csstree-scss-syntax): convert eslint-disable comment to oxlint-disable --- packages/@d-zero/csstree-scss-syntax/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@d-zero/csstree-scss-syntax/src/index.ts b/packages/@d-zero/csstree-scss-syntax/src/index.ts index f9834037..e72b8bce 100644 --- a/packages/@d-zero/csstree-scss-syntax/src/index.ts +++ b/packages/@d-zero/csstree-scss-syntax/src/index.ts @@ -27,7 +27,7 @@ const forked = CSSTree.fork( switch (this.tokenType) { case DELIM: { // @ts-ignore - // eslint-disable-next-line unicorn/prefer-code-point + // oxlint-disable-next-line unicorn/prefer-code-point -- this is css-tree's TokenStream, not a string; it has no codePointAt const code = this.charCodeAt(this.tokenStart); if (code === DOLLAR_SIGN) { From aa569c252ab7ca7ee4a1e9fb0af7c5afd4345a52 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:11:10 +0900 Subject: [PATCH 09/25] refactor(eslint-plugin): drop typescript-eslint dependency --- packages/@d-zero/eslint-plugin/package.json | 6 +-- .../src/rules/no-click-event/index.spec.ts | 5 +- .../src/rules/no-click-event/index.ts | 46 +++++++++---------- .../eslint-plugin/src/utils/create-rule.ts | 27 ++++++++++- 4 files changed, 51 insertions(+), 33 deletions(-) diff --git a/packages/@d-zero/eslint-plugin/package.json b/packages/@d-zero/eslint-plugin/package.json index 1de2f650..cd2b1b90 100644 --- a/packages/@d-zero/eslint-plugin/package.json +++ b/packages/@d-zero/eslint-plugin/package.json @@ -22,12 +22,8 @@ "scripts": { "build": "tsc" }, - "dependencies": { - "@typescript-eslint/utils": "8.67.0" - }, "devDependencies": { - "@typescript-eslint/parser": "8.67.0", - "@typescript-eslint/rule-tester": "8.67.0", + "@types/estree": "1.0.8", "eslint": "9.39.5", "vue-eslint-parser": "10.4.1" }, diff --git a/packages/@d-zero/eslint-plugin/src/rules/no-click-event/index.spec.ts b/packages/@d-zero/eslint-plugin/src/rules/no-click-event/index.spec.ts index 3d4da5ad..2bae2e87 100644 --- a/packages/@d-zero/eslint-plugin/src/rules/no-click-event/index.spec.ts +++ b/packages/@d-zero/eslint-plugin/src/rules/no-click-event/index.spec.ts @@ -1,9 +1,8 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; -import { afterAll, describe, it } from 'vitest'; +import { RuleTester } from 'eslint'; +import { describe, it } from 'vitest'; import rule from './index.js'; -RuleTester.afterAll = afterAll; RuleTester.describe = describe; RuleTester.it = it; diff --git a/packages/@d-zero/eslint-plugin/src/rules/no-click-event/index.ts b/packages/@d-zero/eslint-plugin/src/rules/no-click-event/index.ts index 14ba3765..ff7b2305 100644 --- a/packages/@d-zero/eslint-plugin/src/rules/no-click-event/index.ts +++ b/packages/@d-zero/eslint-plugin/src/rules/no-click-event/index.ts @@ -1,4 +1,6 @@ -import type { TSESTree } from '@typescript-eslint/utils'; +import type { Rule } from 'eslint'; +import type { AssignmentExpression, CallExpression, MemberExpression } from 'estree'; +import type { AST } from 'vue-eslint-parser'; import { createRule } from '../../utils/create-rule.js'; @@ -15,18 +17,15 @@ export default createRule({ }, schema: [], // No options }, - defaultOptions: [], - create(context) { + create(context): Rule.RuleListener { return { // Pattern 1: addEventListener('click', ...) - 'CallExpression[callee.property.name="addEventListener"]'( - node: TSESTree.CallExpression, - ) { + 'CallExpression[callee.property.name="addEventListener"]'(node: CallExpression) { const args = node.arguments; const firstArg = args[0]; if (firstArg && firstArg.type === 'Literal' && firstArg.value === 'click') { context.report({ - node, + node: node as unknown as Rule.Node, messageId: 'noClickEvent', }); } @@ -34,22 +33,22 @@ export default createRule({ // Pattern 2: element.onclick = ... 'AssignmentExpression[left.type="MemberExpression"][left.property.name="onclick"]'( - node: TSESTree.AssignmentExpression, + node: AssignmentExpression, ) { context.report({ - node, + node: node as unknown as Rule.Node, messageId: 'noClickEvent', }); }, // Pattern 3: jQuery .on('click', ...) 'CallExpression[callee.type="MemberExpression"][callee.property.name="on"]'( - node: TSESTree.CallExpression, + node: CallExpression, ) { const firstArg = node.arguments[0]; if (firstArg && firstArg.type === 'Literal' && firstArg.value === 'click') { context.report({ - node, + node: node as unknown as Rule.Node, messageId: 'noClickEvent', }); } @@ -57,14 +56,14 @@ export default createRule({ // Pattern 4: jQuery .click(handler) - only for jQuery objects with arguments (event handler registration) 'CallExpression[callee.type="MemberExpression"][callee.property.name="click"]'( - node: TSESTree.CallExpression, + node: CallExpression, ) { // Allow .click() without arguments (click execution, not event handler registration) if (node.arguments.length === 0) { return; } - const callee = node.callee as TSESTree.MemberExpression; + const callee = node.callee as MemberExpression; const object = callee.object; // $(...).click(handler) or jQuery(...).click(handler) @@ -74,7 +73,7 @@ export default createRule({ (object.callee.name === '$' || object.callee.name === 'jQuery') ) { context.report({ - node, + node: node as unknown as Rule.Node, messageId: 'noClickEvent', }); return; @@ -83,34 +82,35 @@ export default createRule({ // $element.click(handler) if (object.type === 'Identifier' && object.name.startsWith('$')) { context.report({ - node, + node: node as unknown as Rule.Node, messageId: 'noClickEvent', }); } }, // Pattern 5: React onClick={...} - 'JSXAttribute[name.name="onClick"]'(node: TSESTree.JSXAttribute) { + // JSXAttribute isn't part of ESTree; espree with jsx enabled produces it, but no type package covers it. + 'JSXAttribute[name.name="onClick"]'(node: unknown) { context.report({ - node, + node: node as Rule.Node, messageId: 'noClickEvent', }); }, // Pattern 6: Vue @click or v-on:click // Note: This requires vue-eslint-parser - // eslint-disable-next-line @typescript-eslint/no-explicit-any - 'VAttribute[key.name.name="click"]'(node: any) { + 'VAttribute[key.name.name="click"]'(node: AST.VAttribute) { + // vue-eslint-parser nodes aren't part of the Rule.Node union context.report expects. context.report({ - node, + node: node as unknown as Rule.Node, messageId: 'noClickEvent', }); }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - 'VAttribute[key.name="on"][key.argument.name="click"]'(node: any) { + 'VAttribute[key.name="on"][key.argument.name="click"]'(node: AST.VAttribute) { + // vue-eslint-parser nodes aren't part of the Rule.Node union context.report expects. context.report({ - node, + node: node as unknown as Rule.Node, messageId: 'noClickEvent', }); }, diff --git a/packages/@d-zero/eslint-plugin/src/utils/create-rule.ts b/packages/@d-zero/eslint-plugin/src/utils/create-rule.ts index f0a633a7..23d71a96 100644 --- a/packages/@d-zero/eslint-plugin/src/utils/create-rule.ts +++ b/packages/@d-zero/eslint-plugin/src/utils/create-rule.ts @@ -1,8 +1,31 @@ -import { ESLintUtils } from '@typescript-eslint/utils'; +import type { Rule } from 'eslint'; import { REPOSITORY_URL } from '../const.js'; /** * Creates a rule with the D-ZERO namespace and documentation URL + * @param rule - Rule definition + * @param rule.name - Rule name, used to build the documentation URL + * @param rule.meta - Rule metadata + * @param rule.create - Rule listener factory */ -export const createRule = ESLintUtils.RuleCreator((name) => `${REPOSITORY_URL}/${name}`); +export function createRule({ + name, + meta, + create, +}: { + name: string; + meta: Rule.RuleMetaData; + create: Rule.RuleModule['create']; +}): Rule.RuleModule { + return { + meta: { + ...meta, + docs: { + ...meta.docs, + url: `${REPOSITORY_URL}/${name}`, + }, + }, + create, + }; +} From 0c2a4378fb153d51d44c1789ab9644a2667b0c03 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:11:22 +0900 Subject: [PATCH 10/25] refactor(eslint): remove typescript-eslint and delegate typed rules to oxlint --- packages/@d-zero/eslint-config/README.md | 14 +- packages/@d-zero/eslint-config/base.js | 261 ++++++++++++++---- packages/@d-zero/eslint-config/commonjs.js | 4 - packages/@d-zero/eslint-config/frontend.js | 6 +- packages/@d-zero/eslint-config/index.js | 7 +- packages/@d-zero/eslint-config/package.json | 3 +- .../eslint-config/restricted-syntax.js | 11 + packages/@d-zero/eslint-config/typescript.js | 44 --- 8 files changed, 236 insertions(+), 114 deletions(-) create mode 100644 packages/@d-zero/eslint-config/restricted-syntax.js delete mode 100644 packages/@d-zero/eslint-config/typescript.js diff --git a/packages/@d-zero/eslint-config/README.md b/packages/@d-zero/eslint-config/README.md index 7b6af609..22f023cf 100644 --- a/packages/@d-zero/eslint-config/README.md +++ b/packages/@d-zero/eslint-config/README.md @@ -44,12 +44,8 @@ export default [ 以下のプリセットが用意されています。 -| プロパティ | 型 | 説明 | -| ---------------------- | -------- | -------------------------------------------------- | -| `configs.frontend` | `Array` | フロントエンド開発用 | -| `configs.frontendNoTS` | `Array` | フロントエンド開発用(TypeScriptを利用しない場合) | -| `configs.node` | `Array` | Node.js開発用 | -| `configs.nodeNoTS` | `Array` | Node.js開発用(TypeScriptを利用しない場合) | -| `configs.standard` | `Array` | `config.node`と同じ | -| `configs.base` | `Array` | `config.nodeNoTS`と同じ | -| `configs.commonjs` | `Object` | CommonJS用単一設定 | +| プロパティ | 型 | 説明 | +| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `configs.base` | `Array` | Oxlint と併用する前提の共通設定。Oxlint に実装がない領域(regexp・jsdoc の主要チェック・`import-x/no-extraneous-dependencies`・`import-x/order`・`sort-class-members`等)のみ検査。TypeScript ファイルは対象外(Oxlint が検査) | +| `configs.frontend` | `Array` | `configs.base`に加え、DOM/Vue/React 向けの`@d-zero/no-click-event`を検査するフロントエンド開発用 | +| `configs.commonjs` | `Object` | CommonJS用単一設定 | diff --git a/packages/@d-zero/eslint-config/base.js b/packages/@d-zero/eslint-config/base.js index 8b27f8f5..8e60a0e2 100644 --- a/packages/@d-zero/eslint-config/base.js +++ b/packages/@d-zero/eslint-config/base.js @@ -1,82 +1,240 @@ -import dzeroPlugin from '@d-zero/eslint-plugin'; import js from '@eslint/js'; import comments from 'eslint-plugin-eslint-comments'; import { flatConfigs as importX } from 'eslint-plugin-import-x'; -import jsdoc from 'eslint-plugin-jsdoc'; +import { configs as jsdocConfigs } from 'eslint-plugin-jsdoc'; import * as regexpPlugin from 'eslint-plugin-regexp'; import sortClassMembers from 'eslint-plugin-sort-class-members'; import eslintPluginUnicorn from 'eslint-plugin-unicorn'; import globals from 'globals'; +import { restrictedSyntax } from './restricted-syntax.js'; + /** * @type {import('eslint').Linter.Config[]} */ export const base = [ + { + ignores: ['**/*.{ts,mts,cts,tsx}'], + }, { ...js.configs.recommended, rules: { ...js.configs.recommended.rules, - 'no-console': 'warn', + 'constructor-super': 0, + 'for-direction': 0, + 'getter-return': 0, + 'no-array-constructor': 0, + 'no-async-promise-executor': 0, + 'no-case-declarations': 0, + 'no-class-assign': 0, + 'no-compare-neg-zero': 0, + 'no-cond-assign': 0, + 'no-const-assign': 0, + 'no-constant-binary-expression': 0, + 'no-constant-condition': 0, + 'no-control-regex': 0, + 'no-debugger': 0, + 'no-delete-var': 0, + 'no-dupe-class-members': 0, + 'no-dupe-else-if': 0, + 'no-dupe-keys': 0, + 'no-duplicate-case': 0, + 'no-empty': 0, + 'no-empty-character-class': 0, + 'no-empty-pattern': 0, + 'no-empty-static-block': 0, + 'no-ex-assign': 0, + 'no-extra-boolean-cast': 0, + 'no-fallthrough': 0, + 'no-func-assign': 0, + 'no-global-assign': 0, + 'no-import-assign': 0, + 'no-invalid-regexp': 0, + 'no-irregular-whitespace': 0, + 'no-loss-of-precision': 0, + 'no-misleading-character-class': 0, 'no-mixed-spaces-and-tabs': 0, - 'no-restricted-syntax': [ - 2, - { - selector: - ':matches(PropertyDefinition, MethodDefinition)[accessibility="private"]', - message: 'Use #private instead', - }, - { - selector: - ':matches(PropertyDefinition, MethodDefinition)[accessibility="public"]', - message: 'Remove public keyword', - }, - { - selector: 'MethodDefinition[key.name=/^_/]:not([accessibility="protected"])', - message: 'Add protected keyword', - }, - { - selector: 'MethodDefinition:not([key.name=/^_/])[accessibility="protected"]', - message: 'Start with `_` if you want to use protected', - }, - { - selector: - "CallExpression[callee.property.name='addEventListener'][arguments.0.value='DOMContentLoaded']", - message: - "Avoid using 'DOMContentLoaded'. Use 'defer' or 'type=module' attribute instead.", - }, - ], + 'no-new-native-nonconstructor': 0, + 'no-nonoctal-decimal-escape': 0, + 'no-obj-calls': 0, + 'no-prototype-builtins': 0, + 'no-regex-spaces': 0, + 'no-restricted-syntax': [2, ...restrictedSyntax], + 'no-self-assign': 0, + 'no-setter-return': 0, + 'no-shadow-restricted-names': 0, + 'no-sparse-arrays': 0, + 'no-this-before-super': 0, + 'no-unexpected-multiline': 0, + 'no-unreachable': 0, + 'no-unsafe-finally': 0, + 'no-unsafe-negation': 0, + 'no-unsafe-optional-chaining': 0, + 'no-unused-labels': 0, + 'no-unused-private-class-members': 0, 'no-unused-vars': 0, - 'no-var': 2, - 'prefer-const': 2, - 'prefer-rest-params': 2, - 'prefer-spread': 2, + 'no-useless-backreference': 0, + 'no-useless-catch': 0, + 'no-useless-escape': 0, + 'no-with': 0, + 'require-yield': 0, + 'use-isnan': 0, + 'valid-typeof': 0, }, }, { ...eslintPluginUnicorn.configs.recommended, rules: { ...eslintPluginUnicorn.configs.recommended.rules, + 'unicorn/catch-error-name': 0, + 'unicorn/consistent-assert': 0, + 'unicorn/consistent-date-clone': 0, 'unicorn/consistent-destructuring': 0, + 'unicorn/consistent-empty-array-spread': 0, + 'unicorn/consistent-existence-index-check': 0, 'unicorn/consistent-function-scoping': 0, + 'unicorn/empty-brace-spaces': 0, + 'unicorn/error-message': 0, + 'unicorn/escape-case': 0, + 'unicorn/explicit-length-check': 0, + 'unicorn/filename-case': 0, + 'unicorn/import-style': 0, + 'unicorn/new-for-builtins': 0, + 'unicorn/no-abusive-eslint-disable': 0, + 'unicorn/no-accessor-recursion': 0, 'unicorn/no-anonymous-default-export': 0, 'unicorn/no-array-callback-reference': 0, + 'unicorn/no-array-for-each': 0, + 'unicorn/no-array-method-this-argument': 0, + 'unicorn/no-array-reduce': 0, + 'unicorn/no-array-reverse': 0, + 'unicorn/no-array-sort': 0, + 'unicorn/no-await-expression-member': 0, + 'unicorn/no-await-in-promise-methods': 0, + 'unicorn/no-console-spaces': 0, + 'unicorn/no-document-cookie': 0, + 'unicorn/no-empty-file': 0, + 'unicorn/no-hex-escape': 0, + 'unicorn/no-immediate-mutation': 0, + 'unicorn/no-instanceof-builtins': 0, + 'unicorn/no-invalid-fetch-options': 0, + 'unicorn/no-invalid-remove-event-listener': 0, + 'unicorn/no-lonely-if': 0, + 'unicorn/no-magic-array-flat-depth': 0, + 'unicorn/no-negated-condition': 0, + 'unicorn/no-negation-in-equality-check': 0, 'unicorn/no-nested-ternary': 0, + 'unicorn/no-new-array': 0, + 'unicorn/no-new-buffer': 0, 'unicorn/no-null': 0, + 'unicorn/no-object-as-default-parameter': 0, 'unicorn/no-process-exit': 0, + 'unicorn/no-single-promise-in-promise-methods': 0, + 'unicorn/no-static-only-class': 0, + 'unicorn/no-thenable': 0, + 'unicorn/no-this-assignment': 0, + 'unicorn/no-typeof-undefined': 0, + 'unicorn/no-unnecessary-array-flat-depth': 0, + 'unicorn/no-unnecessary-array-splice-count': 0, + 'unicorn/no-unnecessary-await': 0, + 'unicorn/no-unnecessary-slice-end': 0, + 'unicorn/no-unreadable-array-destructuring': 0, + 'unicorn/no-unreadable-iife': 0, + 'unicorn/no-useless-collection-argument': 0, + 'unicorn/no-useless-error-capture-stack-trace': 0, + 'unicorn/no-useless-fallback-in-spread': 0, + 'unicorn/no-useless-length-check': 0, + 'unicorn/no-useless-promise-resolve-reject': 0, + 'unicorn/no-useless-spread': 0, + 'unicorn/no-useless-switch-case': 0, + 'unicorn/no-useless-undefined': 0, + 'unicorn/no-zero-fractions': 0, + 'unicorn/number-literal-case': 0, + 'unicorn/numeric-separators-style': 0, + 'unicorn/prefer-add-event-listener': 0, + 'unicorn/prefer-array-find': 0, + 'unicorn/prefer-array-flat': 0, + 'unicorn/prefer-array-flat-map': 0, + 'unicorn/prefer-array-index-of': 0, + 'unicorn/prefer-array-some': 0, + 'unicorn/prefer-at': 0, + 'unicorn/prefer-bigint-literals': 0, + 'unicorn/prefer-blob-reading-methods': 0, + 'unicorn/prefer-class-fields': 0, + 'unicorn/prefer-classlist-toggle': 0, + 'unicorn/prefer-code-point': 0, + 'unicorn/prefer-date-now': 0, + 'unicorn/prefer-default-parameters': 0, + 'unicorn/prefer-dom-node-append': 0, + 'unicorn/prefer-dom-node-dataset': 0, + 'unicorn/prefer-dom-node-remove': 0, + 'unicorn/prefer-dom-node-text-content': 0, + 'unicorn/prefer-event-target': 0, + 'unicorn/prefer-export-from': 0, 'unicorn/prefer-global-this': 0, + 'unicorn/prefer-includes': 0, + 'unicorn/prefer-keyboard-event-key': 0, + 'unicorn/prefer-logical-operator-over-ternary': 0, + 'unicorn/prefer-math-min-max': 0, + 'unicorn/prefer-math-trunc': 0, + 'unicorn/prefer-modern-dom-apis': 0, + 'unicorn/prefer-modern-math-apis': 0, + 'unicorn/prefer-module': 0, + 'unicorn/prefer-native-coercion-functions': 0, + 'unicorn/prefer-negative-index': 0, + 'unicorn/prefer-node-protocol': 0, + 'unicorn/prefer-number-properties': 0, + 'unicorn/prefer-object-from-entries': 0, + 'unicorn/prefer-optional-catch-binding': 0, + 'unicorn/prefer-prototype-methods': 0, 'unicorn/prefer-query-selector': 0, + 'unicorn/prefer-reflect-apply': 0, + 'unicorn/prefer-regexp-test': 0, + 'unicorn/prefer-response-static-json': 0, + 'unicorn/prefer-set-has': 0, + 'unicorn/prefer-set-size': 0, + 'unicorn/prefer-single-call': 0, + 'unicorn/prefer-spread': 0, 'unicorn/prefer-string-raw': 0, + 'unicorn/prefer-string-replace-all': 0, + 'unicorn/prefer-string-slice': 0, + 'unicorn/prefer-string-starts-ends-with': 0, + 'unicorn/prefer-string-trim-start-end': 0, + 'unicorn/prefer-structured-clone': 0, 'unicorn/prefer-ternary': 0, + 'unicorn/prefer-top-level-await': 0, + 'unicorn/prefer-type-error': 0, 'unicorn/prevent-abbreviations': 0, + 'unicorn/relative-url-style': 0, + 'unicorn/require-array-join-separator': 0, + 'unicorn/require-module-attributes': 0, + 'unicorn/require-module-specifiers': 0, + 'unicorn/require-number-to-fixed-digits-argument': 0, + 'unicorn/switch-case-braces': 0, + 'unicorn/text-encoding-identifier-case': 0, + 'unicorn/throw-new-error': 0, + }, + }, + { + ...regexpPlugin.configs['flat/recommended'], + rules: { + ...regexpPlugin.configs['flat/recommended'].rules, + 'no-control-regex': 0, + 'no-misleading-character-class': 0, + 'no-regex-spaces': 0, + 'prefer-regex-literals': 0, }, }, - regexpPlugin.configs['flat/recommended'], { ...importX.recommended, rules: { ...importX.recommended.rules, + 'import-x/default': 0, + 'import-x/namespace': 0, + 'import-x/no-duplicates': 0, 'import-x/no-extraneous-dependencies': 2, 'import-x/no-named-as-default': 0, + 'import-x/no-named-as-default-member': 0, 'import-x/no-unresolved': 0, 'import-x/order': [ 2, @@ -108,14 +266,29 @@ export const base = [ }, }, { - ...jsdoc.configs['flat/recommended'], + ...jsdocConfigs['flat/recommended'], rules: { - ...jsdoc.configs['flat/recommended'].rules, - 'jsdoc/require-param-type': 0, + ...jsdocConfigs['flat/recommended'].rules, + 'jsdoc/check-access': 0, + 'jsdoc/check-property-names': 0, + 'jsdoc/check-tag-names': 0, + 'jsdoc/empty-tags': 0, + 'jsdoc/implements-on-classes': 0, + 'jsdoc/no-defaults': 0, + 'jsdoc/require-param': 0, 'jsdoc/require-param-description': 0, + 'jsdoc/require-param-name': 0, + 'jsdoc/require-param-type': 0, + 'jsdoc/require-property': 0, + 'jsdoc/require-property-description': 0, + 'jsdoc/require-property-name': 0, + 'jsdoc/require-property-type': 0, 'jsdoc/require-returns': 0, - 'jsdoc/require-returns-type': 0, 'jsdoc/require-returns-description': 0, + 'jsdoc/require-returns-type': 0, + 'jsdoc/require-throws-type': 0, + 'jsdoc/require-yields': 0, + 'jsdoc/require-yields-type': 0, }, }, { @@ -243,19 +416,11 @@ export const base = [ }, { languageOptions: { - ecmaVersion: 2023, + ecmaVersion: 'latest', globals: { ...globals.builtin, ...globals.nodeBuiltin, }, }, }, - { - plugins: { - '@d-zero': dzeroPlugin, - }, - rules: { - '@d-zero/no-click-event': 'warn', - }, - }, ]; diff --git a/packages/@d-zero/eslint-config/commonjs.js b/packages/@d-zero/eslint-config/commonjs.js index b4349614..73b82046 100644 --- a/packages/@d-zero/eslint-config/commonjs.js +++ b/packages/@d-zero/eslint-config/commonjs.js @@ -4,10 +4,6 @@ import globals from 'globals'; * @type {import('eslint').Linter.Config} */ export const commonjs = { - rules: { - 'unicorn/prefer-module': 0, - '@typescript-eslint/no-require-imports': 0, - }, languageOptions: { globals: { ...globals.commonjs, diff --git a/packages/@d-zero/eslint-config/frontend.js b/packages/@d-zero/eslint-config/frontend.js index a10ae52d..7a1ba5a6 100644 --- a/packages/@d-zero/eslint-config/frontend.js +++ b/packages/@d-zero/eslint-config/frontend.js @@ -1,11 +1,15 @@ +import dzeroPlugin from '@d-zero/eslint-plugin'; import globals from 'globals'; /** * @type {import('eslint').Linter.Config} */ export const frontend = { + plugins: { + '@d-zero': dzeroPlugin, + }, rules: { - 'unicorn/prefer-top-level-await': 0, + '@d-zero/no-click-event': 'warn', }, languageOptions: { globals: { diff --git a/packages/@d-zero/eslint-config/index.js b/packages/@d-zero/eslint-config/index.js index 7dcf2c43..144bf5d1 100644 --- a/packages/@d-zero/eslint-config/index.js +++ b/packages/@d-zero/eslint-config/index.js @@ -1,19 +1,14 @@ import { base } from './base.js'; import { commonjs } from './commonjs.js'; import { frontend } from './frontend.js'; -import { ts } from './typescript.js'; /** * @type {import('eslint').ESLint.Plugin} */ export default { configs: { - standard: [...ts], base: [...base], - node: [...ts], - nodeNoTS: [...base], - frontend: [...ts, frontend], - frontendNoTS: [...base, frontend], + frontend: [...base, frontend], commonjs, }, }; diff --git a/packages/@d-zero/eslint-config/package.json b/packages/@d-zero/eslint-config/package.json index ab7dc1e4..2cb3a988 100644 --- a/packages/@d-zero/eslint-config/package.json +++ b/packages/@d-zero/eslint-config/package.json @@ -29,8 +29,7 @@ "eslint-plugin-regexp": "3.1.1", "eslint-plugin-sort-class-members": "1.22.1", "eslint-plugin-unicorn": "63.0.0", - "globals": "17.11.0", - "typescript-eslint": "8.67.0" + "globals": "17.11.0" }, "engines": { "node": ">=22.0.0" diff --git a/packages/@d-zero/eslint-config/restricted-syntax.js b/packages/@d-zero/eslint-config/restricted-syntax.js new file mode 100644 index 00000000..16c9a482 --- /dev/null +++ b/packages/@d-zero/eslint-config/restricted-syntax.js @@ -0,0 +1,11 @@ +/** + * @type {[selector: string, message: string][]} + */ +export const restrictedSyntax = [ + { + selector: + "CallExpression[callee.property.name='addEventListener'][arguments.0.value='DOMContentLoaded']", + message: + "Avoid using 'DOMContentLoaded'. Use 'defer' or 'type=module' attribute instead.", + }, +]; diff --git a/packages/@d-zero/eslint-config/typescript.js b/packages/@d-zero/eslint-config/typescript.js deleted file mode 100644 index 43b00a30..00000000 --- a/packages/@d-zero/eslint-config/typescript.js +++ /dev/null @@ -1,44 +0,0 @@ -import tsESLint from 'typescript-eslint'; - -import { base } from './base.js'; - -export const ts = tsESLint.config( - base, - tsESLint.configs.recommended, - { - files: ['*.{ts,tsx}', '**/*.{ts,tsx}'], - languageOptions: { - parserOptions: { - sourceType: 'module', - project: ['./tsconfig.json'], - }, - }, - settings: { - 'import-x/parsers': { - '@typescript-eslint/parser': ['.ts'], - }, - }, - rules: { - '@typescript-eslint/adjacent-overload-signatures': 2, - '@typescript-eslint/ban-ts-comment': 0, - '@typescript-eslint/consistent-type-imports': 1, - '@typescript-eslint/member-ordering': 0, - '@typescript-eslint/no-array-constructor': 2, - '@typescript-eslint/no-explicit-any': [1, { fixToUnknown: true }], - '@typescript-eslint/no-floating-promises': 2, - '@typescript-eslint/no-namespace': [2, { allowDeclarations: true }], - '@typescript-eslint/no-unnecessary-type-assertion': 2, - '@typescript-eslint/no-unused-vars': 2, - '@typescript-eslint/no-var-requires': 2, - '@typescript-eslint/prefer-namespace-keyword': 2, - '@typescript-eslint/require-await': 2, - '@typescript-eslint/restrict-plus-operands': 0, - }, - }, - { - files: ['*.{test,spec}.{ts,mts,tsx}'], - rules: { - 'import/no-extraneous-dependencies': 0, - }, - }, -); From 756688820b6fc7f87b887b5a1e429c6550edf5f3 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:11:37 +0900 Subject: [PATCH 11/25] feat(repo): migrate lint pipeline from eslint/prettier to oxlint/oxfmt Switch TypeScript from the TS6/TS7 shim to TypeScript 7 directly, since typescript-eslint no longer needs a programmatic compiler API. --- .oxfmtrc.json | 21 ++ cspell.json | 7 +- eslint.config.js | 19 +- oxlint.config.mts | 26 ++ package.json | 22 +- tsconfig.json | 3 +- yarn.lock | 919 +++++++++++++++++++++++++++++++++++++--------- 7 files changed, 833 insertions(+), 184 deletions(-) create mode 100644 .oxfmtrc.json create mode 100644 oxlint.config.mts diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 00000000..949cf79b --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,21 @@ +{ + "arrowParens": "always", + "bracketSameLine": true, + "bracketSpacing": true, + "jsxSingleQuote": false, + "printWidth": 90, + "quoteProps": "as-needed", + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "all", + "useTabs": true, + "overrides": [ + { + "files": ["*.html"], + "options": { + "printWidth": 320 + } + } + ] +} diff --git a/cspell.json b/cspell.json index 74c03e27..992f8715 100644 --- a/cspell.json +++ b/cspell.json @@ -10,7 +10,12 @@ // ESLint plugin "dzero", - "TSES" + "TSES", + + // Oxc tools + "oxfmt", + "oxfmtrc", + "oxlint" ], "overrides": [ { diff --git a/eslint.config.js b/eslint.config.js index dbf3b35c..d7b4dd42 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -4,14 +4,9 @@ import dz from '@d-zero/eslint-config'; * @type {import('eslint').ESLint.ConfigData[]} */ export default [ - ...dz.configs.standard, + ...dz.configs.base, { - rules: { - '@typescript-eslint/ban-ts-comment': 0, - }, - }, - { - files: ['*.mjs', '**/*.spec.{js,mjs,ts}'], + files: ['*.mjs', '**/*.spec.{js,mjs}'], rules: { 'import-x/no-extraneous-dependencies': 0, }, @@ -19,14 +14,14 @@ export default [ { files: [ '.textlintrc.js', - '**/cz-config/**/*', - '**/pug-lint-config/**/*', - '**/stylelint-config/**/*', - '**/textlint-config/**/*', + '**/cz-config/**', + '**/pug-lint-config/**', + '**/stylelint-config/**', + '**/textlint-config/**', ], ...dz.configs.commonjs, }, { - ignores: ['**/lib/**/*'], + ignores: ['**/lib/**/*', '**/dist/**', 'test/fixtures/**', '**/*.json'], }, ]; diff --git a/oxlint.config.mts b/oxlint.config.mts new file mode 100644 index 00000000..4b0affaf --- /dev/null +++ b/oxlint.config.mts @@ -0,0 +1,26 @@ +import config from '@d-zero/oxlint-config'; + +export default { + ...config, + jsPlugins: ['@d-zero/oxlint-plugin'], + rules: { + ...config.rules, + '@d-zero/no-click-event': 'warn', + }, + overrides: [ + { + files: [ + '.textlintrc.js', + '**/cz-config/**', + '**/pug-lint-config/**', + '**/stylelint-config/**', + '**/textlint-config/**', + ], + rules: { + 'typescript/no-require-imports': 'off', + 'typescript/no-var-requires': 'off', + 'unicorn/prefer-module': 'off', + }, + }, + ], +}; diff --git a/package.json b/package.json index 878496a5..282403e5 100644 --- a/package.json +++ b/package.json @@ -12,12 +12,19 @@ "scripts": { "test": "vitest run", "build": "lerna run build", - "lint": "run-s lint:dedupe lint:tsc lint:eslint lint:prettier lint:textlint lint:cspell lint:secretlint lint:actionlint", - "lint:ci": "run-s lint:dedupe lint:tsc lint:eslint lint:prettier lint:textlint lint:cspell lint:secretlint", + "lint": "run-s lint:dedupe lint:tsc lint:oxlint lint:eslint lint:oxfmt lint:prettier lint:textlint lint:cspell lint:secretlint lint:actionlint", + "lint:ci": "run-s lint:dedupe lint:tsc lint:oxlint lint:eslint lint:oxfmt lint:prettier lint:textlint lint:cspell lint:secretlint", "lint:dedupe": "yarn dedupe --check", + "lint:fix": "run-s lint:oxlint:fix lint:eslint:fix lint:oxfmt:fix lint:prettier:fix", "lint:cspell": "npx cspell --no-progress --show-suggestions \"{*,packages/@d-zero/*/{*,src/**/*}}/\"", - "lint:eslint": "npx eslint --fix \"{*,packages/@d-zero/*/{*,src/**/*}}.{js,cjs,mjs,jsx,ts,cts,mts,tsx}\"", - "lint:prettier": "npx prettier --write \"{*,**/*}.{md,mdc,json,js,cjs,mjs,jsx,ts,cts,mts,tsx}\"", + "lint:oxlint": "oxlint --ignore-pattern \"test/fixtures/**\" .", + "lint:oxlint:fix": "oxlint --fix --ignore-pattern \"test/fixtures/**\" .", + "lint:eslint": "eslint .", + "lint:eslint:fix": "eslint --fix .", + "lint:oxfmt": "oxfmt --check \"{*,**/*}.{md,json,js,cjs,mjs,jsx,ts,cts,mts,tsx,yml,yaml,css,scss,html}\" \"!test/fixtures/**\" \"!.agents/**\"", + "lint:oxfmt:fix": "oxfmt --write \"{*,**/*}.{md,json,js,cjs,mjs,jsx,ts,cts,mts,tsx,yml,yaml,css,scss,html}\" \"!test/fixtures/**\" \"!.agents/**\"", + "lint:prettier": "prettier --check \"{*,**/*}.{pug,astro}\"", + "lint:prettier:fix": "prettier --write \"{*,**/*}.{pug,astro}\"", "lint:textlint": "npx textlint \"./{*,packages/@d-zero/*/{*,src/**/*}}.{md,mdc}\"", "lint:tsc": "npx tsc", "lint:secretlint": "npx secretlint \"**/*\"", @@ -32,16 +39,21 @@ "update": "yarn upgrade-interactive" }, "devDependencies": { + "@d-zero/eslint-config": "6.0.0-alpha.2", "@d-zero/tsconfig": "2.0.0", "@secretlint/secretlint-rule-preset-recommend": "13.0.4", "@types/node": "24.13.3", + "eslint": "9.39.5", "execa": "10.0.1", "husky": "9.1.7", "lerna": "10.0.0", "npm-run-all2": "9.0.3", + "oxfmt": "0.62.0", + "oxlint": "1.77.0", "prettier": "3.9.6", + "prettier-plugin-astro": "0.14.1", "secretlint": "13.0.4", - "typescript": "5.9.3", + "typescript": "7.0.2", "vitest": "4.1.10" }, "resolutions": { diff --git a/tsconfig.json b/tsconfig.json index ece0c0e5..f01a4aad 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,5 +3,6 @@ "compilerOptions": { "noEmit": true }, - "include": ["**/*.ts"] + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["test/fixtures/oxlint/**"] } diff --git a/yarn.lock b/yarn.lock index a41677dd..ac5f7f03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,13 @@ __metadata: version: 10 cacheKey: 10c0 +"@astrojs/compiler@npm:^2.9.1": + version: 2.13.1 + resolution: "@astrojs/compiler@npm:2.13.1" + checksum: 10c0/83d85c30c8b1bd6d2382f1bc3d99126732838dc747e3a9defa55f726ccc2276c710e6af81bfb68d8fb17fde452c69cf0187cb1d2f8eb022764f1ccc4cf3a3db1 + languageName: node + linkType: hard + "@azu/format-text@npm:^1.0.1, @azu/format-text@npm:^1.0.2": version: 1.0.2 resolution: "@azu/format-text@npm:1.0.2" @@ -983,7 +990,7 @@ __metadata: languageName: unknown linkType: soft -"@d-zero/eslint-config@workspace:packages/@d-zero/eslint-config": +"@d-zero/eslint-config@npm:6.0.0-alpha.2, @d-zero/eslint-config@workspace:packages/@d-zero/eslint-config": version: 0.0.0-use.local resolution: "@d-zero/eslint-config@workspace:packages/@d-zero/eslint-config" dependencies: @@ -997,7 +1004,6 @@ __metadata: eslint-plugin-sort-class-members: "npm:1.22.1" eslint-plugin-unicorn: "npm:63.0.0" globals: "npm:17.11.0" - typescript-eslint: "npm:8.67.0" languageName: unknown linkType: soft @@ -1005,9 +1011,7 @@ __metadata: version: 0.0.0-use.local resolution: "@d-zero/eslint-plugin@workspace:packages/@d-zero/eslint-plugin" dependencies: - "@typescript-eslint/parser": "npm:8.67.0" - "@typescript-eslint/rule-tester": "npm:8.67.0" - "@typescript-eslint/utils": "npm:8.67.0" + "@types/estree": "npm:1.0.8" eslint: "npm:9.39.5" vue-eslint-parser: "npm:10.4.1" peerDependencies: @@ -1032,15 +1036,34 @@ __metadata: languageName: unknown linkType: soft +"@d-zero/oxlint-config@workspace:packages/@d-zero/oxlint-config": + version: 0.0.0-use.local + resolution: "@d-zero/oxlint-config@workspace:packages/@d-zero/oxlint-config" + languageName: unknown + linkType: soft + +"@d-zero/oxlint-plugin@workspace:packages/@d-zero/oxlint-plugin": + version: 0.0.0-use.local + resolution: "@d-zero/oxlint-plugin@workspace:packages/@d-zero/oxlint-plugin" + dependencies: + eslint: "npm:9.39.5" + peerDependencies: + oxlint: ">=1.0.0" + languageName: unknown + linkType: soft + "@d-zero/prettier-config@workspace:packages/@d-zero/prettier-config": version: 0.0.0-use.local resolution: "@d-zero/prettier-config@workspace:packages/@d-zero/prettier-config" dependencies: "@prettier/plugin-pug": "npm:3.4.2" prettier: "npm:3.9.6" + prettier-plugin-astro: "npm:0.14.1" dependenciesMeta: "@prettier/plugin-pug": optional: true + prettier-plugin-astro: + optional: true languageName: unknown linkType: soft @@ -1151,7 +1174,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.8.0, @eslint-community/eslint-utils@npm:^4.9.0, @eslint-community/eslint-utils@npm:^4.9.1": +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.8.0, @eslint-community/eslint-utils@npm:^4.9.0": version: 4.9.1 resolution: "@eslint-community/eslint-utils@npm:4.9.1" dependencies: @@ -1162,7 +1185,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.11.0, @eslint-community/regexpp@npm:^4.12.1, @eslint-community/regexpp@npm:^4.12.2, @eslint-community/regexpp@npm:^4.8.0": +"@eslint-community/regexpp@npm:^4.11.0, @eslint-community/regexpp@npm:^4.12.1, @eslint-community/regexpp@npm:^4.8.0": version: 4.12.2 resolution: "@eslint-community/regexpp@npm:4.12.2" checksum: 10c0/fddcbc66851b308478d04e302a4d771d6917a0b3740dc351513c0da9ca2eab8a1adf99f5e0aa7ab8b13fa0df005c81adeee7e63a92f3effd7d367a163b721c2d @@ -2396,6 +2419,272 @@ __metadata: languageName: node linkType: hard +"@oxfmt/binding-android-arm-eabi@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-android-arm-eabi@npm:0.62.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-android-arm64@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-android-arm64@npm:0.62.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-darwin-arm64@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-darwin-arm64@npm:0.62.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-darwin-x64@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-darwin-x64@npm:0.62.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxfmt/binding-freebsd-x64@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-freebsd-x64@npm:0.62.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm-gnueabihf@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-arm-gnueabihf@npm:0.62.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm-musleabihf@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-arm-musleabihf@npm:0.62.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm64-gnu@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-arm64-gnu@npm:0.62.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm64-musl@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-arm64-musl@npm:0.62.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-linux-ppc64-gnu@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-ppc64-gnu@npm:0.62.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-riscv64-gnu@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-riscv64-gnu@npm:0.62.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-riscv64-musl@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-riscv64-musl@npm:0.62.0" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-linux-s390x-gnu@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-s390x-gnu@npm:0.62.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-x64-gnu@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-x64-gnu@npm:0.62.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-x64-musl@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-linux-x64-musl@npm:0.62.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-openharmony-arm64@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-openharmony-arm64@npm:0.62.0" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-arm64-msvc@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-win32-arm64-msvc@npm:0.62.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-ia32-msvc@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-win32-ia32-msvc@npm:0.62.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-x64-msvc@npm:0.62.0": + version: 0.62.0 + resolution: "@oxfmt/binding-win32-x64-msvc@npm:0.62.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@oxlint/binding-android-arm-eabi@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-android-arm-eabi@npm:1.77.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@oxlint/binding-android-arm64@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-android-arm64@npm:1.77.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@oxlint/binding-darwin-arm64@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-darwin-arm64@npm:1.77.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxlint/binding-darwin-x64@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-darwin-x64@npm:1.77.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxlint/binding-freebsd-x64@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-freebsd-x64@npm:1.77.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxlint/binding-linux-arm-gnueabihf@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-arm-gnueabihf@npm:1.77.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxlint/binding-linux-arm-musleabihf@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-arm-musleabihf@npm:1.77.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxlint/binding-linux-arm64-gnu@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-arm64-gnu@npm:1.77.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxlint/binding-linux-arm64-musl@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-arm64-musl@npm:1.77.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxlint/binding-linux-ppc64-gnu@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-ppc64-gnu@npm:1.77.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@oxlint/binding-linux-riscv64-gnu@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-riscv64-gnu@npm:1.77.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@oxlint/binding-linux-riscv64-musl@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-riscv64-musl@npm:1.77.0" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@oxlint/binding-linux-s390x-gnu@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-s390x-gnu@npm:1.77.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@oxlint/binding-linux-x64-gnu@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-x64-gnu@npm:1.77.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxlint/binding-linux-x64-musl@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-linux-x64-musl@npm:1.77.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxlint/binding-openharmony-arm64@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-openharmony-arm64@npm:1.77.0" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@oxlint/binding-win32-arm64-msvc@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-win32-arm64-msvc@npm:1.77.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxlint/binding-win32-ia32-msvc@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-win32-ia32-msvc@npm:1.77.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@oxlint/binding-win32-x64-msvc@npm:1.77.0": + version: 1.77.0 + resolution: "@oxlint/binding-win32-x64-msvc@npm:1.77.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -3081,6 +3370,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:1.0.8": + version: 1.0.8 + resolution: "@types/estree@npm:1.0.8" + checksum: 10c0/39d34d1afaa338ab9763f37ad6066e3f349444f9052b9676a7cc0252ef9485a41c6d81c9c4e0d26e9077993354edf25efc853f3224dd4b447175ef62bdcc86a5 + languageName: node + linkType: hard + "@types/estree@npm:^1.0.0, @types/estree@npm:^1.0.6, @types/estree@npm:^1.0.8, @types/estree@npm:^1.0.9": version: 1.0.9 resolution: "@types/estree@npm:1.0.9" @@ -3166,156 +3462,150 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:8.67.0": +"@typescript-eslint/types@npm:^8.56.0, @typescript-eslint/types@npm:^8.67.0": version: 8.67.0 - resolution: "@typescript-eslint/eslint-plugin@npm:8.67.0" - dependencies: - "@eslint-community/regexpp": "npm:^4.12.2" - "@typescript-eslint/scope-manager": "npm:8.67.0" - "@typescript-eslint/type-utils": "npm:8.67.0" - "@typescript-eslint/utils": "npm:8.67.0" - "@typescript-eslint/visitor-keys": "npm:8.67.0" - ignore: "npm:^7.0.5" - natural-compare: "npm:^1.4.0" - ts-api-utils: "npm:^2.5.0" - peerDependencies: - "@typescript-eslint/parser": ^8.67.0 - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: ">=4.8.4 <6.1.0" - checksum: 10c0/5962baaa764cd6350dfdf51c9a09fdd9ee6be65982ac562ee9b732f851744158e5006bf8ce61556a93534d831be8300fd89d7b79b6b4d7170dc2381d987dc8d9 + resolution: "@typescript-eslint/types@npm:8.67.0" + checksum: 10c0/b892a00d4cbea9604a0abf6eedd0ea019b27df4220a1d90e0035101cb4f846722c9e3eeadce40b423c1e0240709bbc787c6ca49bcc4f8c25ba23b4bd0436492a languageName: node linkType: hard -"@typescript-eslint/parser@npm:8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/parser@npm:8.67.0" - dependencies: - "@typescript-eslint/scope-manager": "npm:8.67.0" - "@typescript-eslint/types": "npm:8.67.0" - "@typescript-eslint/typescript-estree": "npm:8.67.0" - "@typescript-eslint/visitor-keys": "npm:8.67.0" - debug: "npm:^4.4.3" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: ">=4.8.4 <6.1.0" - checksum: 10c0/8f6f8fbea429509ca0c95c4d48a45da0c890172a590606d65587e75a3ca762c3e5678a20a63fc9e386b0b21b7aa643ba9724354ceaa75bc8f62d0b22cb0198c8 +"@typescript/typescript-aix-ppc64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-aix-ppc64@npm:7.0.2" + conditions: os=aix & cpu=ppc64 languageName: node linkType: hard -"@typescript-eslint/project-service@npm:8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/project-service@npm:8.67.0" - dependencies: - "@typescript-eslint/tsconfig-utils": "npm:^8.67.0" - "@typescript-eslint/types": "npm:^8.67.0" - debug: "npm:^4.4.3" - peerDependencies: - typescript: ">=4.8.4 <6.1.0" - checksum: 10c0/d8f89dc209f2186c04fb1c42c1a5c69c21696a7a57c5f2be2222682a6440b49ec32687ae85cbd1c1c164431635fbc37bb9404b336e5748966e270ee1347e028c +"@typescript/typescript-darwin-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-darwin-arm64@npm:7.0.2" + conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@typescript-eslint/rule-tester@npm:8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/rule-tester@npm:8.67.0" - dependencies: - "@typescript-eslint/parser": "npm:8.67.0" - "@typescript-eslint/typescript-estree": "npm:8.67.0" - "@typescript-eslint/utils": "npm:8.67.0" - ajv: "npm:^6.12.6" - json-stable-stringify-without-jsonify: "npm:^1.0.1" - lodash.merge: "npm:4.6.2" - semver: "npm:^7.7.3" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: ">=4.8.4 <6.1.0" - checksum: 10c0/3a11fd82c7196a6c2ae89fa857dee9410de0763ad6b4718d0669a5f8e75f77df7841ed9572321ba6ce96e3dd69b582f70838c2172cc62ecb3b609215a0b6cdf0 +"@typescript/typescript-darwin-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-darwin-x64@npm:7.0.2" + conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/scope-manager@npm:8.67.0" - dependencies: - "@typescript-eslint/types": "npm:8.67.0" - "@typescript-eslint/visitor-keys": "npm:8.67.0" - checksum: 10c0/8f1fe7dffcb6929ad66dcdca77dd1e4a703f18ab3ab1d685458af74dad10b9be05795e64bd58ff60b45cda8d45737240c84874674d39140c2689e00e3ee82bb9 +"@typescript/typescript-freebsd-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-freebsd-arm64@npm:7.0.2" + conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@typescript-eslint/tsconfig-utils@npm:8.67.0, @typescript-eslint/tsconfig-utils@npm:^8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/tsconfig-utils@npm:8.67.0" - peerDependencies: - typescript: ">=4.8.4 <6.1.0" - checksum: 10c0/c19161347ea3d7a0081653c4d399275a3e0d66f87a24131fb5a358e6b55bc27d709781dbda16382f3f721d790338dcf42c65c9e6c26077123e9f3d076d37a894 +"@typescript/typescript-freebsd-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-freebsd-x64@npm:7.0.2" + conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/type-utils@npm:8.67.0" - dependencies: - "@typescript-eslint/types": "npm:8.67.0" - "@typescript-eslint/typescript-estree": "npm:8.67.0" - "@typescript-eslint/utils": "npm:8.67.0" - debug: "npm:^4.4.3" - ts-api-utils: "npm:^2.5.0" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: ">=4.8.4 <6.1.0" - checksum: 10c0/0970ea126f9b63a6eb9ca3525a6bf3065dffb3f61a00bd0ee84967140e7ecffe45cafda0cd2c90233dcc06b19c8fb98f4cd90ba8ebbb12deaf9501b9f5b54d8c +"@typescript/typescript-linux-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-arm64@npm:7.0.2" + conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@typescript-eslint/types@npm:8.67.0, @typescript-eslint/types@npm:^8.56.0, @typescript-eslint/types@npm:^8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/types@npm:8.67.0" - checksum: 10c0/b892a00d4cbea9604a0abf6eedd0ea019b27df4220a1d90e0035101cb4f846722c9e3eeadce40b423c1e0240709bbc787c6ca49bcc4f8c25ba23b4bd0436492a +"@typescript/typescript-linux-arm@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-arm@npm:7.0.2" + conditions: os=linux & cpu=arm languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/typescript-estree@npm:8.67.0" - dependencies: - "@typescript-eslint/project-service": "npm:8.67.0" - "@typescript-eslint/tsconfig-utils": "npm:8.67.0" - "@typescript-eslint/types": "npm:8.67.0" - "@typescript-eslint/visitor-keys": "npm:8.67.0" - debug: "npm:^4.4.3" - minimatch: "npm:^10.2.2" - semver: "npm:^7.7.3" - tinyglobby: "npm:^0.2.15" - ts-api-utils: "npm:^2.5.0" - peerDependencies: - typescript: ">=4.8.4 <6.1.0" - checksum: 10c0/449350fcf4f4ee55a6bb7a73302c4eef072a1282d366344cb625c0f17231eb4088251e6ce61fb48d0d536febb9a28f3725b9bd78ac8d0dbf9c161cf51745870c +"@typescript/typescript-linux-loong64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-loong64@npm:7.0.2" + conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/utils@npm:8.67.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.9.1" - "@typescript-eslint/scope-manager": "npm:8.67.0" - "@typescript-eslint/types": "npm:8.67.0" - "@typescript-eslint/typescript-estree": "npm:8.67.0" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: ">=4.8.4 <6.1.0" - checksum: 10c0/cccaca1aeba52ec332ee95f3367b84eaf5dd9d60a0d1b4332ebe41b775fa7e8b8faf412de4d88b73a22f84b01f6ab48496c61863407b08fcbef9af429b6b89f1 +"@typescript/typescript-linux-mips64el@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-mips64el@npm:7.0.2" + conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:8.67.0": - version: 8.67.0 - resolution: "@typescript-eslint/visitor-keys@npm:8.67.0" - dependencies: - "@typescript-eslint/types": "npm:8.67.0" - eslint-visitor-keys: "npm:^5.0.0" - checksum: 10c0/d43e6151cd1cdbcfb2f9fa54946198baaebaf0b7a9057ccb2f1aeba1aa3eb46708a97cd7773dcfd0eba3bd45642a5520f4607001cd27d8958e41aa56b2fe7a35 +"@typescript/typescript-linux-ppc64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-ppc64@npm:7.0.2" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + +"@typescript/typescript-linux-riscv64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-riscv64@npm:7.0.2" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + +"@typescript/typescript-linux-s390x@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-s390x@npm:7.0.2" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + +"@typescript/typescript-linux-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-x64@npm:7.0.2" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"@typescript/typescript-netbsd-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-netbsd-arm64@npm:7.0.2" + conditions: os=netbsd & cpu=arm64 + languageName: node + linkType: hard + +"@typescript/typescript-netbsd-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-netbsd-x64@npm:7.0.2" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + +"@typescript/typescript-openbsd-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-openbsd-arm64@npm:7.0.2" + conditions: os=openbsd & cpu=arm64 + languageName: node + linkType: hard + +"@typescript/typescript-openbsd-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-openbsd-x64@npm:7.0.2" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@typescript/typescript-sunos-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-sunos-x64@npm:7.0.2" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + +"@typescript/typescript-win32-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-win32-arm64@npm:7.0.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@typescript/typescript-win32-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-win32-x64@npm:7.0.2" + conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -3637,7 +3927,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.12.6, ajv@npm:^6.14.0": +"ajv@npm:^6.14.0": version: 6.15.0 resolution: "ajv@npm:6.15.0" dependencies: @@ -5659,7 +5949,7 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^4.2.0 || ^5.0.0, eslint-visitor-keys@npm:^5.0.0, eslint-visitor-keys@npm:^5.0.1": +"eslint-visitor-keys@npm:^4.2.0 || ^5.0.0, eslint-visitor-keys@npm:^5.0.1": version: 5.0.1 resolution: "eslint-visitor-keys@npm:5.0.1" checksum: 10c0/16190bdf2cbae40a1109384c94450c526a79b0b9c3cb21e544256ed85ac48a4b84db66b74a6561d20fe6ab77447f150d711c2ad5ad74df4fcc133736bce99678 @@ -8026,16 +8316,21 @@ __metadata: version: 0.0.0-use.local resolution: "linters@workspace:." dependencies: + "@d-zero/eslint-config": "npm:6.0.0-alpha.2" "@d-zero/tsconfig": "npm:2.0.0" "@secretlint/secretlint-rule-preset-recommend": "npm:13.0.4" "@types/node": "npm:24.13.3" + eslint: "npm:9.39.5" execa: "npm:10.0.1" husky: "npm:9.1.7" lerna: "npm:10.0.0" npm-run-all2: "npm:9.0.3" + oxfmt: "npm:0.62.0" + oxlint: "npm:1.77.0" prettier: "npm:3.9.6" + prettier-plugin-astro: "npm:0.14.1" secretlint: "npm:13.0.4" - typescript: "npm:5.9.3" + typescript: "npm:7.0.2" vitest: "npm:4.1.10" languageName: unknown linkType: soft @@ -8077,7 +8372,7 @@ __metadata: languageName: node linkType: hard -"lodash.merge@npm:4.6.2, lodash.merge@npm:^4.6.2": +"lodash.merge@npm:^4.6.2": version: 4.6.2 resolution: "lodash.merge@npm:4.6.2" checksum: 10c0/402fa16a1edd7538de5b5903a90228aa48eb5533986ba7fa26606a49db2572bf414ff73a2c9f5d5fd36b31c46a5d5c7e1527749c07cbcf965ccff5fbdf32c506 @@ -9371,6 +9666,159 @@ __metadata: languageName: node linkType: hard +"oxfmt@npm:0.62.0": + version: 0.62.0 + resolution: "oxfmt@npm:0.62.0" + dependencies: + "@oxfmt/binding-android-arm-eabi": "npm:0.62.0" + "@oxfmt/binding-android-arm64": "npm:0.62.0" + "@oxfmt/binding-darwin-arm64": "npm:0.62.0" + "@oxfmt/binding-darwin-x64": "npm:0.62.0" + "@oxfmt/binding-freebsd-x64": "npm:0.62.0" + "@oxfmt/binding-linux-arm-gnueabihf": "npm:0.62.0" + "@oxfmt/binding-linux-arm-musleabihf": "npm:0.62.0" + "@oxfmt/binding-linux-arm64-gnu": "npm:0.62.0" + "@oxfmt/binding-linux-arm64-musl": "npm:0.62.0" + "@oxfmt/binding-linux-ppc64-gnu": "npm:0.62.0" + "@oxfmt/binding-linux-riscv64-gnu": "npm:0.62.0" + "@oxfmt/binding-linux-riscv64-musl": "npm:0.62.0" + "@oxfmt/binding-linux-s390x-gnu": "npm:0.62.0" + "@oxfmt/binding-linux-x64-gnu": "npm:0.62.0" + "@oxfmt/binding-linux-x64-musl": "npm:0.62.0" + "@oxfmt/binding-openharmony-arm64": "npm:0.62.0" + "@oxfmt/binding-win32-arm64-msvc": "npm:0.62.0" + "@oxfmt/binding-win32-ia32-msvc": "npm:0.62.0" + "@oxfmt/binding-win32-x64-msvc": "npm:0.62.0" + tinypool: "npm:2.1.0" + peerDependencies: + svelte: ^5.0.0 + vite-plus: "*" + dependenciesMeta: + "@oxfmt/binding-android-arm-eabi": + optional: true + "@oxfmt/binding-android-arm64": + optional: true + "@oxfmt/binding-darwin-arm64": + optional: true + "@oxfmt/binding-darwin-x64": + optional: true + "@oxfmt/binding-freebsd-x64": + optional: true + "@oxfmt/binding-linux-arm-gnueabihf": + optional: true + "@oxfmt/binding-linux-arm-musleabihf": + optional: true + "@oxfmt/binding-linux-arm64-gnu": + optional: true + "@oxfmt/binding-linux-arm64-musl": + optional: true + "@oxfmt/binding-linux-ppc64-gnu": + optional: true + "@oxfmt/binding-linux-riscv64-gnu": + optional: true + "@oxfmt/binding-linux-riscv64-musl": + optional: true + "@oxfmt/binding-linux-s390x-gnu": + optional: true + "@oxfmt/binding-linux-x64-gnu": + optional: true + "@oxfmt/binding-linux-x64-musl": + optional: true + "@oxfmt/binding-openharmony-arm64": + optional: true + "@oxfmt/binding-win32-arm64-msvc": + optional: true + "@oxfmt/binding-win32-ia32-msvc": + optional: true + "@oxfmt/binding-win32-x64-msvc": + optional: true + peerDependenciesMeta: + svelte: + optional: true + vite-plus: + optional: true + bin: + oxfmt: bin/oxfmt + checksum: 10c0/bb162985c61566c1253f32951e7e306c539378a742ed62916e77efcaf8bb8e65458a243633178301d45b7f0df7998520dbbdbd428747ff5f5401606312424f76 + languageName: node + linkType: hard + +"oxlint@npm:1.77.0": + version: 1.77.0 + resolution: "oxlint@npm:1.77.0" + dependencies: + "@oxlint/binding-android-arm-eabi": "npm:1.77.0" + "@oxlint/binding-android-arm64": "npm:1.77.0" + "@oxlint/binding-darwin-arm64": "npm:1.77.0" + "@oxlint/binding-darwin-x64": "npm:1.77.0" + "@oxlint/binding-freebsd-x64": "npm:1.77.0" + "@oxlint/binding-linux-arm-gnueabihf": "npm:1.77.0" + "@oxlint/binding-linux-arm-musleabihf": "npm:1.77.0" + "@oxlint/binding-linux-arm64-gnu": "npm:1.77.0" + "@oxlint/binding-linux-arm64-musl": "npm:1.77.0" + "@oxlint/binding-linux-ppc64-gnu": "npm:1.77.0" + "@oxlint/binding-linux-riscv64-gnu": "npm:1.77.0" + "@oxlint/binding-linux-riscv64-musl": "npm:1.77.0" + "@oxlint/binding-linux-s390x-gnu": "npm:1.77.0" + "@oxlint/binding-linux-x64-gnu": "npm:1.77.0" + "@oxlint/binding-linux-x64-musl": "npm:1.77.0" + "@oxlint/binding-openharmony-arm64": "npm:1.77.0" + "@oxlint/binding-win32-arm64-msvc": "npm:1.77.0" + "@oxlint/binding-win32-ia32-msvc": "npm:1.77.0" + "@oxlint/binding-win32-x64-msvc": "npm:1.77.0" + peerDependencies: + oxlint-tsgolint: ">=7.0.2001" + vite-plus: "*" + dependenciesMeta: + "@oxlint/binding-android-arm-eabi": + optional: true + "@oxlint/binding-android-arm64": + optional: true + "@oxlint/binding-darwin-arm64": + optional: true + "@oxlint/binding-darwin-x64": + optional: true + "@oxlint/binding-freebsd-x64": + optional: true + "@oxlint/binding-linux-arm-gnueabihf": + optional: true + "@oxlint/binding-linux-arm-musleabihf": + optional: true + "@oxlint/binding-linux-arm64-gnu": + optional: true + "@oxlint/binding-linux-arm64-musl": + optional: true + "@oxlint/binding-linux-ppc64-gnu": + optional: true + "@oxlint/binding-linux-riscv64-gnu": + optional: true + "@oxlint/binding-linux-riscv64-musl": + optional: true + "@oxlint/binding-linux-s390x-gnu": + optional: true + "@oxlint/binding-linux-x64-gnu": + optional: true + "@oxlint/binding-linux-x64-musl": + optional: true + "@oxlint/binding-openharmony-arm64": + optional: true + "@oxlint/binding-win32-arm64-msvc": + optional: true + "@oxlint/binding-win32-ia32-msvc": + optional: true + "@oxlint/binding-win32-x64-msvc": + optional: true + peerDependenciesMeta: + oxlint-tsgolint: + optional: true + vite-plus: + optional: true + bin: + oxlint: bin/oxlint + checksum: 10c0/b18813fe0480ed071f2f5931713b75103c30df140a6eb41c457de9481018d8b27ed76bea41024e6faefdc3f4e82e5c98a9cd9597c7c7ecb1ab1f639079d4f835 + languageName: node + linkType: hard + "p-finally@npm:^1.0.0": version: 1.0.0 resolution: "p-finally@npm:1.0.0" @@ -9863,7 +10311,18 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.9.6": +"prettier-plugin-astro@npm:0.14.1": + version: 0.14.1 + resolution: "prettier-plugin-astro@npm:0.14.1" + dependencies: + "@astrojs/compiler": "npm:^2.9.1" + prettier: "npm:^3.0.0" + sass-formatter: "npm:^0.7.6" + checksum: 10c0/f812607d422ff36df1bf58534a96590a861dedf41e70f8f36fa9546b91def65b17f4507e1c9212dab56cbbae2f4ab5ff6e7e31370b9198261360c6444daa297c + languageName: node + linkType: hard + +"prettier@npm:3.9.6, prettier@npm:^3.0.0": version: 3.9.6 resolution: "prettier@npm:3.9.6" bin: @@ -10573,6 +11032,13 @@ __metadata: languageName: node linkType: hard +"s.color@npm:0.0.15": + version: 0.0.15 + resolution: "s.color@npm:0.0.15" + checksum: 10c0/50532b1307a65ac5e1076f5b556f5ce7e5c8ea3ff1c73810a226a0109efe84ff196e10017cd906c78a87d9600a26ca7016ac78896232aa05949a98bf2100adf1 + languageName: node + linkType: hard + "safe-buffer@npm:5.2.1, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" @@ -10587,6 +11053,15 @@ __metadata: languageName: node linkType: hard +"sass-formatter@npm:^0.7.6": + version: 0.7.9 + resolution: "sass-formatter@npm:0.7.9" + dependencies: + suf-log: "npm:^2.5.3" + checksum: 10c0/172eb326121ace1a48e689a1419efab2d780623631d106ac306ac2a055e96813bda36044f20bc4cc28d761427efc136a08d07153d1b8a8ccf0a032dca5fdce3c + languageName: node + linkType: hard + "scslre@npm:^0.3.0": version: 0.3.0 resolution: "scslre@npm:0.3.0" @@ -11216,6 +11691,15 @@ __metadata: languageName: node linkType: hard +"suf-log@npm:^2.5.3": + version: 2.5.3 + resolution: "suf-log@npm:2.5.3" + dependencies: + s.color: "npm:0.0.15" + checksum: 10c0/67edce59cce30964b2bec4f2e726c980c1e83d266adb186e3a92f8d267916cd2ae38f8e5aa14af9df675837708d93b212a7e3241505abec948d7fd3705781f0a + languageName: node + linkType: hard + "supports-color@npm:7.2.0, supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -11740,6 +12224,13 @@ __metadata: languageName: node linkType: hard +"tinypool@npm:2.1.0": + version: 2.1.0 + resolution: "tinypool@npm:2.1.0" + checksum: 10c0/9fb1c760558c6264e0f4cfde96a63b12450b43f1730fbe6274aa24ddbdf488745c08924d0dea7a1303b47d555416a6415f2113898c69b6ecf731e75ac95238a5 + languageName: node + linkType: hard + "tinyrainbow@npm:^3.1.0": version: 3.1.1 resolution: "tinyrainbow@npm:3.1.1" @@ -11817,15 +12308,6 @@ __metadata: languageName: node linkType: hard -"ts-api-utils@npm:^2.5.0": - version: 2.5.0 - resolution: "ts-api-utils@npm:2.5.0" - peerDependencies: - typescript: ">=4.8.4" - checksum: 10c0/767849383c114e7f1971fa976b20e73ac28fd0c70d8d65c0004790bf4d8f89888c7e4cf6d5949f9c1beae9bc3c64835bef77bbe27fddf45a3c7b60cebcf85c8c - languageName: node - linkType: hard - "tsconfig-paths@npm:4.2.0": version: 4.2.0 resolution: "tsconfig-paths@npm:4.2.0" @@ -11910,38 +12392,145 @@ __metadata: languageName: node linkType: hard -"typescript-eslint@npm:8.67.0": - version: 8.67.0 - resolution: "typescript-eslint@npm:8.67.0" - dependencies: - "@typescript-eslint/eslint-plugin": "npm:8.67.0" - "@typescript-eslint/parser": "npm:8.67.0" - "@typescript-eslint/typescript-estree": "npm:8.67.0" - "@typescript-eslint/utils": "npm:8.67.0" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: ">=4.8.4 <6.1.0" - checksum: 10c0/6ec860f6763be8a5fabf143ff8b6d4e43b98be0c781afc4725eda578ba0e0cecfcc1f06bd1b56fcccc41fa3fc15e4661ec32120d28f2e7abe4953e91ee346de1 - languageName: node - linkType: hard - -"typescript@npm:5.9.3": - version: 5.9.3 - resolution: "typescript@npm:5.9.3" +"typescript@npm:7.0.2": + version: 7.0.2 + resolution: "typescript@npm:7.0.2" + dependencies: + "@typescript/typescript-aix-ppc64": "npm:7.0.2" + "@typescript/typescript-darwin-arm64": "npm:7.0.2" + "@typescript/typescript-darwin-x64": "npm:7.0.2" + "@typescript/typescript-freebsd-arm64": "npm:7.0.2" + "@typescript/typescript-freebsd-x64": "npm:7.0.2" + "@typescript/typescript-linux-arm": "npm:7.0.2" + "@typescript/typescript-linux-arm64": "npm:7.0.2" + "@typescript/typescript-linux-loong64": "npm:7.0.2" + "@typescript/typescript-linux-mips64el": "npm:7.0.2" + "@typescript/typescript-linux-ppc64": "npm:7.0.2" + "@typescript/typescript-linux-riscv64": "npm:7.0.2" + "@typescript/typescript-linux-s390x": "npm:7.0.2" + "@typescript/typescript-linux-x64": "npm:7.0.2" + "@typescript/typescript-netbsd-arm64": "npm:7.0.2" + "@typescript/typescript-netbsd-x64": "npm:7.0.2" + "@typescript/typescript-openbsd-arm64": "npm:7.0.2" + "@typescript/typescript-openbsd-x64": "npm:7.0.2" + "@typescript/typescript-sunos-x64": "npm:7.0.2" + "@typescript/typescript-win32-arm64": "npm:7.0.2" + "@typescript/typescript-win32-x64": "npm:7.0.2" + dependenciesMeta: + "@typescript/typescript-aix-ppc64": + optional: true + "@typescript/typescript-darwin-arm64": + optional: true + "@typescript/typescript-darwin-x64": + optional: true + "@typescript/typescript-freebsd-arm64": + optional: true + "@typescript/typescript-freebsd-x64": + optional: true + "@typescript/typescript-linux-arm": + optional: true + "@typescript/typescript-linux-arm64": + optional: true + "@typescript/typescript-linux-loong64": + optional: true + "@typescript/typescript-linux-mips64el": + optional: true + "@typescript/typescript-linux-ppc64": + optional: true + "@typescript/typescript-linux-riscv64": + optional: true + "@typescript/typescript-linux-s390x": + optional: true + "@typescript/typescript-linux-x64": + optional: true + "@typescript/typescript-netbsd-arm64": + optional: true + "@typescript/typescript-netbsd-x64": + optional: true + "@typescript/typescript-openbsd-arm64": + optional: true + "@typescript/typescript-openbsd-x64": + optional: true + "@typescript/typescript-sunos-x64": + optional: true + "@typescript/typescript-win32-arm64": + optional: true + "@typescript/typescript-win32-x64": + optional: true bin: tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10c0/6bd7552ce39f97e711db5aa048f6f9995b53f1c52f7d8667c1abdc1700c68a76a308f579cd309ce6b53646deb4e9a1be7c813a93baaf0a28ccd536a30270e1c5 + checksum: 10c0/3dcee51ec8c332492325bcdbf7df48b66668751f127e622ae7d41b6c716eb19184424a45e14f7750f50f340232388b69e6287859155f06a5ce2df76f12cb31cf languageName: node linkType: hard -"typescript@patch:typescript@npm%3A5.9.3#optional!builtin": - version: 5.9.3 - resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" +"typescript@patch:typescript@npm%3A7.0.2#optional!builtin": + version: 7.0.2 + resolution: "typescript@patch:typescript@npm%3A7.0.2#optional!builtin::version=7.0.2&hash=3bafbf" + dependencies: + "@typescript/typescript-aix-ppc64": "npm:7.0.2" + "@typescript/typescript-darwin-arm64": "npm:7.0.2" + "@typescript/typescript-darwin-x64": "npm:7.0.2" + "@typescript/typescript-freebsd-arm64": "npm:7.0.2" + "@typescript/typescript-freebsd-x64": "npm:7.0.2" + "@typescript/typescript-linux-arm": "npm:7.0.2" + "@typescript/typescript-linux-arm64": "npm:7.0.2" + "@typescript/typescript-linux-loong64": "npm:7.0.2" + "@typescript/typescript-linux-mips64el": "npm:7.0.2" + "@typescript/typescript-linux-ppc64": "npm:7.0.2" + "@typescript/typescript-linux-riscv64": "npm:7.0.2" + "@typescript/typescript-linux-s390x": "npm:7.0.2" + "@typescript/typescript-linux-x64": "npm:7.0.2" + "@typescript/typescript-netbsd-arm64": "npm:7.0.2" + "@typescript/typescript-netbsd-x64": "npm:7.0.2" + "@typescript/typescript-openbsd-arm64": "npm:7.0.2" + "@typescript/typescript-openbsd-x64": "npm:7.0.2" + "@typescript/typescript-sunos-x64": "npm:7.0.2" + "@typescript/typescript-win32-arm64": "npm:7.0.2" + "@typescript/typescript-win32-x64": "npm:7.0.2" + dependenciesMeta: + "@typescript/typescript-aix-ppc64": + optional: true + "@typescript/typescript-darwin-arm64": + optional: true + "@typescript/typescript-darwin-x64": + optional: true + "@typescript/typescript-freebsd-arm64": + optional: true + "@typescript/typescript-freebsd-x64": + optional: true + "@typescript/typescript-linux-arm": + optional: true + "@typescript/typescript-linux-arm64": + optional: true + "@typescript/typescript-linux-loong64": + optional: true + "@typescript/typescript-linux-mips64el": + optional: true + "@typescript/typescript-linux-ppc64": + optional: true + "@typescript/typescript-linux-riscv64": + optional: true + "@typescript/typescript-linux-s390x": + optional: true + "@typescript/typescript-linux-x64": + optional: true + "@typescript/typescript-netbsd-arm64": + optional: true + "@typescript/typescript-netbsd-x64": + optional: true + "@typescript/typescript-openbsd-arm64": + optional: true + "@typescript/typescript-openbsd-x64": + optional: true + "@typescript/typescript-sunos-x64": + optional: true + "@typescript/typescript-win32-arm64": + optional: true + "@typescript/typescript-win32-x64": + optional: true bin: tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10c0/ad09fdf7a756814dce65bc60c1657b40d44451346858eea230e10f2e95a289d9183b6e32e5c11e95acc0ccc214b4f36289dcad4bf1886b0adb84d711d336a430 + checksum: 10c0/6b3cdc369cd829d46e00734ea64233ee84419c2825ad8fe408915adde77abced4b7a2401f7eed517d54a7a4f5d1c1869753cb99018df1c2159c761d9f33483a6 languageName: node linkType: hard From d9ec32842afea91af875e851aa8eb929fb43c7f3 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:11:53 +0900 Subject: [PATCH 12/25] test(repo): rework lint fixtures and cli specs for oxlint/eslint role split --- test/cli.spec.mjs | 176 ++++++++++++++---- test/fixtures/eslint/eslint.config.js | 2 +- ...ontent-loaded.ts => dom-content-loaded.js} | 0 .../no-click-event.js} | 2 +- .../eslint/frontend/prefer-top-level-await.ts | 5 - test/fixtures/eslint/frontend/tsconfig.json | 7 - test/fixtures/eslint/jsdoc.js | 3 + .../eslint/no-extraneous-dependencies.js | 3 + test/fixtures/eslint/node/eslint.config.js | 7 - .../eslint/node/prefer-top-level-await.ts | 5 - test/fixtures/eslint/node/tsconfig.json | 7 - test/fixtures/eslint/regexp.js | 3 + ...class-members.ts => sort-class-members.js} | 6 +- test/fixtures/eslint/tsconfig.json | 7 - .../markuplint/image-naming-test.html | 10 +- .../markuplint/valid-image-naming.html | 12 +- test/fixtures/oxlint/no-click-event.tsx | 14 ++ test/fixtures/oxlint/no-click-event.vue | 4 + test/fixtures/prettier/astro.astro | 5 + test/fixtures/stylelint/comment-spacing.css | 8 +- .../fixtures/stylelint/shorthand-logical.scss | 12 +- test/fixtures/stylelint/transform.scss | 2 +- 22 files changed, 201 insertions(+), 99 deletions(-) rename test/fixtures/eslint/frontend/{dom-content-loaded.ts => dom-content-loaded.js} (100%) rename test/fixtures/eslint/{no-click-event.ts => frontend/no-click-event.js} (95%) delete mode 100644 test/fixtures/eslint/frontend/prefer-top-level-await.ts delete mode 100644 test/fixtures/eslint/frontend/tsconfig.json create mode 100644 test/fixtures/eslint/jsdoc.js create mode 100644 test/fixtures/eslint/no-extraneous-dependencies.js delete mode 100644 test/fixtures/eslint/node/eslint.config.js delete mode 100644 test/fixtures/eslint/node/prefer-top-level-await.ts delete mode 100644 test/fixtures/eslint/node/tsconfig.json create mode 100644 test/fixtures/eslint/regexp.js rename test/fixtures/eslint/{sort-class-members.ts => sort-class-members.js} (87%) delete mode 100644 test/fixtures/eslint/tsconfig.json create mode 100644 test/fixtures/oxlint/no-click-event.tsx create mode 100644 test/fixtures/oxlint/no-click-event.vue create mode 100644 test/fixtures/prettier/astro.astro diff --git a/test/cli.spec.mjs b/test/cli.spec.mjs index 60d135a2..62dc7fba 100644 --- a/test/cli.spec.mjs +++ b/test/cli.spec.mjs @@ -1,8 +1,11 @@ import path from 'node:path'; +import oxlintPlugin from '@d-zero/oxlint-plugin'; import { execa } from 'execa'; import { vi, describe, test, expect } from 'vitest'; +import oxlintPluginPackage from '../packages/@d-zero/oxlint-plugin/package.json' with { type: 'json' }; + vi.setConfig({ testTimeout: 15_000, }); @@ -15,6 +18,92 @@ function n(filePath) { return path.relative(process.cwd(), filePath).replaceAll(path.sep, '/'); } +describe('Oxlint', () => { + test('plugin metadata uses the published package version', () => { + expect(oxlintPlugin.meta.version).toBe(oxlintPluginPackage.version); + }); + + const oxlint = async (filepath) => { + const { stdout, exitCode } = await execa( + 'yarn', + ['oxlint', filepath, '--format', 'unix'], + { + reject: false, + }, + ); + + return { + exitCode, + lines: stdout.split('\n').filter((line) => line.includes(':')), + }; + }; + + test('no-click-event', async () => { + const { exitCode, lines } = await oxlint('test/fixtures/oxlint/no-click-event.tsx'); + // Warning-level rule violations do not make oxlint exit with a failure code. + expect(exitCode).toBe(0); + expect(lines).toStrictEqual([ + 'test/fixtures/oxlint/no-click-event.tsx:1:1: Avoid using click events. Consider using the Invoker Commands API instead. See: https://developer.mozilla.org/docs/Web/API/Invoker_Commands_API [Warning/@d-zero(no-click-event)]', + 'test/fixtures/oxlint/no-click-event.tsx:2:9: Avoid using click events. Consider using the Invoker Commands API instead. See: https://developer.mozilla.org/docs/Web/API/Invoker_Commands_API [Warning/@d-zero(no-click-event)]', + 'test/fixtures/oxlint/no-click-event.tsx:4:1: Avoid using click events. Consider using the Invoker Commands API instead. See: https://developer.mozilla.org/docs/Web/API/Invoker_Commands_API [Warning/@d-zero(no-click-event)]', + 'test/fixtures/oxlint/no-click-event.tsx:5:1: Avoid using click events. Consider using the Invoker Commands API instead. See: https://developer.mozilla.org/docs/Web/API/Invoker_Commands_API [Warning/@d-zero(no-click-event)]', + 'test/fixtures/oxlint/no-click-event.tsx:6:1: Avoid using click events. Consider using the Invoker Commands API instead. See: https://developer.mozilla.org/docs/Web/API/Invoker_Commands_API [Warning/@d-zero(no-click-event)]', + ]); + }); + + test('no-click-event does not detect Vue @click / v-on:click (unsupported in v6)', async () => { + const { exitCode, lines } = await oxlint('test/fixtures/oxlint/no-click-event.vue'); + expect(exitCode).toBe(0); + expect(lines).toStrictEqual([]); + }); + + describe('oxlint-config', () => { + const printConfig = async () => { + const { stdout } = await execa( + 'yarn', + ['oxlint', '--print-config', 'oxlint.config.mts'], + { reject: false }, + ); + return JSON.parse(stdout); + }; + + test('promotes the correctness category to error (deny)', async () => { + const config = await printConfig(); + expect(config.categories.correctness).toBe('deny'); + }); + + test('keeps rules that were error-level before the oxlint migration at deny', async () => { + const config = await printConfig(); + expect(config.rules['no-var']).toBe('deny'); + expect(config.rules['prefer-const']).toBe('deny'); + expect(config.rules['prefer-rest-params']).toBe('deny'); + expect(config.rules['prefer-spread']).toBe('deny'); + expect(config.rules['unicorn/prefer-code-point']).toBe('deny'); + expect(config.rules['typescript/no-namespace']).toBe('deny'); + }); + + test('keeps rules that were warn-level before the oxlint migration at warn', async () => { + const config = await printConfig(); + expect(config.rules['no-console']).toBe('warn'); + expect(config.rules['typescript/no-explicit-any']).toBe('warn'); + expect(config.rules['jsdoc/require-param']).toBe('warn'); + }); + }); +}); + +describe('Prettier', () => { + test('Astro', async () => { + const { exitCode, stderr } = await execa( + 'yarn', + ['prettier', '--check', 'test/fixtures/prettier/astro.astro'], + { reject: false }, + ); + + expect(stderr).toBe(''); + expect(exitCode).toBe(0); + }); +}); + describe('ESLint', () => { const eslint = async (filepath, rule) => { const dir = path.dirname(filepath); @@ -40,57 +129,49 @@ describe('ESLint', () => { test('sort-class-members', async () => { const result = await eslint( - 'test/fixtures/eslint/sort-class-members.ts', + 'test/fixtures/eslint/sort-class-members.js', 'sort-class-members/sort-class-members', ); expect(result).toStrictEqual([ - '3:2 warning Expected property member to come before constructor sort-class-members/sort-class-members', '8:2 warning Expected getter getter to come before constructor sort-class-members/sort-class-members', - '11:2 warning Expected property member to come before constructor sort-class-members/sort-class-members', - '11:2 warning Expected property member to come before getter getter sort-class-members/sort-class-members', - '14:2 warning Expected method method to come before static property staticMember sort-class-members/sort-class-members', - '19:2 warning Expected property c1 to come before property #a sort-class-members/sort-class-members', - '20:2 warning Expected property c2 to come before property #a sort-class-members/sort-class-members', - '20:2 warning Expected property c2 to come before property c1 sort-class-members/sort-class-members', - '21:2 warning Expected property b2 to come before property #a sort-class-members/sort-class-members', - '22:2 warning Expected property b1 to come before property #a sort-class-members/sort-class-members', - '22:2 warning Expected property b1 to come before property b2 sort-class-members/sort-class-members', + '13:2 warning Expected static property staticMember to come before property member sort-class-members/sort-class-members', + '24:2 warning Expected accessor pair b to come before property #a sort-class-members/sort-class-members', + '24:2 warning Expected accessor pair b to come before property c1 sort-class-members/sort-class-members', + '24:2 warning Expected accessor pair b to come before property c2 sort-class-members/sort-class-members', + '24:2 warning Expected accessor pair b to come before property b2 sort-class-members/sort-class-members', + '24:2 warning Expected accessor pair b to come before property b1 sort-class-members/sort-class-members', + '28:2 warning Expected getter a to come before property #a sort-class-members/sort-class-members', + '28:2 warning Expected getter a to come before property c1 sort-class-members/sort-class-members', + '28:2 warning Expected getter a to come before property c2 sort-class-members/sort-class-members', + '28:2 warning Expected getter a to come before property b2 sort-class-members/sort-class-members', + '28:2 warning Expected getter a to come before property b1 sort-class-members/sort-class-members', '32:2 warning Expected getter b to come immediately before setter b sort-class-members/sort-class-members', - '49:2 warning Expected method #privateMethod to come before method _method sort-class-members/sort-class-members', - '50:2 warning Expected method method2 to come before method _method sort-class-members/sort-class-members', - '50:2 warning Expected method method2 to come before method #privateMethod sort-class-members/sort-class-members', - ]); - }); - - test('prefer-top-level-await', async () => { - const frontend = await eslint( - 'test/fixtures/eslint/frontend/prefer-top-level-await.ts', - 'unicorn/prefer-top-level-await', - ); - expect(frontend).toStrictEqual([]); - - const node = await eslint( - 'test/fixtures/eslint/node/prefer-top-level-await.ts', - 'unicorn/prefer-top-level-await', - ); - expect(node).toStrictEqual([ - '5:6 error Prefer top-level await over an async function `asyncFn` call unicorn/prefer-top-level-await', + '36:2 warning Expected constructor to come before property #a sort-class-members/sort-class-members', + '36:2 warning Expected constructor to come before property c1 sort-class-members/sort-class-members', + '36:2 warning Expected constructor to come before property c2 sort-class-members/sort-class-members', + '36:2 warning Expected constructor to come before property b2 sort-class-members/sort-class-members', + '36:2 warning Expected constructor to come before property b1 sort-class-members/sort-class-members', + '37:2 warning Expected method _method to come before property #a sort-class-members/sort-class-members', + '37:2 warning Expected method _method to come before property c1 sort-class-members/sort-class-members', + '37:2 warning Expected method _method to come before property c2 sort-class-members/sort-class-members', + '37:2 warning Expected method _method to come before property b2 sort-class-members/sort-class-members', + '37:2 warning Expected method _method to come before property b1 sort-class-members/sort-class-members', ]); }); test('Disallow DOMContentLoaded', async () => { - const frontend = await eslint( - 'test/fixtures/eslint/frontend/dom-content-loaded.ts', + const result = await eslint( + 'test/fixtures/eslint/frontend/dom-content-loaded.js', 'no-restricted-syntax', ); - expect(frontend).toStrictEqual([ + expect(result).toStrictEqual([ "1:1 error Avoid using 'DOMContentLoaded'. Use 'defer' or 'type=module' attribute instead no-restricted-syntax", ]); }); test('no-click-event', async () => { const result = await eslint( - 'test/fixtures/eslint/no-click-event.ts', + 'test/fixtures/eslint/frontend/no-click-event.js', '@d-zero/no-click-event', ); expect(result).toStrictEqual([ @@ -100,6 +181,33 @@ describe('ESLint', () => { '15:1 warning Avoid using click events. Consider using the Invoker Commands API instead. See: https://developer.mozilla.org/docs/Web/API/Invoker_Commands_API @d-zero/no-click-event', ]); }); + + test('regexp', async () => { + const result = await eslint( + 'test/fixtures/eslint/regexp.js', + 'regexp/no-useless-escape', + ); + expect(result).toStrictEqual([ + '1:18 error Unnecessary escape character: \\a regexp/no-useless-escape', + ]); + }); + + test('jsdoc', async () => { + const result = await eslint('test/fixtures/eslint/jsdoc.js', 'jsdoc/require-jsdoc'); + expect(result).toStrictEqual([ + '1:8 warning Missing JSDoc comment jsdoc/require-jsdoc', + ]); + }); + + test('no-extraneous-dependencies', async () => { + const result = await eslint( + 'test/fixtures/eslint/no-extraneous-dependencies.js', + 'import-x/no-extraneous-dependencies', + ); + expect(result).toStrictEqual([ + "1:1 error 'lodash' should be listed in the project's dependencies. Run 'yarn add lodash' to add it import-x/no-extraneous-dependencies", + ]); + }); }); describe('markuplint', () => { diff --git a/test/fixtures/eslint/eslint.config.js b/test/fixtures/eslint/eslint.config.js index 0debe452..80cc8f09 100644 --- a/test/fixtures/eslint/eslint.config.js +++ b/test/fixtures/eslint/eslint.config.js @@ -4,4 +4,4 @@ import dz from '@d-zero/eslint-config'; * @type {import('eslint').Linter.Config[]} */ -export default [...dz.configs.standard]; +export default [...dz.configs.base]; diff --git a/test/fixtures/eslint/frontend/dom-content-loaded.ts b/test/fixtures/eslint/frontend/dom-content-loaded.js similarity index 100% rename from test/fixtures/eslint/frontend/dom-content-loaded.ts rename to test/fixtures/eslint/frontend/dom-content-loaded.js diff --git a/test/fixtures/eslint/no-click-event.ts b/test/fixtures/eslint/frontend/no-click-event.js similarity index 95% rename from test/fixtures/eslint/no-click-event.ts rename to test/fixtures/eslint/frontend/no-click-event.js index 69201121..ec46faf6 100644 --- a/test/fixtures/eslint/no-click-event.ts +++ b/test/fixtures/eslint/frontend/no-click-event.js @@ -8,7 +8,7 @@ if (button) { } // Pattern 3: jQuery .on('click') -declare const $: any; +/* global $ */ $('#element').on('click', () => {}); // Pattern 4: jQuery .click(handler) diff --git a/test/fixtures/eslint/frontend/prefer-top-level-await.ts b/test/fixtures/eslint/frontend/prefer-top-level-await.ts deleted file mode 100644 index d25a6f03..00000000 --- a/test/fixtures/eslint/frontend/prefer-top-level-await.ts +++ /dev/null @@ -1,5 +0,0 @@ -async function asyncFn() { - // do nothing -} - -void asyncFn(); diff --git a/test/fixtures/eslint/frontend/tsconfig.json b/test/fixtures/eslint/frontend/tsconfig.json deleted file mode 100644 index ece0c0e5..00000000 --- a/test/fixtures/eslint/frontend/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["@d-zero/tsconfig"], - "compilerOptions": { - "noEmit": true - }, - "include": ["**/*.ts"] -} diff --git a/test/fixtures/eslint/jsdoc.js b/test/fixtures/eslint/jsdoc.js new file mode 100644 index 00000000..76aa43fa --- /dev/null +++ b/test/fixtures/eslint/jsdoc.js @@ -0,0 +1,3 @@ +export function undocumented(value) { + return value; +} diff --git a/test/fixtures/eslint/no-extraneous-dependencies.js b/test/fixtures/eslint/no-extraneous-dependencies.js new file mode 100644 index 00000000..1ec1d3cf --- /dev/null +++ b/test/fixtures/eslint/no-extraneous-dependencies.js @@ -0,0 +1,3 @@ +import lodash from 'lodash'; + +console.log(lodash); diff --git a/test/fixtures/eslint/node/eslint.config.js b/test/fixtures/eslint/node/eslint.config.js deleted file mode 100644 index f75c34a5..00000000 --- a/test/fixtures/eslint/node/eslint.config.js +++ /dev/null @@ -1,7 +0,0 @@ -import dz from '@d-zero/eslint-config'; - -/** - * @type {import('eslint').Linter.Config[]} - */ - -export default [...dz.configs.node]; diff --git a/test/fixtures/eslint/node/prefer-top-level-await.ts b/test/fixtures/eslint/node/prefer-top-level-await.ts deleted file mode 100644 index d25a6f03..00000000 --- a/test/fixtures/eslint/node/prefer-top-level-await.ts +++ /dev/null @@ -1,5 +0,0 @@ -async function asyncFn() { - // do nothing -} - -void asyncFn(); diff --git a/test/fixtures/eslint/node/tsconfig.json b/test/fixtures/eslint/node/tsconfig.json deleted file mode 100644 index ece0c0e5..00000000 --- a/test/fixtures/eslint/node/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["@d-zero/tsconfig"], - "compilerOptions": { - "noEmit": true - }, - "include": ["**/*.ts"] -} diff --git a/test/fixtures/eslint/regexp.js b/test/fixtures/eslint/regexp.js new file mode 100644 index 00000000..d410279b --- /dev/null +++ b/test/fixtures/eslint/regexp.js @@ -0,0 +1,3 @@ +const pattern = /\a/; + +console.log(pattern); diff --git a/test/fixtures/eslint/sort-class-members.ts b/test/fixtures/eslint/sort-class-members.js similarity index 87% rename from test/fixtures/eslint/sort-class-members.ts rename to test/fixtures/eslint/sort-class-members.js index b13629d5..f131e8a5 100644 --- a/test/fixtures/eslint/sort-class-members.ts +++ b/test/fixtures/eslint/sort-class-members.js @@ -16,7 +16,7 @@ export class Test2 { export class Test3 { #a = true; - readonly c1 = true; + c1 = true; c2 = true; b2 = () => {}; b1 = () => {}; @@ -34,7 +34,7 @@ export class Test3 { } constructor() {} - protected _method() {} + _method() {} } export class Test4 extends Test3 { @@ -43,7 +43,7 @@ export class Test4 extends Test3 { this.#privateMethod(); } - protected override _method() { + _method() { super._method(); } #privateMethod() {} diff --git a/test/fixtures/eslint/tsconfig.json b/test/fixtures/eslint/tsconfig.json deleted file mode 100644 index ece0c0e5..00000000 --- a/test/fixtures/eslint/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["@d-zero/tsconfig"], - "compilerOptions": { - "noEmit": true - }, - "include": ["**/*.ts"] -} diff --git a/test/fixtures/markuplint/image-naming-test.html b/test/fixtures/markuplint/image-naming-test.html index ccc2921c..4e0ae79c 100644 --- a/test/fixtures/markuplint/image-naming-test.html +++ b/test/fixtures/markuplint/image-naming-test.html @@ -1,10 +1,10 @@ - + Image Naming Convention Test - - + +

Image Naming Test

@@ -22,5 +22,5 @@

Image Naming Test

Uppercase letters Underscore in filename Uppercase extension - - \ No newline at end of file + + diff --git a/test/fixtures/markuplint/valid-image-naming.html b/test/fixtures/markuplint/valid-image-naming.html index a5126e16..7c72da6f 100644 --- a/test/fixtures/markuplint/valid-image-naming.html +++ b/test/fixtures/markuplint/valid-image-naming.html @@ -1,12 +1,12 @@ - + Valid Image Naming Test - - + +

Valid Image Names

- + Hero banner Search icon @@ -14,5 +14,5 @@

Valid Image Names

Team member Star icon Thumbnail - - \ No newline at end of file + + diff --git a/test/fixtures/oxlint/no-click-event.tsx b/test/fixtures/oxlint/no-click-event.tsx new file mode 100644 index 00000000..de9a3351 --- /dev/null +++ b/test/fixtures/oxlint/no-click-event.tsx @@ -0,0 +1,14 @@ +button.addEventListener('click', handler); +; +// oxlint-disable-next-line unicorn/prefer-add-event-listener +button.onclick = handler; +$(button).on('click', handler); +$(button).click(handler); + +document.body.click(); +button.click(); +$(button).click(); +button.addEventListener('focus', handler); +// oxlint-disable-next-line unicorn/prefer-add-event-listener +button.onfocus = handler; +$(button).on('hover', handler); diff --git a/test/fixtures/oxlint/no-click-event.vue b/test/fixtures/oxlint/no-click-event.vue new file mode 100644 index 00000000..2f7758d9 --- /dev/null +++ b/test/fixtures/oxlint/no-click-event.vue @@ -0,0 +1,4 @@ + diff --git a/test/fixtures/prettier/astro.astro b/test/fixtures/prettier/astro.astro new file mode 100644 index 00000000..a052fd21 --- /dev/null +++ b/test/fixtures/prettier/astro.astro @@ -0,0 +1,5 @@ +--- +const name = 'World'; +--- + +

{name}

diff --git a/test/fixtures/stylelint/comment-spacing.css b/test/fixtures/stylelint/comment-spacing.css index 226c9209..cd526912 100644 --- a/test/fixtures/stylelint/comment-spacing.css +++ b/test/fixtures/stylelint/comment-spacing.css @@ -1,11 +1,11 @@ .c-component1 { - /* 波括弧内のコメント - 空行不要 */ - color: var(--color-primary); + /* 波括弧内のコメント - 空行不要 */ + color: var(--color-primary); } /* rule間のコメント - 空行なし */ .c-component2 { - color: var(--color-secondary); + color: var(--color-secondary); } .c-component3 { - color: var(--color-tertiary); + color: var(--color-tertiary); } diff --git a/test/fixtures/stylelint/shorthand-logical.scss b/test/fixtures/stylelint/shorthand-logical.scss index 156c0ffc..641343af 100644 --- a/test/fixtures/stylelint/shorthand-logical.scss +++ b/test/fixtures/stylelint/shorthand-logical.scss @@ -15,21 +15,21 @@ padding: 2rem 1rem; // ❌ padding: 2rem 0 0; // ❌ padding: 1rem 2rem 3rem 4rem; // ❌ - + margin: 1rem 2rem; // ❌ margin: 1rem 0 2rem; // ❌ margin: 1rem 2rem 3rem 4rem; // ❌ - + border-width: 1px 2px; // ❌ border-width: 1px 2px 3px; // ❌ border-width: 1px 2px 3px 4px; // ❌ - + border-style: solid dashed; // ❌ border-color: currentColor transparent; // ❌ - + scroll-padding: 10px 20px; // ❌ scroll-margin: 5px 10px; // ❌ - + border-radius: 4px 8px; // ❌ border-radius: 4px 8px 12px; // ❌ border-radius: 4px 8px 12px 16px; // ❌ @@ -63,4 +63,4 @@ scroll-margin-inline: 8px 12px; // ✅ } -// stylelint-enable declaration-block-no-duplicate-properties, selector-class-pattern, order/properties-order, declaration-empty-line-before, color-named, declaration-property-value-disallowed-list, value-keyword-case \ No newline at end of file +// stylelint-enable declaration-block-no-duplicate-properties, selector-class-pattern, order/properties-order, declaration-empty-line-before, color-named, declaration-property-value-disallowed-list, value-keyword-case diff --git a/test/fixtures/stylelint/transform.scss b/test/fixtures/stylelint/transform.scss index 2a1c54f9..9275dce1 100644 --- a/test/fixtures/stylelint/transform.scss +++ b/test/fixtures/stylelint/transform.scss @@ -29,4 +29,4 @@ transform: translate(var(--x), var(--y)); transform: rotate(calc(45deg + 10deg)); transform: scale(calc(1 + 0.5)); -} \ No newline at end of file +} From 3c2c812dc429f740f39a8f1e44254b5614906c80 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 04:12:07 +0900 Subject: [PATCH 13/25] docs(repo): update v6 migration guide and readme for oxlint/eslint role split --- MIGRATION-v6.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 36 ++++++++++++++----------- 2 files changed, 91 insertions(+), 16 deletions(-) create mode 100644 MIGRATION-v6.md diff --git a/MIGRATION-v6.md b/MIGRATION-v6.md new file mode 100644 index 00000000..d9a566df --- /dev/null +++ b/MIGRATION-v6.md @@ -0,0 +1,71 @@ +# v6 移行ガイド + +## Oxlint の導入と ESLint との役割分担 + +v6 では lint の主軸を Oxlint に切り替えます。Oxlint に実装がない領域(regexp、jsdoc の主要チェック、`import-x/no-extraneous-dependencies`、`no-restricted-syntax`)は、`@d-zero/eslint-config`で ESLint により検査します。 + +1. `@d-zero/oxlint-config`と`@d-zero/oxlint-plugin`を開発依存に追加します。 +2. `oxlint.config.mts`(TypeScript を使わないプロジェクトでは`oxlint.config.mjs`でも可)から共有設定を読み込みます。 +3. `oxlint`を lint コマンドとして実行します。 + +```ts +import config from '@d-zero/oxlint-config'; + +export default { + ...config, + jsPlugins: ['@d-zero/oxlint-plugin'], + rules: { + ...config.rules, + '@d-zero/no-click-event': 'warn', + }, +}; +``` + +`@d-zero/no-click-event`は JavaScript、TypeScript、JSX、TSX の click event handler を検出します。Vue テンプレートの`@click`と`v-on:click`は v6 から検出しません。 + +### ESLint の併用 + +`@d-zero/eslint-config`は Oxlint に実装がない領域(regexp・jsdoc の主要チェック・`import-x/no-extraneous-dependencies`・`import-x/order`・`sort-class-members`・`no-dupe-args`/`no-octal`/`no-redeclare`/`no-undef`)だけを検査します。TypeScript ファイルは対象外です(Oxlint が検査します)。 + +```js +import dz from '@d-zero/eslint-config'; + +export default [...dz.configs.base]; +``` + +DOM/Vue/React 向けの`@d-zero/no-click-event`ルールは`frontend`構成にのみ含まれます。 + +```js +import dz from '@d-zero/eslint-config'; + +export default [...dz.configs.frontend]; +``` + +## Formatter + +JS、TS、JSON、CSS、SCSS、HTML、Markdown、YAML は oxfmt を使用します。Pug と Astro は Prettier を継続使用します。Pug 対応は v7 で廃止予定です。 + +CI では`yarn lint:ci`を使います。このコマンドはファイルを書き換えず、違反があれば失敗します。ローカルでの自動修正は`yarn lint:fix`を使います。 + +oxfmt のフォーマットルールはこのリポジトリの`.oxfmtrc.json`にのみ定義しており、`@d-zero/oxfmt-config`のような配布パッケージは現時点で提供していません。他リポジトリで同じルールを再現したい場合は`.oxfmtrc.json`の内容を手動で複製してください。 + +## lint-staged + +`@d-zero/lint-staged-config`の拡張子別コマンドマッピングを Oxlint/oxfmt ベースに変更しました。pre-commit 時の挙動が変わるため、`lint-staged.config.js`を差し替えるだけのプロジェクトでも影響を受けます。 + +| 拡張子 | v5 まで | v6 から | +| ------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `js` / `ts` / `cjs` / `mjs` / `cts` / `mts` | `eslint --fix` + `prettier --write` | `oxlint --fix` + `oxfmt --write` | +| `jsx` / `tsx` / `vue` / `svelte` | `eslint --fix` + `markuplint` + `prettier --write` | `oxlint --fix` + `markuplint` + `oxfmt --write` | +| `astro` | `eslint --fix` + `markuplint` + `prettier --write` | `oxlint --fix` + `markuplint` + `prettier --write` | +| `css` / `scss` | `stylelint --fix` + `prettier --write` | `stylelint --fix` + `oxfmt --write` | +| `html` | `markuplint` + `prettier --write` | `markuplint` + `oxfmt --write` | +| `json` / `yaml` / `yml` | `prettier --write` | `oxfmt --write` | +| `md` / `mdx` | `prettier --write` + `textlint` | `oxfmt --write` + `textlint` | +| `pug` | `markuplint` + `prettier --write`(変更なし) | `markuplint` + `prettier --write`(変更なし) | + +詳細な対応表は[`packages/@d-zero/lint-staged-config/src/default-mapping.ts`](./packages/@d-zero/lint-staged-config/src/default-mapping.ts)を参照してください。 + +## TypeScript 7 + +TypeScript は 7 系を使用しています。 diff --git a/README.md b/README.md index 4ac7d800..c029266c 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,16 @@ ### Linter & Formatter 設定 -| パッケージ名 | 内容 | -| ---------------------------------------------------------------------- | ------------------------------------------------------------- | -| [`@d-zero/cspell-config`](./packages/%40d-zero/cspell-config/) | [_CSpell_](https://cspell.org/)の設定ファイル | -| [`@d-zero/eslint-config`](./packages/%40d-zero/eslint-config/) | [_ESLint_](https://eslint.org/)の設定ファイル | -| [`@d-zero/markuplint-config`](./packages/%40d-zero/markuplint-config/) | [_Markuplint_](https://markuplint.dev/)の設定ファイル | -| [`@d-zero/prettier-config`](./packages/%40d-zero/prettier-config/) | [_Prettier_](https://prettier.io/)の設定ファイル | -| [`@d-zero/pug-lint-config`](./packages/%40d-zero/pug-lint-config/) | [_pug-lint_](https://github.com/pugjs/pug-lint)の設定ファイル | -| [`@d-zero/stylelint-config`](./packages/%40d-zero/stylelint-config/) | [_Stylelint_](https://stylelint.io/)の設定ファイル | -| [`@d-zero/textlint-config`](./packages/%40d-zero/textlint-config/) | [_textlint_](https://textlint.github.io/)の設定ファイル | +| パッケージ名 | 内容 | +| ---------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| [`@d-zero/cspell-config`](./packages/%40d-zero/cspell-config/) | [_CSpell_](https://cspell.org/)の設定ファイル | +| [`@d-zero/oxlint-config`](./packages/%40d-zero/oxlint-config/) | [_Oxlint_](https://oxc.rs/docs/guide/usage/linter.html)の設定ファイル | +| [`@d-zero/eslint-config`](./packages/%40d-zero/eslint-config/) | [_ESLint_](https://eslint.org/)の設定ファイル(Oxlintが未対応の領域を補う) | +| [`@d-zero/markuplint-config`](./packages/%40d-zero/markuplint-config/) | [_Markuplint_](https://markuplint.dev/)の設定ファイル | +| [`@d-zero/prettier-config`](./packages/%40d-zero/prettier-config/) | [_Prettier_](https://prettier.io/)の設定ファイル | +| [`@d-zero/pug-lint-config`](./packages/%40d-zero/pug-lint-config/) | [_pug-lint_](https://github.com/pugjs/pug-lint)の設定ファイル | +| [`@d-zero/stylelint-config`](./packages/%40d-zero/stylelint-config/) | [_Stylelint_](https://stylelint.io/)の設定ファイル | +| [`@d-zero/textlint-config`](./packages/%40d-zero/textlint-config/) | [_textlint_](https://textlint.github.io/)の設定ファイル | ### ツール & ユーティリティ @@ -26,7 +27,8 @@ | パッケージ名 | 内容 | | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [`@d-zero/eslint-plugin`](./packages/%40d-zero/eslint-plugin/) | [`@d-zero/eslint-config`](./packages/%40d-zero/eslint-config/)に設定されているディーゼロ独自のESLintルール | +| [`@d-zero/oxlint-plugin`](./packages/%40d-zero/oxlint-plugin/) | [`@d-zero/oxlint-config`](./packages/%40d-zero/oxlint-config/)で利用するディーゼロ独自のOxlintルール | +| [`@d-zero/eslint-plugin`](./packages/%40d-zero/eslint-plugin/) | [`@d-zero/eslint-config`](./packages/%40d-zero/eslint-config/)で利用するディーゼロ独自のESLintルール | | [`@d-zero/stylelint-rules`](./packages/%40d-zero/stylelint-rules/) | [`@d-zero/stylelint-config`](./packages/%40d-zero/stylelint-config/)に設定されているディーゼロ独自のStylelintルール | | [`@d-zero/csstree-scss-syntax`](./packages/%40d-zero/csstree-scss-syntax/) | [`@d-zero/stylelint-rules`](./packages/%40d-zero/stylelint-rules/)内で使用されている[CSSTree](https://github.com/csstree/csstree)用の[SCSS](https://sass-lang.com/documentation/syntax/#scss)パーサープラグイン | @@ -40,15 +42,17 @@ - このバージョンは[Renovate](https://www.mend.io/renovate/)によってアップデートされます。 - [Commitizen](https://github.com/commitizen/cz-cli)を利用してコミットメッセージを作ります。メッセージは[_commitlint_](https://commitlint.js.org/)によってチェックされます。 - [actionlint](https://github.com/rhysd/actionlint)によってGitHub Actionsの設定ファイルを検証しています。 +- [TypeScript](https://www.typescriptlang.org/)は7系を使用しています。 ### メンテ用コマンド -| コマンド | 内容 | -| --------------- | -------------------------------------------------------------------------------------- | -| `npm run build` | 各パッケージのビルドを行います | -| `npm run lint` | リポジトリ内のファイルのリント・自動フォーマット・型チェック・スペルチェックを行います | -| `npm run test` | テスト(*Vitest*を実行します) | -| `npm run co` | Gitコミットを*Commitizen*経由で実行します | +| コマンド | 内容 | +| --------------- | -------------------------------------------------------------------------------- | +| `npm run build` | 各パッケージのビルドを行います | +| `yarn lint` | リポジトリ内のファイルを変更せずに、リント・フォーマット・型・スペルを検査します | +| `yarn lint:fix` | oxlint/oxfmt/Prettier(Pug・Astro)で自動修正します | +| `npm run test` | テスト(*Vitest*を実行します) | +| `npm run co` | Gitコミットを*Commitizen*経由で実行します | --- From aa87919a68909fc961ce541963ddd4f6ead76b05 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Wed, 19 Aug 2026 09:24:54 +0900 Subject: [PATCH 14/25] fix(eslint-plugin): detect Vue @click and v-on:click via template body visitor Vue's