@alint-js/cli 0.3.0 → 0.3.2
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.md +14 -11
- package/dist/bin/index.mjs +1 -1
- package/dist/{cli-C-ZS6d3a.mjs → cli-CP8pWPS7.mjs} +23 -9
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -167,6 +167,8 @@ Override the matched model for a one-off run:
|
|
|
167
167
|
alint --model qwen:8b demo.ts
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
+
When the project-local setup does not configure any models, model calls without a rule-level or call-level selector use the `default` alias from the global setup. Rule selectors continue to use normal model matching. Configuring at least one model in `.alint/config.toml` restores project-first matching for unselected calls. An explicit `--model` override always takes precedence.
|
|
171
|
+
|
|
170
172
|
Ask model-backed rules to write diagnostics in a specific language:
|
|
171
173
|
|
|
172
174
|
```bash
|
|
@@ -213,18 +215,12 @@ alint output inspect alint-output.json
|
|
|
213
215
|
|
|
214
216
|
#### Configurations
|
|
215
217
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
The priorities follow:
|
|
219
|
-
|
|
220
|
-
```text
|
|
221
|
-
~/.config/alint/config.toml < .alint/config.toml < alint.config.* < environment and CLI overrides
|
|
222
|
-
```
|
|
218
|
+
`alint` uses two configuration systems with separate schemas and responsibilities:
|
|
223
219
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
220
|
+
| Configuration | Priority (high → low) | Content |
|
|
221
|
+
| --- |--------------------------------------------------------------------------------------|----------------------------------------------------------------------|
|
|
222
|
+
| Setup | Environment and CLI overrides > `.alint/config.toml` > `~/.config/alint/config.toml` | Providers, models, and runner defaults. |
|
|
223
|
+
| Lint | Environment and CLI overrides > `alint.config.*` | Files, ignores, plugins, rules, and other project-level lint policy. |
|
|
228
224
|
|
|
229
225
|
Use setup TOML for machine or project provider definitions:
|
|
230
226
|
|
|
@@ -241,8 +237,15 @@ id = "qwen:8b"
|
|
|
241
237
|
name = "qwen:8b"
|
|
242
238
|
size = "small"
|
|
243
239
|
capabilities = [ "tool-call" ]
|
|
240
|
+
|
|
241
|
+
[providers.models.default_params]
|
|
242
|
+
thinking = { type = "disabled" }
|
|
244
243
|
```
|
|
245
244
|
|
|
245
|
+
`default_params` is merged into every chat request for that model. Use it for provider-specific request fields that are not covered by the rest of the model entry.
|
|
246
|
+
|
|
247
|
+
`alint` structured output forces a tool call (`tool_choice`). Some models, such as DeepSeek V4, reject that combination while thinking/reasoning is enabled. For those models, set `thinking = { type = "disabled" }` as above so structured output can run.
|
|
248
|
+
|
|
246
249
|
Note that `-N` stands for `--no-interactive`, which means this is not an interactive setup. TUI is not required, so you can ask Codex or Claude Code to run this command for you.
|
|
247
250
|
|
|
248
251
|
You can also use `--local` to write the config in the current project:
|
package/dist/bin/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import Gitignore from "gitignore-fs";
|
|
|
17
17
|
import { Minimatch, minimatch } from "minimatch";
|
|
18
18
|
import { errorMessageFrom as errorMessageFrom$1 } from "@moeru/std";
|
|
19
19
|
//#region package.json
|
|
20
|
-
var version = "0.3.
|
|
20
|
+
var version = "0.3.2";
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/cli/output.ts
|
|
23
23
|
function escapeLineValue(value) {
|
|
@@ -260,8 +260,7 @@ function formatMiniBar(options) {
|
|
|
260
260
|
if (width - completeCells === 0) return `[${"█".repeat(width)}]`;
|
|
261
261
|
if (ratio < animationThreshold) return formatStaticBar(completeCells, width);
|
|
262
262
|
const frontierIndex = completeCells;
|
|
263
|
-
const phase = positiveModulo(options.tick, frontierIndex +
|
|
264
|
-
if (phase === frontierIndex + 1) return formatStaticBar(completeCells, width);
|
|
263
|
+
const phase = positiveModulo(options.tick, frontierIndex + 1);
|
|
265
264
|
return `[${Array.from({ length: width }, (_, index) => {
|
|
266
265
|
if (phase === 0) {
|
|
267
266
|
if (index === 0) return "▓";
|
|
@@ -652,11 +651,16 @@ function formatUnknownProvider(providerId, scope) {
|
|
|
652
651
|
return `unknown provider "${escapeLineValue(providerId)}" in ${scope} setup config.${hint}\n`;
|
|
653
652
|
}
|
|
654
653
|
async function loadMergedSetupConfig(io) {
|
|
655
|
-
const
|
|
656
|
-
const projectSetupConfigPath = getProjectSetupConfigPath(io.cwd);
|
|
657
|
-
const [globalSetupConfig, projectSetupConfig] = await Promise.all([loadSetupConfig(globalSetupConfigPath), loadSetupConfig(projectSetupConfigPath)]);
|
|
654
|
+
const { globalSetupConfig, projectSetupConfig } = await loadSetupConfigs(io);
|
|
658
655
|
return mergeSetupConfigs(globalSetupConfig, projectSetupConfig);
|
|
659
656
|
}
|
|
657
|
+
async function loadRunSetupConfig(io) {
|
|
658
|
+
const { globalSetupConfig, projectSetupConfig } = await loadSetupConfigs(io);
|
|
659
|
+
return {
|
|
660
|
+
defaultModel: projectSetupConfig.providers.some((provider) => provider.models.length > 0) ? void 0 : "default",
|
|
661
|
+
setupConfig: mergeSetupConfigs(globalSetupConfig, projectSetupConfig)
|
|
662
|
+
};
|
|
663
|
+
}
|
|
660
664
|
async function loadScopedSetupConfig(io, local) {
|
|
661
665
|
const scope = local === true ? "local" : "global";
|
|
662
666
|
const path = scope === "local" ? getProjectSetupConfigPath(io.cwd) : getGlobalSetupConfigPath(io.env ?? process.env);
|
|
@@ -666,6 +670,15 @@ async function loadScopedSetupConfig(io, local) {
|
|
|
666
670
|
scope
|
|
667
671
|
};
|
|
668
672
|
}
|
|
673
|
+
async function loadSetupConfigs(io) {
|
|
674
|
+
const globalSetupConfigPath = getGlobalSetupConfigPath(io.env ?? process.env);
|
|
675
|
+
const projectSetupConfigPath = getProjectSetupConfigPath(io.cwd);
|
|
676
|
+
const [globalSetupConfig, projectSetupConfig] = await Promise.all([loadSetupConfig(globalSetupConfigPath), loadSetupConfig(projectSetupConfigPath)]);
|
|
677
|
+
return {
|
|
678
|
+
globalSetupConfig,
|
|
679
|
+
projectSetupConfig
|
|
680
|
+
};
|
|
681
|
+
}
|
|
669
682
|
//#endregion
|
|
670
683
|
//#region src/cli/commands/config/models/benchmark-progress.ts
|
|
671
684
|
/** Keeps the benchmark preview live without mixing transient frames into the final stdout table. */
|
|
@@ -1537,7 +1550,7 @@ function createProviderEditorPrompts(prompts) {
|
|
|
1537
1550
|
async headerInput() {
|
|
1538
1551
|
return textResult(prompts, await prompts.text({
|
|
1539
1552
|
message: "Headers (leave empty to skip; type .. to go back)",
|
|
1540
|
-
placeholder: "Authorization=Bearer
|
|
1553
|
+
placeholder: "Authorization=Bearer sk-or-v1-xxxxxx, X-Test=true",
|
|
1541
1554
|
validate: (value) => {
|
|
1542
1555
|
if (isBackInput(value ?? "")) return;
|
|
1543
1556
|
try {
|
|
@@ -3422,7 +3435,7 @@ function isNodeError(error) {
|
|
|
3422
3435
|
}
|
|
3423
3436
|
async function runLintCommand(files, options, io, interceptConsoleOutput) {
|
|
3424
3437
|
if (options.config) await assertConfigExists(io.cwd, options.config);
|
|
3425
|
-
const [setupConfig, config] = await Promise.all([
|
|
3438
|
+
const [{ defaultModel, setupConfig }, config] = await Promise.all([loadRunSetupConfig(io), loadAlintConfig(io.cwd, options.config)]);
|
|
3426
3439
|
let lintTargets;
|
|
3427
3440
|
try {
|
|
3428
3441
|
lintTargets = await findLintTargets({
|
|
@@ -3463,6 +3476,7 @@ async function runLintCommand(files, options, io, interceptConsoleOutput) {
|
|
|
3463
3476
|
cacheOnly: options.cacheOnly,
|
|
3464
3477
|
config,
|
|
3465
3478
|
cwd: io.cwd,
|
|
3479
|
+
defaultModel,
|
|
3466
3480
|
directories: lintTargets.directories,
|
|
3467
3481
|
files: lintTargets.files,
|
|
3468
3482
|
modelOverride: options.model,
|
|
@@ -3661,7 +3675,7 @@ async function runInteractiveSetup(io) {
|
|
|
3661
3675
|
label: "Global",
|
|
3662
3676
|
value: "global"
|
|
3663
3677
|
}, {
|
|
3664
|
-
label: "Local project",
|
|
3678
|
+
label: "Local project - Warning: You are about to store your credentials in the folder",
|
|
3665
3679
|
value: "local"
|
|
3666
3680
|
}]
|
|
3667
3681
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as formatJson, n as formatDiagnostics, r as formatStylish, t as executeCli } from "./cli-
|
|
1
|
+
import { i as formatJson, n as formatDiagnostics, r as formatStylish, t as executeCli } from "./cli-CP8pWPS7.mjs";
|
|
2
2
|
import { ignorePatternsAIAgents, ignorePatternsBuildOutputs, ignorePatternsCaches, ignorePatternsCommon, ignorePatternsEslintDefaults, ignorePatternsGenerated } from "@alint-js/config";
|
|
3
3
|
import { defineConfig } from "@alint-js/core";
|
|
4
4
|
export { defineConfig, executeCli, formatDiagnostics, formatJson, formatStylish, ignorePatternsAIAgents, ignorePatternsBuildOutputs, ignorePatternsCaches, ignorePatternsCommon, ignorePatternsEslintDefaults, ignorePatternsGenerated };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alint-js/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.2",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.mts",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"pathe": "^2.0.3",
|
|
29
29
|
"table": "^6.9.0",
|
|
30
30
|
"tinyrainbow": "^3.1.1",
|
|
31
|
-
"@alint-js/core": "0.3.
|
|
32
|
-
"@alint-js/config": "0.3.
|
|
31
|
+
"@alint-js/core": "0.3.2",
|
|
32
|
+
"@alint-js/config": "0.3.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@pnpm/find-workspace-dir": "^1000.1.5",
|