@yuu1111/quality-check 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ja.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # @yuu1111/quality-check
4
4
 
5
- Projectごとのscriptから個別に呼んでいたBiome、型検査、Knip、comment-check、document-style-check、TSDoc checkerを1つのCLIへまとめる baselineの差分判定もここで行う
5
+ Projectごとのscriptから個別に呼んでいたBiome、型検査、Knip、code-style-check、comment-check、document-style-check、TSDoc checkerを1つのCLIへまとめる baselineの差分判定もここで行う
6
6
 
7
7
  ## Install
8
8
 
@@ -30,6 +30,7 @@ export default defineConfig({
30
30
  biome: true,
31
31
  typecheck: true,
32
32
  knip: true,
33
+ "code-style-check": true,
33
34
  "comment-check": true,
34
35
  "document-style-check": true,
35
36
  "tsdoc-check": true,
@@ -73,7 +74,7 @@ quality-check: 1 of 3 engines failed
73
74
  | `config` | engineごとの起動条件 |
74
75
  | `baseline` | baseline fileのpath `false` なら差分判定を行わない |
75
76
 
76
- engineは `biome` → `typecheck` → `knip` → `comment-check` → `document-style-check` → `tsdoc-check` の順に実行する
77
+ engineは `biome` → `typecheck` → `knip` → `code-style-check` → `comment-check` → `document-style-check` → `tsdoc-check` の順に実行する
77
78
 
78
79
  `engines` は起動の委任だけを表し、起動条件は `config` のengineの下へ置く engineごとの条件は複数行のobjectとして書き、ruleやoptionを足しても他のengineの行が動かないようにする engineが受け取る条件は次のとおり
79
80
 
@@ -82,6 +83,7 @@ engineは `biome` → `typecheck` → `knip` → `comment-check` → `document-s
82
83
  | `biome` | `biome check` | `targets`、`args` 除外pathは `biome.json` が持つ |
83
84
  | `typecheck` | `tsc --noEmit` | `args`、`projects` 設定は `tsconfig.json` が持つ |
84
85
  | `knip` | `knip` | `args` 設定は `knip.ts` が持つ |
86
+ | `code-style-check` | `code-style-check --json` | `ignore`、`targets`、`args` |
85
87
  | `comment-check` | `comment-check --json` | `ignore`、`targets`、`args`、`enable`(有効にするrule名) |
86
88
  | `document-style-check` | `document-style-check lint --json` | `ignore`、`targets`、`args`、`enable`(有効にするrule名) |
87
89
  | `tsdoc-check` | `tsdoc-check --json` | `ignore`、`targets`、`args`、`error`(違反として扱うrule名) |
@@ -124,4 +126,3 @@ engineのbinaryは利用Projectの `node_modules/.bin` から実行時に解決
124
126
  `enable` は `comment-check` と `document-style-check` のopt-in ruleだけを受け取り、それぞれのcommandの `--enable <rule>` になる 他のengineへ書くとunknown optionとして拒否し、既定のrule集合は変えない このCLIはengineを同梱しないため、opt-in ruleを有効にするProjectは対応するengine packageも同じ変更で更新する
125
127
 
126
128
  `typecheck` は `projects` に並べたtsconfigごとに `tsc --noEmit -p <path>` を起動する 省略時はカレントの `tsconfig.json` を1回だけ読み、`args` はすべての起動へ足す
127
-
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # @yuu1111/quality-check
4
4
 
5
- Runs Biome, the type checker, Knip, comment-check, document-style-check, and the
6
- TSDoc checker from one CLI instead of one script per project. The baseline diff
7
- lives here too.
5
+ Runs Biome, the type checker, Knip, code-style-check, comment-check,
6
+ document-style-check, and the TSDoc checker from one CLI instead of one script per project.
7
+ The baseline diff lives here too.
8
8
 
9
9
  ## Install
10
10
 
@@ -33,6 +33,7 @@ export default defineConfig({
33
33
  biome: true,
34
34
  typecheck: true,
35
35
  knip: true,
36
+ "code-style-check": true,
36
37
  "comment-check": true,
37
38
  "document-style-check": true,
38
39
  "tsdoc-check": true,
@@ -77,8 +78,8 @@ quality-check: 1 of 3 engines failed
77
78
  | `config` | Conditions of each engine |
78
79
  | `baseline` | Baseline file path; `false` disables the diff |
79
80
 
80
- Engines run in the order `biome`, `typecheck`, `knip`, `comment-check`,
81
- `document-style-check`, `tsdoc-check`.
81
+ Engines run in the order `biome`, `typecheck`, `knip`, `code-style-check`,
82
+ `comment-check`, `document-style-check`, `tsdoc-check`.
82
83
 
83
84
  `engines` only delegates the start-up, and the conditions belong under the
84
85
  engine in `config`. Write an engine's conditions as a multi-line object, so a
@@ -89,6 +90,7 @@ new rule or option changes one engine's block alone. Each engine runs:
89
90
  | `biome` | `biome check` | `targets`, `args`; `biome.json` holds the excluded paths |
90
91
  | `typecheck` | `tsc --noEmit` | `args`, `projects`; `tsconfig.json` holds the settings |
91
92
  | `knip` | `knip` | `args`; `knip.ts` holds the settings |
93
+ | `code-style-check` | `code-style-check --json` | `ignore`, `targets`, `args` |
92
94
  | `comment-check` | `comment-check --json` | `ignore`, `targets`, `args`, `enable` (rule names to turn on) |
93
95
  | `document-style-check` | `document-style-check lint --json` | `ignore`, `targets`, `args`, `enable` (rule names to turn on) |
94
96
  | `tsdoc-check` | `tsdoc-check --json` | `ignore`, `targets`, `args`, `error` (rule names to fail on) |
package/dist/cli.js CHANGED
@@ -198,6 +198,7 @@ var ENGINE_NAMES = [
198
198
  "biome",
199
199
  "typecheck",
200
200
  "knip",
201
+ "code-style-check",
201
202
  "comment-check",
202
203
  "document-style-check",
203
204
  "tsdoc-check"
@@ -219,6 +220,7 @@ var ENGINE_OPTION_KEYS = {
219
220
  biome: ["args", "ignore", "targets"],
220
221
  typecheck: ["args", "ignore", "projects", "targets"],
221
222
  knip: ["args", "ignore", "targets"],
223
+ "code-style-check": ["args", "ignore", "targets"],
222
224
  "comment-check": ["args", "enable", "ignore", "targets"],
223
225
  "document-style-check": ["args", "enable", "ignore", "targets"],
224
226
  "tsdoc-check": ["args", "error", "ignore", "targets"]
@@ -375,6 +377,7 @@ import { existsSync as existsSync3 } from "fs";
375
377
  import { dirname, join } from "path";
376
378
  var ENGINE_BINS = {
377
379
  biome: "biome",
380
+ "code-style-check": "code-style-check",
378
381
  "comment-check": "comment-check",
379
382
  "document-style-check": "document-style-check",
380
383
  knip: "knip",
@@ -393,6 +396,7 @@ var ENGINE_LIMITS = {
393
396
  ignore: "knip.ts holds its settings",
394
397
  targets: "knip analyzes the whole project"
395
398
  },
399
+ "code-style-check": {},
396
400
  "comment-check": {},
397
401
  "document-style-check": {},
398
402
  "tsdoc-check": {}
@@ -412,7 +416,7 @@ function skippedEngineOptions(name, options) {
412
416
  return skipped;
413
417
  }
414
418
  function isFindingEngine(name) {
415
- return name === "comment-check" || name === "document-style-check" || name === "tsdoc-check";
419
+ return name === "code-style-check" || name === "comment-check" || name === "document-style-check" || name === "tsdoc-check";
416
420
  }
417
421
  function resolveExecutable(name, cwd) {
418
422
  const shims = process.platform === "win32" ? WINDOWS_SHIMS : POSIX_SHIMS;
@@ -507,6 +511,9 @@ function buildEngineCommand(name, executable, context) {
507
511
  ...extra
508
512
  ];
509
513
  }
514
+ if (name === "code-style-check") {
515
+ return [executable, "--json", ...targets, ...ignoreArguments, ...extra];
516
+ }
510
517
  return [
511
518
  executable,
512
519
  "--json",
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@yuu1111/quality-check",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "Integrated quality check runner",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/yuu1111/configs.git",
8
- "directory": "packages/quality-check"
8
+ "directory": "packages/engine/quality-check"
9
9
  },
10
10
  "type": "module",
11
11
  "bin": {
package/src/config.ts CHANGED
@@ -9,6 +9,7 @@ export const ENGINE_NAMES = [
9
9
  "biome",
10
10
  "typecheck",
11
11
  "knip",
12
+ "code-style-check",
12
13
  "comment-check",
13
14
  "document-style-check",
14
15
  "tsdoc-check",
@@ -70,6 +71,7 @@ export interface EngineConfigMap {
70
71
  biome: EngineOptions;
71
72
  typecheck: TypecheckOptions;
72
73
  knip: EngineOptions;
74
+ "code-style-check": EngineOptions;
73
75
  "comment-check": CommentCheckOptions;
74
76
  "document-style-check": DocumentStyleCheckOptions;
75
77
  "tsdoc-check": TsdocCheckOptions;
@@ -123,6 +125,7 @@ const ENGINE_OPTION_KEYS: Record<EngineName, readonly string[]> = {
123
125
  biome: ["args", "ignore", "targets"],
124
126
  typecheck: ["args", "ignore", "projects", "targets"],
125
127
  knip: ["args", "ignore", "targets"],
128
+ "code-style-check": ["args", "ignore", "targets"],
126
129
  "comment-check": ["args", "enable", "ignore", "targets"],
127
130
  "document-style-check": ["args", "enable", "ignore", "targets"],
128
131
  "tsdoc-check": ["args", "error", "ignore", "targets"],
package/src/engines.ts CHANGED
@@ -29,6 +29,7 @@ export type EngineRunner = (
29
29
  */
30
30
  export const ENGINE_BINS: Record<EngineName, string> = {
31
31
  biome: "biome",
32
+ "code-style-check": "code-style-check",
32
33
  "comment-check": "comment-check",
33
34
  "document-style-check": "document-style-check",
34
35
  knip: "knip",
@@ -76,6 +77,7 @@ export const ENGINE_LIMITS: Record<
76
77
  ignore: "knip.ts holds its settings",
77
78
  targets: "knip analyzes the whole project",
78
79
  },
80
+ "code-style-check": {},
79
81
  "comment-check": {},
80
82
  "document-style-check": {},
81
83
  "tsdoc-check": {},
@@ -107,6 +109,7 @@ export function skippedEngineOptions(
107
109
  */
108
110
  export function isFindingEngine(name: EngineName): boolean {
109
111
  return (
112
+ name === "code-style-check" ||
110
113
  name === "comment-check" ||
111
114
  name === "document-style-check" ||
112
115
  name === "tsdoc-check"
@@ -249,6 +252,9 @@ export function buildEngineCommand(
249
252
  ...extra,
250
253
  ];
251
254
  }
255
+ if (name === "code-style-check") {
256
+ return [executable, "--json", ...targets, ...ignoreArguments, ...extra];
257
+ }
252
258
  return [
253
259
  executable,
254
260
  "--json",