Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
53fc40f
chore(repo): normalize package.json field order across packages
YusukeHirao Aug 18, 2026
0afd4cb
chore(github): normalize line endings to lf via .gitattributes
YusukeHirao Aug 18, 2026
173bd80
chore(github): run ci on v6 branch pushes and pull requests
YusukeHirao Aug 18, 2026
a57fd53
feat(oxlint): add shared oxlint configuration package
YusukeHirao Aug 18, 2026
149213e
feat(oxlint-plugin): add custom oxlint rules package
YusukeHirao Aug 18, 2026
1cd2949
feat(prettier): add astro formatting support
YusukeHirao Aug 18, 2026
28c919b
feat(lint-staged): switch default command mapping to oxlint and oxfmt
YusukeHirao Aug 18, 2026
f3130a1
refactor(csstree-scss-syntax): convert eslint-disable comment to oxli…
YusukeHirao Aug 18, 2026
aa569c2
refactor(eslint-plugin): drop typescript-eslint dependency
YusukeHirao Aug 18, 2026
0c2a437
refactor(eslint): remove typescript-eslint and delegate typed rules t…
YusukeHirao Aug 18, 2026
7566888
feat(repo): migrate lint pipeline from eslint/prettier to oxlint/oxfmt
YusukeHirao Aug 18, 2026
d9ec328
test(repo): rework lint fixtures and cli specs for oxlint/eslint role…
YusukeHirao Aug 18, 2026
3c2c812
docs(repo): update v6 migration guide and readme for oxlint/eslint ro…
YusukeHirao Aug 18, 2026
aa87919
fix(eslint-plugin): detect Vue @click and v-on:click via template bod…
YusukeHirao Aug 19, 2026
a004a9a
test(repo): drop migration-relative wording from oxlint-config test n…
YusukeHirao Aug 19, 2026
f231bc9
refactor(commitlint): prefer undefined over null in getCZConfig
YusukeHirao Aug 24, 2026
f772d26
refactor(cz): name the monorepo-scopes export and prefer undefined ov…
YusukeHirao Aug 24, 2026
6fa705e
refactor(lint-staged): name the default export and prefer undefined o…
YusukeHirao Aug 24, 2026
286bb49
refactor(stylelint-rules): prefer undefined over null in getValueType
YusukeHirao Aug 24, 2026
3c18785
refactor(stylelint): use String.raw for backslash-heavy patterns
YusukeHirao Aug 24, 2026
de7be46
test(repo): move cli spec helper functions out of describe blocks
YusukeHirao Aug 24, 2026
5522bd1
feat(oxlint): enable rules outside the correctness category
YusukeHirao Aug 24, 2026
126503b
feat(eslint): auto-generate the oxlint overlap disable list
YusukeHirao Aug 24, 2026
02cb1a7
fix(oxlint): drop 4 unicorn rules reintroduced as errors
YusukeHirao Sep 1, 2026
ce7bd9b
fix(eslint): restore pre-migration unicorn rule offs
YusukeHirao Sep 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish
on:
push:
tags:
- "v*"
- 'v*'

concurrency:
group: publish
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- v6
pull_request:
branches:
- main
Expand Down
21 changes: 21 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -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
}
}
]
}
71 changes: 71 additions & 0 deletions MIGRATION-v6.md
Original file line number Diff line number Diff line change
@@ -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 系を使用しています。
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)の設定ファイル |

### ツール & ユーティリティ

Expand All @@ -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)パーサープラグイン |

Expand All @@ -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*経由で実行します |

---

Expand Down
7 changes: 6 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@

// ESLint plugin
"dzero",
"TSES"
"TSES",

// Oxc tools
"oxfmt",
"oxfmtrc",
"oxlint"
],
"overrides": [
{
Expand Down
19 changes: 7 additions & 12 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,24 @@ 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,
},
},
{
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'],
},
];
34 changes: 34 additions & 0 deletions oxlint.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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',
},
},
{
// `null` is Stylelint's own API for explicitly disabling a rule; it isn't a stray
// literal to clean up.
files: ['**/stylelint-config/**'],
rules: {
'unicorn/no-null': 'off',
},
},
],
};
22 changes: 17 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 \"**/*\"",
Expand All @@ -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": {
Expand Down
10 changes: 5 additions & 5 deletions packages/@d-zero/commitlint-config/get-cz-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'node:fs';
import path from 'node:path';

/**
* @returns {Promise<import('cz-customizable').Options | null>}
* @returns {Promise<import('cz-customizable').Options | undefined>}
*/
export async function getCZConfig() {
const cwd = process.cwd();
Expand All @@ -12,12 +12,12 @@ export async function getCZConfig() {
const czConfigPath = packageJson?.config?.['cz-customizable']?.config;

if (!czConfigPath) {
return null;
return;
}

const modPath = czConfigPath.replace(/^(?:\.\/)?node_modules\//, '');
const modulePath = czConfigPath.replace(/^(?:\.\/)?node_modules\//, '');

const czConfig = await import(modPath).catch(() => null);
const czConfig = await import(modulePath).catch(() => {});

return czConfig?.default ?? czConfig ?? null;
return czConfig?.default ?? czConfig;
}
16 changes: 8 additions & 8 deletions packages/@d-zero/cspell-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion packages/@d-zero/csstree-scss-syntax/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading
Loading