@alint-js/cli 0.3.1 → 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 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
- In order to provision models and LLMs for `alint` while keeping it clean for contributors of your project without requiring them to set up their own LLMs, `alint` offers layers of configuration covering **Project Local**, **Global**, project config, and environment or CLI overrides.
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
- - `~/.config/alint/config.toml` stores user-level provider setup.
225
- - `.alint/config.toml` stores optional project-local provider setup.
226
- - `alint.config.*` stores project lint config, plugins, files, ignores, and rule settings.
227
- - Environment variables and CLI flags are the highest-priority overrides.
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:
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as executeCli } from "../cli-CL433bER.mjs";
2
+ import { t as executeCli } from "../cli-CP8pWPS7.mjs";
3
3
  import process from "node:process";
4
4
  //#region src/bin/index.ts
5
5
  executeCli(process.argv, {
@@ -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.1";
20
+ var version = "0.3.2";
21
21
  //#endregion
22
22
  //#region src/cli/output.ts
23
23
  function escapeLineValue(value) {
@@ -651,11 +651,16 @@ function formatUnknownProvider(providerId, scope) {
651
651
  return `unknown provider "${escapeLineValue(providerId)}" in ${scope} setup config.${hint}\n`;
652
652
  }
653
653
  async function loadMergedSetupConfig(io) {
654
- const globalSetupConfigPath = getGlobalSetupConfigPath(io.env ?? process.env);
655
- const projectSetupConfigPath = getProjectSetupConfigPath(io.cwd);
656
- const [globalSetupConfig, projectSetupConfig] = await Promise.all([loadSetupConfig(globalSetupConfigPath), loadSetupConfig(projectSetupConfigPath)]);
654
+ const { globalSetupConfig, projectSetupConfig } = await loadSetupConfigs(io);
657
655
  return mergeSetupConfigs(globalSetupConfig, projectSetupConfig);
658
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
+ }
659
664
  async function loadScopedSetupConfig(io, local) {
660
665
  const scope = local === true ? "local" : "global";
661
666
  const path = scope === "local" ? getProjectSetupConfigPath(io.cwd) : getGlobalSetupConfigPath(io.env ?? process.env);
@@ -665,6 +670,15 @@ async function loadScopedSetupConfig(io, local) {
665
670
  scope
666
671
  };
667
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
+ }
668
682
  //#endregion
669
683
  //#region src/cli/commands/config/models/benchmark-progress.ts
670
684
  /** Keeps the benchmark preview live without mixing transient frames into the final stdout table. */
@@ -1536,7 +1550,7 @@ function createProviderEditorPrompts(prompts) {
1536
1550
  async headerInput() {
1537
1551
  return textResult(prompts, await prompts.text({
1538
1552
  message: "Headers (leave empty to skip; type .. to go back)",
1539
- placeholder: "Authorization=Bearer token, X-Test=true",
1553
+ placeholder: "Authorization=Bearer sk-or-v1-xxxxxx, X-Test=true",
1540
1554
  validate: (value) => {
1541
1555
  if (isBackInput(value ?? "")) return;
1542
1556
  try {
@@ -3421,7 +3435,7 @@ function isNodeError(error) {
3421
3435
  }
3422
3436
  async function runLintCommand(files, options, io, interceptConsoleOutput) {
3423
3437
  if (options.config) await assertConfigExists(io.cwd, options.config);
3424
- const [setupConfig, config] = await Promise.all([loadMergedSetupConfig(io), loadAlintConfig(io.cwd, options.config)]);
3438
+ const [{ defaultModel, setupConfig }, config] = await Promise.all([loadRunSetupConfig(io), loadAlintConfig(io.cwd, options.config)]);
3425
3439
  let lintTargets;
3426
3440
  try {
3427
3441
  lintTargets = await findLintTargets({
@@ -3462,6 +3476,7 @@ async function runLintCommand(files, options, io, interceptConsoleOutput) {
3462
3476
  cacheOnly: options.cacheOnly,
3463
3477
  config,
3464
3478
  cwd: io.cwd,
3479
+ defaultModel,
3465
3480
  directories: lintTargets.directories,
3466
3481
  files: lintTargets.files,
3467
3482
  modelOverride: options.model,
@@ -3660,7 +3675,7 @@ async function runInteractiveSetup(io) {
3660
3675
  label: "Global",
3661
3676
  value: "global"
3662
3677
  }, {
3663
- label: "Local project",
3678
+ label: "Local project - Warning: You are about to store your credentials in the folder",
3664
3679
  value: "local"
3665
3680
  }]
3666
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-CL433bER.mjs";
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.1",
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/config": "0.3.1",
32
- "@alint-js/core": "0.3.1"
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",