@alint-js/config 0.0.9 → 0.0.11
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 +44 -0
- package/dist/index.d.mts +9 -1
- package/dist/index.mjs +41 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# `@alint-js/config`
|
|
2
|
+
|
|
3
|
+
Config loading and setup-file utilities for `alint`.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
This package owns the file-system side of configuration:
|
|
8
|
+
|
|
9
|
+
- loads `alint.config.ts`
|
|
10
|
+
- resolves global and project setup TOML paths
|
|
11
|
+
- parses and stringifies setup TOML
|
|
12
|
+
- merges setup layers
|
|
13
|
+
- writes provider setup files
|
|
14
|
+
- exports built-in ignore pattern groups
|
|
15
|
+
|
|
16
|
+
It is used by `@alint-js/cli` and is useful for tools that need to inspect or prepare an `alint` project without running the linter.
|
|
17
|
+
|
|
18
|
+
## How to use
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import {
|
|
22
|
+
getGlobalSetupConfigPath,
|
|
23
|
+
loadAlintConfig,
|
|
24
|
+
loadSetupConfig,
|
|
25
|
+
writeSetupConfig,
|
|
26
|
+
} from '@alint-js/config'
|
|
27
|
+
|
|
28
|
+
const setupPath = getGlobalSetupConfigPath()
|
|
29
|
+
const setup = await loadSetupConfig({ cwd: process.cwd() })
|
|
30
|
+
const config = await loadAlintConfig({ cwd: process.cwd() })
|
|
31
|
+
|
|
32
|
+
await writeSetupConfig(setupPath, setup)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## When to use
|
|
36
|
+
|
|
37
|
+
- You are building CLI commands, editors, or automation around `alint` config.
|
|
38
|
+
- You need to read or write provider setup TOML.
|
|
39
|
+
- You need the same ignore defaults as the official CLI.
|
|
40
|
+
|
|
41
|
+
## When not to use
|
|
42
|
+
|
|
43
|
+
- Use `@alint-js/cli` when you only need the `alint` command.
|
|
44
|
+
- Use `@alint-js/core` when you need the rule DSL, source runtime, model resolution, or run engine.
|
package/dist/index.d.mts
CHANGED
|
@@ -3,6 +3,14 @@ import { AlintConfig, AlintConfig as AlintConfig$1, ModelSize, ProviderDefinitio
|
|
|
3
3
|
//#region src/config/load.d.ts
|
|
4
4
|
declare function loadAlintConfig(cwd: string, configFile?: string): Promise<AlintConfig$1>;
|
|
5
5
|
//#endregion
|
|
6
|
+
//#region src/ignore-patterns.d.ts
|
|
7
|
+
declare const ignorePatternsEslintDefaults: readonly ["**/node_modules/**", ".git/**", "**/.git/**"];
|
|
8
|
+
declare const ignorePatternsBuildOutputs: readonly ["**/dist/**", "**/coverage/**", "**/output/**", "**/.output/**", "**/.next/**", "**/.nuxt/**", "**/.svelte-kit/**", "**/.vercel/**"];
|
|
9
|
+
declare const ignorePatternsCaches: readonly ["**/.cache/**", "**/.temp/**", "**/.tmp/**", "**/temp/**", "**/tmp/**", "**/.vitepress/cache/**", "**/.vite-inspect/**"];
|
|
10
|
+
declare const ignorePatternsGenerated: readonly ["**/CHANGELOG*.md", "**/LICENSE*", "**/*.min.*", "**/__snapshots__/**", "**/components.d.ts"];
|
|
11
|
+
declare const ignorePatternsAIAgents: readonly ["**/.agents/**", "**/.claude/**"];
|
|
12
|
+
declare const ignorePatternsCommon: readonly ["**/node_modules/**", ".git/**", "**/.git/**", "**/dist/**", "**/coverage/**", "**/output/**", "**/.output/**", "**/.next/**", "**/.nuxt/**", "**/.svelte-kit/**", "**/.vercel/**", "**/.cache/**", "**/.temp/**", "**/.tmp/**", "**/temp/**", "**/tmp/**", "**/.vitepress/cache/**", "**/.vite-inspect/**", "**/CHANGELOG*.md", "**/LICENSE*", "**/*.min.*", "**/__snapshots__/**", "**/components.d.ts"];
|
|
13
|
+
//#endregion
|
|
6
14
|
//#region src/paths.d.ts
|
|
7
15
|
interface GlobalSetupConfigPathOptions {
|
|
8
16
|
isMacOS?: boolean;
|
|
@@ -24,4 +32,4 @@ declare function stringifySetupConfigToml(config: SetupConfig$1): string;
|
|
|
24
32
|
//#region src/setup/write.d.ts
|
|
25
33
|
declare function writeSetupConfig(filePath: string, config: SetupConfig$1): Promise<void>;
|
|
26
34
|
//#endregion
|
|
27
|
-
export { type AlintConfig, type GlobalSetupConfigPathOptions, type ModelSize, type ProviderDefinition, type ProviderType, type RunnerConfig, type RunnerStatsConfig, type SetupConfig, type SetupModelDefinition, emptySetupConfig, getGlobalSetupConfigPath, getProjectSetupConfigPath, getStatsDir, loadAlintConfig, loadSetupConfig, mergeSetupConfigs, parseSetupConfigToml, stringifySetupConfigToml, writeSetupConfig };
|
|
35
|
+
export { type AlintConfig, type GlobalSetupConfigPathOptions, type ModelSize, type ProviderDefinition, type ProviderType, type RunnerConfig, type RunnerStatsConfig, type SetupConfig, type SetupModelDefinition, emptySetupConfig, getGlobalSetupConfigPath, getProjectSetupConfigPath, getStatsDir, ignorePatternsAIAgents, ignorePatternsBuildOutputs, ignorePatternsCaches, ignorePatternsCommon, ignorePatternsEslintDefaults, ignorePatternsGenerated, loadAlintConfig, loadSetupConfig, mergeSetupConfigs, parseSetupConfigToml, stringifySetupConfigToml, writeSetupConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -17,6 +17,46 @@ async function loadAlintConfig(cwd, configFile) {
|
|
|
17
17
|
return result.config ?? [];
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
|
+
//#region src/ignore-patterns.ts
|
|
21
|
+
const ignorePatternsEslintDefaults = [
|
|
22
|
+
"**/node_modules/**",
|
|
23
|
+
".git/**",
|
|
24
|
+
"**/.git/**"
|
|
25
|
+
];
|
|
26
|
+
const ignorePatternsBuildOutputs = [
|
|
27
|
+
"**/dist/**",
|
|
28
|
+
"**/coverage/**",
|
|
29
|
+
"**/output/**",
|
|
30
|
+
"**/.output/**",
|
|
31
|
+
"**/.next/**",
|
|
32
|
+
"**/.nuxt/**",
|
|
33
|
+
"**/.svelte-kit/**",
|
|
34
|
+
"**/.vercel/**"
|
|
35
|
+
];
|
|
36
|
+
const ignorePatternsCaches = [
|
|
37
|
+
"**/.cache/**",
|
|
38
|
+
"**/.temp/**",
|
|
39
|
+
"**/.tmp/**",
|
|
40
|
+
"**/temp/**",
|
|
41
|
+
"**/tmp/**",
|
|
42
|
+
"**/.vitepress/cache/**",
|
|
43
|
+
"**/.vite-inspect/**"
|
|
44
|
+
];
|
|
45
|
+
const ignorePatternsGenerated = [
|
|
46
|
+
"**/CHANGELOG*.md",
|
|
47
|
+
"**/LICENSE*",
|
|
48
|
+
"**/*.min.*",
|
|
49
|
+
"**/__snapshots__/**",
|
|
50
|
+
"**/components.d.ts"
|
|
51
|
+
];
|
|
52
|
+
const ignorePatternsAIAgents = ["**/.agents/**", "**/.claude/**"];
|
|
53
|
+
const ignorePatternsCommon = [
|
|
54
|
+
...ignorePatternsEslintDefaults,
|
|
55
|
+
...ignorePatternsBuildOutputs,
|
|
56
|
+
...ignorePatternsCaches,
|
|
57
|
+
...ignorePatternsGenerated
|
|
58
|
+
];
|
|
59
|
+
//#endregion
|
|
20
60
|
//#region src/paths.ts
|
|
21
61
|
function getGlobalSetupConfigPath(env = process.env, options = {}) {
|
|
22
62
|
return join(resolveAlintHome(env, options), "config.toml");
|
|
@@ -306,4 +346,4 @@ async function writeSetupConfig(filePath, config) {
|
|
|
306
346
|
await writeFile(filePath, stringifySetupConfigToml(config), "utf8");
|
|
307
347
|
}
|
|
308
348
|
//#endregion
|
|
309
|
-
export { emptySetupConfig, getGlobalSetupConfigPath, getProjectSetupConfigPath, getStatsDir, loadAlintConfig, loadSetupConfig, mergeSetupConfigs, parseSetupConfigToml, stringifySetupConfigToml, writeSetupConfig };
|
|
349
|
+
export { emptySetupConfig, getGlobalSetupConfigPath, getProjectSetupConfigPath, getStatsDir, ignorePatternsAIAgents, ignorePatternsBuildOutputs, ignorePatternsCaches, ignorePatternsCommon, ignorePatternsEslintDefaults, ignorePatternsGenerated, loadAlintConfig, loadSetupConfig, mergeSetupConfigs, parseSetupConfigToml, stringifySetupConfigToml, writeSetupConfig };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alint-js/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.11",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.mts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"pathe": "^2.0.3",
|
|
18
18
|
"smol-toml": "^1.7.0",
|
|
19
19
|
"xdg-basedir": "^5.1.0",
|
|
20
|
-
"@alint-js/core": "0.0.
|
|
20
|
+
"@alint-js/core": "0.0.11"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^26.0.1",
|