@adamhl8/configs 3.0.3 → 3.1.1
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 +17 -5
- package/dist/adamhl8-bunfig/index +1 -0
- package/dist/adamhl8-gitignore/index +1 -0
- package/dist/configs/bask.base.d.ts +0 -2
- package/dist/configs/bask.base.d.ts.map +1 -1
- package/dist/configs/bask.base.js +5 -2
- package/dist/configs/bask.base.js.map +1 -1
- package/dist/configs/commitlint.base.d.ts +0 -2
- package/dist/configs/commitlint.base.d.ts.map +1 -1
- package/dist/configs/commitlint.base.js +1 -2
- package/dist/configs/knip.base.d.ts +0 -2
- package/dist/configs/knip.base.d.ts.map +1 -1
- package/dist/configs/knip.base.js +0 -1
- package/dist/configs/oxfmt.base.d.ts +10 -3
- package/dist/configs/oxfmt.base.d.ts.map +1 -1
- package/dist/configs/oxfmt.base.js +7 -2
- package/dist/configs/oxfmt.base.js.map +1 -1
- package/dist/configs/oxlint.base.d.ts +104 -91
- package/dist/configs/oxlint.base.d.ts.map +1 -1
- package/dist/configs/oxlint.base.js +172 -24
- package/dist/configs/oxlint.base.js.map +1 -1
- package/dist/configs/release-it.base.d.ts +0 -2
- package/dist/configs/release-it.base.d.ts.map +1 -1
- package/dist/configs/release-it.base.js +1 -2
- package/dist/configs/release-it.base.js.map +1 -1
- package/dist/configs/tsconfig.base.json +2 -0
- package/dist/configs/tsdown.base.d.ts +3 -7
- package/dist/configs/tsdown.base.d.ts.map +1 -1
- package/dist/configs/tsdown.base.js +3 -8
- package/dist/configs/tsdown.base.js.map +1 -1
- package/dist/env/index.d.ts +0 -2
- package/dist/env/index.d.ts.map +1 -1
- package/dist/env/index.js +1 -2
- package/dist/env/utils.d.ts +0 -2
- package/dist/env/utils.d.ts.map +1 -1
- package/dist/env/utils.js +1 -2
- package/dist/env/utils.js.map +1 -1
- package/dist/merge-config/merge-config.d.ts +0 -2
- package/dist/merge-config/merge-config.d.ts.map +1 -1
- package/dist/merge-config/merge-config.js +1 -2
- package/dist/merge-config/merge-config.js.map +1 -1
- package/dist/merge-config/merge.types.d.ts +0 -2
- package/dist/merge-config/merge.types.d.ts.map +1 -1
- package/dist/utils.js +32 -4
- package/dist/utils.js.map +1 -1
- package/package.json +43 -24
package/README.md
CHANGED
|
@@ -37,6 +37,14 @@ export * from "@adamhl8/configs/bask"
|
|
|
37
37
|
|
|
38
38
|
It provides `lint`, `build`, `test`, `bump-deps`, `release`, `release-run` (hidden, run by the release workflow), `tofu-check`, `commit-types`, and `prepare`. Run `bunx bask` to list them along with the allowed commit types. The tasks degrade gracefully so projects can use them as-is: `build` only runs `tsdown` if the project has a `tsdown.config.ts`, `test` (`bun test`) passes when there are no tests, and `tofu-check` (a `tofu plan` drift check, which `build` also runs) skips itself unless run locally in a project with `.tofu` files.
|
|
39
39
|
|
|
40
|
+
In projects that depend on `tailwindcss`, `lint` also runs [tailwint](https://github.com/peterwangsc/tailwint) on `.astro` files, because oxlint can't see Astro markup. It only checks and never fixes, because tailwint resolves a class conflict by deleting a class by position, not by which one wins. Projects with `.astro` files install it:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
bun add -D tailwint @tailwindcss/language-server
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Both are optional peer dependencies. bask runs `bun tailwint` from the project, so with bun's `isolated` linker the bin has to be installed by the project, not just by `@adamhl8/configs`.
|
|
47
|
+
|
|
40
48
|
To customize a task, add hooks to it from your `bask.ts`. A hook also runs when another base task calls that task, so extending `lint` extends `build` too:
|
|
41
49
|
|
|
42
50
|
```ts
|
|
@@ -46,12 +54,12 @@ import { bumpDeps, lint } from "@adamhl8/configs/bask"
|
|
|
46
54
|
export * from "@adamhl8/configs/bask"
|
|
47
55
|
|
|
48
56
|
export const astroSync = task(async ({ sh }) => {
|
|
49
|
-
await sh`
|
|
57
|
+
await sh`astro sync`
|
|
50
58
|
})
|
|
51
59
|
|
|
52
60
|
lint.before(astroSync)
|
|
53
61
|
bumpDeps.after(async ({ sh }) => {
|
|
54
|
-
await sh`
|
|
62
|
+
await sh`prisma generate`
|
|
55
63
|
})
|
|
56
64
|
```
|
|
57
65
|
|
|
@@ -59,11 +67,11 @@ The only script left in `package.json` is `prepare`, which hands off to bask:
|
|
|
59
67
|
|
|
60
68
|
```json
|
|
61
69
|
"scripts": {
|
|
62
|
-
"prepare": "
|
|
70
|
+
"prepare": "bask prepare"
|
|
63
71
|
}
|
|
64
72
|
```
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
The `prepare` script and task `sh` calls run local bins by their bare name, because `bun run` and bask both put `node_modules/.bin` on `PATH`. Git hooks and the workflows run `bunx bask` rather than `bun bask`, because `bun bask` runs `bask.ts` instead of the bask bin.
|
|
67
75
|
|
|
68
76
|
### tsconfig
|
|
69
77
|
|
|
@@ -86,6 +94,8 @@ const config = oxfmtConfig({ ... })
|
|
|
86
94
|
export default defineConfig(config)
|
|
87
95
|
```
|
|
88
96
|
|
|
97
|
+
In projects that depend on `tailwindcss`, Tailwind classes are sorted against the project's Tailwind stylesheet, so classes from plugins and `@theme` sort correctly. The stylesheet is found the same way the Tailwind language server finds it: the first CSS file, in sorted order, that does `@import "tailwindcss"`. oxfmt has to run from the project root for this to find the file. If it picks the wrong file, set `sortTailwindcss: { stylesheet: "path/to/global.css" }`.
|
|
98
|
+
|
|
89
99
|
### oxlint
|
|
90
100
|
|
|
91
101
|
```ts
|
|
@@ -97,6 +107,8 @@ const config = oxlintConfig({ ... })
|
|
|
97
107
|
export default defineConfig(config)
|
|
98
108
|
```
|
|
99
109
|
|
|
110
|
+
When the project depends on `tailwindcss`, the config enables [oxlint-tailwindcss](https://github.com/sergioazoc/oxlint-tailwindcss) with every rule except `enforce-sort-order` and `enforce-consistent-line-wrapping` (oxfmt handles these), `enforce-logical` (it conflicts with `enforce-physical`), and `max-class-count`. The plugin reads the design system from the same stylesheet oxfmt sorts against. If that's the wrong file, set `settings: { tailwindcss: { entryPoint: "path/to/global.css" } }`, alongside the oxfmt `sortTailwindcss` override.
|
|
111
|
+
|
|
100
112
|
### knip
|
|
101
113
|
|
|
102
114
|
```ts
|
|
@@ -319,6 +331,6 @@ Configure these on each repo that uses the workflows (Settings -> Secrets and va
|
|
|
319
331
|
|
|
320
332
|
## Notes
|
|
321
333
|
|
|
322
|
-
The `prepare` script is `"prepare": "
|
|
334
|
+
The `prepare` script is `"prepare": "bask prepare"`, which runs the base `prepare` task (`lefthook install` outside CI, the `.gitignore` sync, and the `bunfig.toml` sync).
|
|
323
335
|
|
|
324
336
|
bun links a dependency's `package.json` bin executables into the local `node_modules/.bin`, but not the bins of the package being developed itself. This repo depends on itself (`"@adamhl8/configs": "file:."`) so that its own bins can be run directly, e.g. `adamhl8-bunfig` instead of `src/adamhl8-bunfig/index.ts`. That's also why this repo's `bask.ts` runs `tsdown` before the `prepare` task: the bins point at `dist/`, so those builds need to be available.
|
|
@@ -3,6 +3,7 @@ import bun from "bun";
|
|
|
3
3
|
import { isPlainObject, merge } from "es-toolkit";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
+
import "es-toolkit/predicate";
|
|
6
7
|
const CONFIG_DIRS = ["./configs/", "../configs/"];
|
|
7
8
|
/** Returns the absolute path of a file in this package's `configs` folder. */
|
|
8
9
|
const configFilePath = (name) => {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import bun from "bun";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import "es-toolkit/predicate";
|
|
5
6
|
const CONFIG_DIRS = ["./configs/", "../configs/"];
|
|
6
7
|
/** Returns the absolute path of a file in this package's `configs` folder. */
|
|
7
8
|
const configFilePath = (name) => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/configs/bask.base.d.ts
|
|
2
1
|
export declare const tofuCheck: import("@adamhl8/bask").Task;
|
|
3
2
|
export declare const prepare: import("@adamhl8/bask").Task;
|
|
4
3
|
export declare const bumpDeps: import("@adamhl8/bask").Task;
|
|
@@ -8,5 +7,4 @@ export declare const build: import("@adamhl8/bask").Task;
|
|
|
8
7
|
export declare const release: import("@adamhl8/bask").Task;
|
|
9
8
|
export declare const releaseRun: import("@adamhl8/bask").Task;
|
|
10
9
|
export declare const commitTypes: import("@adamhl8/bask").Task;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=bask.base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bask.base.d.ts","names":[],"sources":["../../src/configs/bask.base.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"bask.base.d.ts","names":[],"sources":["../../src/configs/bask.base.ts"],"mappings":"A,qBAwBa,mCAAS;qBAIT,iCAAO;qBASP,kCAAQ;qBAOR,8BAAI;qBAIJ,8BAAI;qBA0BJ,+BAAK;qBAYL,iCAAO;qBAIP,oCAAU;qBAIV,qCAAW"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { resolveProjectTailwind } from "../utils.js";
|
|
1
2
|
import { existsSync } from "node:fs";
|
|
2
3
|
import { list, task } from "@adamhl8/bask";
|
|
3
4
|
import bun, { $, Glob } from "bun";
|
|
4
|
-
|
|
5
|
+
// src/configs/bask.base.ts
|
|
5
6
|
const inCi = Boolean(process.env["CI"]);
|
|
6
7
|
/** Lists tracked and untracked files matching the pathspecs, skipping gitignored ones. */
|
|
7
8
|
const lsFiles = async (pathspecs) => {
|
|
@@ -36,6 +37,9 @@ const lint = task(async ({ sh }) => {
|
|
|
36
37
|
await sh`bun markdown-toc -i --bullets - --maxdepth 3 ./README.md`;
|
|
37
38
|
await sh`bun oxlint --fix --fix-suggestions --fix-dangerously`;
|
|
38
39
|
await sh`bun oxfmt`;
|
|
40
|
+
if (resolveProjectTailwind()) {
|
|
41
|
+
if ((await lsFiles([":(glob)**/*.astro"])).length > 0) await sh`bun tailwint "**/*.astro"`;
|
|
42
|
+
}
|
|
39
43
|
const tofuFiles = await lsFiles([
|
|
40
44
|
":(glob)**/*.tf",
|
|
41
45
|
":(glob)**/*.tofu",
|
|
@@ -71,7 +75,6 @@ list.after(async () => {
|
|
|
71
75
|
console.log();
|
|
72
76
|
await commitTypes();
|
|
73
77
|
});
|
|
74
|
-
//#endregion
|
|
75
78
|
export { build, bumpDeps, commitTypes, lint, prepare, release, releaseRun, test, tofuCheck };
|
|
76
79
|
|
|
77
80
|
//# sourceMappingURL=bask.base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bask.base.js","names":[],"sources":["../../src/configs/bask.base.ts"],"sourcesContent":["import { existsSync } from \"node:fs\"\n\nimport { list, task } from \"@adamhl8/bask\"\nimport bun, { $, Glob } from \"bun\"\n\
|
|
1
|
+
{"version":3,"file":"bask.base.js","names":[],"sources":["../../src/configs/bask.base.ts"],"sourcesContent":["import { existsSync } from \"node:fs\"\n\nimport { list, task } from \"@adamhl8/bask\"\nimport bun, { $, Glob } from \"bun\"\n\nimport { resolveProjectTailwind } from \"#utils.ts\"\n\nconst inCi = Boolean(process.env[\"CI\"])\n\n/** Lists tracked and untracked files matching the pathspecs, skipping gitignored ones. */\nconst lsFiles = async (pathspecs: string[]) => {\n const output = await $`git ls-files -z --cached --others --exclude-standard -- ${pathspecs}`.quiet().text()\n return output.split(\"\\0\").filter(Boolean)\n}\n\n/** Checks that we're not in CI, the repo has a root tofu module, and the aws profile exists on this machine. */\nconst canRunTofu = async () => {\n if (inCi) return false\n const tofuFiles = await Array.fromAsync(new Glob(\"*.tofu\").scan())\n if (tofuFiles.length === 0) return false\n const profiles = await $`aws configure list-profiles`.nothrow().quiet().text()\n return profiles.split(\"\\n\").includes(\"adamhl8\")\n}\n\nexport const tofuCheck = task(async ({ sh }) => {\n if (await canRunTofu()) await sh`tofu plan -detailed-exitcode -concise -compact-warnings`\n})\n\nexport const prepare = task(async ({ sh }) => {\n // Skip `lefthook install` in CI so commits made by the workflows don't run the hooks.\n if (!inCi) await sh`lefthook install`\n await sh`bun adamhl8-gitignore`\n await sh`bun adamhl8-bunfig`\n await sh`bun oxfmt bunfig.toml`\n if (await canRunTofu()) await sh`tofu init -upgrade`\n})\n\nexport const bumpDeps = task(async ({ sh }) => {\n await sh`bunx npm-check-updates --upgrade --format group`\n await sh`rm -f bun.lock`\n await sh`rm -rf node_modules/`\n await sh`bun install --no-summary --no-cache`\n})\n\nexport const test = task(async ({ sh }) => {\n await sh`bun test --pass-with-no-tests`.echo(false)\n})\n\nexport const lint = task(async ({ sh }) => {\n await sh`bun markdown-toc -i --bullets - --maxdepth 3 ./README.md`\n await sh`bun oxlint --fix --fix-suggestions --fix-dangerously`\n await sh`bun oxfmt`\n\n if (resolveProjectTailwind()) {\n // Check for `.astro` files first so projects without them don't need tailwint installed.\n const astroFiles = await lsFiles([\":(glob)**/*.astro\"])\n // Skip `--fix` because tailwint resolves a class conflict by deleting a class by position, not by which one wins.\n if (astroFiles.length > 0) await sh`bun tailwint \"**/*.astro\"`\n }\n\n const tofuFiles = await lsFiles([\n \":(glob)**/*.tf\",\n \":(glob)**/*.tofu\",\n \":(glob)**/*.tfvars\",\n \":(glob)**/*.tftest.hcl\",\n \":(glob)**/*.tofutest.hcl\",\n ])\n if (tofuFiles.length > 0) await sh`tofu fmt ${tofuFiles}`\n\n await sh`bun knip-bun`\n if (existsSync(\".github/workflows\")) await sh`actionlint`\n await test()\n})\n\nexport const build = task(async ({ sh }) => {\n await lint()\n if (await bun.file(\"tsdown.config.ts\").exists()) await sh`bun tsdown`\n // Fail in CI if the build changed or created any files, because lint fixes and formatting are applied in place.\n // `--intent-to-add` makes untracked files show up in the diff.\n if (inCi) {\n await sh`git add --intent-to-add --all`\n await sh`git diff --exit-code`\n }\n await tofuCheck()\n})\n\nexport const release = task(async ({ sh }) => {\n await sh`gh workflow run release.yml`\n})\n\nexport const releaseRun = task({ hidden: true }, async ({ sh }) => {\n await sh`bun release-it -VV --ci`\n})\n\nexport const commitTypes = task(async ({ sh }) => {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion - trust the shape that `commitlint --print-config json` prints\n const config = (await sh`bun commitlint --print-config json`.echo(false).json()) as {\n rules: { \"type-enum\": [number, string, string[]] }\n }\n const { 2: types } = config.rules[\"type-enum\"]\n console.log(`Commit types:\\n ${types.join(\"\\n \")}`)\n})\n\nlist.after(async () => {\n console.log()\n await commitTypes()\n})\n"],"mappings":";;;;;AAOA,MAAM,OAAO,QAAQ,QAAQ,IAAI,KAAK;;AAGtC,MAAM,UAAU,OAAO,cAAwB;CAE7C,QAAO,MADc,CAAC,2DAA2D,YAAY,MAAM,CAAC,CAAC,KAAK,EAAA,CAC5F,MAAM,IAAI,CAAC,CAAC,OAAO,OAAO;AAC1C;;AAGA,MAAM,aAAa,YAAY;CAC7B,IAAI,MAAM,OAAO;CAEjB,KAAI,MADoB,MAAM,UAAU,IAAI,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAA,CACnD,WAAW,GAAG,OAAO;CAEnC,QAAO,MADgB,CAAC,8BAA8B,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAA,CAC7D,MAAM,IAAI,CAAC,CAAC,SAAS,SAAS;AAChD;AAEA,MAAa,YAAY,KAAK,OAAO,EAAE,SAAS;CAC9C,IAAI,MAAM,WAAW,GAAG,MAAM,EAAE;AAClC,CAAC;AAED,MAAa,UAAU,KAAK,OAAO,EAAE,SAAS;CAE5C,IAAI,CAAC,MAAM,MAAM,EAAE;CACnB,MAAM,EAAE;CACR,MAAM,EAAE;CACR,MAAM,EAAE;CACR,IAAI,MAAM,WAAW,GAAG,MAAM,EAAE;AAClC,CAAC;AAED,MAAa,WAAW,KAAK,OAAO,EAAE,SAAS;CAC7C,MAAM,EAAE;CACR,MAAM,EAAE;CACR,MAAM,EAAE;CACR,MAAM,EAAE;AACV,CAAC;AAED,MAAa,OAAO,KAAK,OAAO,EAAE,SAAS;CACzC,MAAM,EAAE,gCAAgC,KAAK,KAAK;AACpD,CAAC;AAED,MAAa,OAAO,KAAK,OAAO,EAAE,SAAS;CACzC,MAAM,EAAE;CACR,MAAM,EAAE;CACR,MAAM,EAAE;CAER,IAAI,uBAAuB,GAIrB;OAAA,MAFqB,QAAQ,CAAC,mBAAmB,CAAC,EAAA,CAEvC,SAAS,GAAG,MAAM,EAAE;CAAA;CAGrC,MAAM,YAAY,MAAM,QAAQ;EAC9B;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,IAAI,UAAU,SAAS,GAAG,MAAM,EAAE,YAAY;CAE9C,MAAM,EAAE;CACR,IAAI,WAAW,mBAAmB,GAAG,MAAM,EAAE;CAC7C,MAAM,KAAK;AACb,CAAC;AAED,MAAa,QAAQ,KAAK,OAAO,EAAE,SAAS;CAC1C,MAAM,KAAK;CACX,IAAI,MAAM,IAAI,KAAK,kBAAkB,CAAC,CAAC,OAAO,GAAG,MAAM,EAAE;CAGzD,IAAI,MAAM;EACR,MAAM,EAAE;EACR,MAAM,EAAE;CACV;CACA,MAAM,UAAU;AAClB,CAAC;AAED,MAAa,UAAU,KAAK,OAAO,EAAE,SAAS;CAC5C,MAAM,EAAE;AACV,CAAC;AAED,MAAa,aAAa,KAAK,EAAE,QAAQ,KAAK,GAAG,OAAO,EAAE,SAAS;CACjE,MAAM,EAAE;AACV,CAAC;AAED,MAAa,cAAc,KAAK,OAAO,EAAE,SAAS;CAKhD,MAAM,EAAE,GAAG,WAAU,MAHC,EAAE,qCAAqC,KAAK,KAAK,CAAC,CAAC,KAAK,EAAA,CAGlD,MAAM;CAClC,QAAQ,IAAI,sBAAsB,MAAM,KAAK,QAAQ,GAAG;AAC1D,CAAC;AAED,KAAK,MAAM,YAAY;CACrB,QAAQ,IAAI;CACZ,MAAM,YAAY;AACpB,CAAC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { OptionalMergeConfigFn } from "../merge-config/merge-config.js";
|
|
2
2
|
import { UserConfig } from "@commitlint/types";
|
|
3
|
-
//#region src/configs/commitlint.base.d.ts
|
|
4
3
|
export declare const commitlintConfig: OptionalMergeConfigFn<UserConfig, {
|
|
5
4
|
readonly extends: ["@commitlint/config-conventional"];
|
|
6
5
|
readonly rules: {
|
|
7
6
|
readonly "type-enum": readonly [2, "always", string[]];
|
|
8
7
|
};
|
|
9
8
|
}>;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=commitlint.base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commitlint.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/commitlint.base.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"commitlint.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/commitlint.base.ts"],"mappings":";;qBAkBa,kBAAgBA,sBAAA;;;aAJzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createMergeConfigFn } from "../merge-config/merge-config.js";
|
|
2
2
|
import conventional from "@commitlint/config-conventional";
|
|
3
|
-
|
|
3
|
+
// src/configs/commitlint.base.ts
|
|
4
4
|
const [_severity, _condition, conventionalTypes] = conventional.rules["type-enum"];
|
|
5
5
|
const EXCLUDED_TYPES = /* @__PURE__ */ new Set([
|
|
6
6
|
"test",
|
|
@@ -20,7 +20,6 @@ const baseConfig = {
|
|
|
20
20
|
] }
|
|
21
21
|
};
|
|
22
22
|
const commitlintConfig = createMergeConfigFn(baseConfig);
|
|
23
|
-
//#endregion
|
|
24
23
|
export { commitlintConfig };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=commitlint.base.js.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { OptionalMergeConfigFn } from "../merge-config/merge-config.js";
|
|
2
2
|
import { KnipConfig } from "knip";
|
|
3
|
-
//#region src/configs/knip.base.d.ts
|
|
4
3
|
export declare const knipConfig: OptionalMergeConfigFn<KnipConfig, {
|
|
5
4
|
readonly project: ["**/*"];
|
|
6
5
|
readonly bun: {
|
|
7
6
|
readonly entry: ["**/*.test.ts", "bask.ts"];
|
|
8
7
|
};
|
|
9
8
|
}>;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=knip.base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/knip.base.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"knip.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/knip.base.ts"],"mappings":";;qBAaa,YAAUA,sBAAA;;;aAJnB"}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { OptionalMergeConfigFn } from "../merge-config/merge-config.js";
|
|
2
2
|
import { OxfmtConfig } from "oxfmt";
|
|
3
|
-
//#region src/configs/oxfmt.base.d.ts
|
|
4
3
|
export declare const oxfmtConfig: OptionalMergeConfigFn<OxfmtConfig, {
|
|
5
4
|
readonly printWidth: 120;
|
|
6
5
|
readonly semi: false;
|
|
6
|
+
readonly astro: {
|
|
7
|
+
readonly allowShorthand: false;
|
|
8
|
+
};
|
|
9
|
+
readonly experimentalOperatorPosition: "start";
|
|
7
10
|
readonly jsdoc: true;
|
|
8
11
|
readonly sortImports: {
|
|
9
12
|
readonly groups: ["builtin", "external", ["subpath", "internal"], ["index", "sibling", "parent"], "side_effect", ["style", "side_effect_style"]];
|
|
10
13
|
};
|
|
11
|
-
readonly
|
|
14
|
+
readonly sortPackageJson: {
|
|
15
|
+
readonly sortScripts: true;
|
|
16
|
+
};
|
|
17
|
+
readonly sortTailwindcss: true | {
|
|
18
|
+
stylesheet: string;
|
|
19
|
+
};
|
|
12
20
|
}>;
|
|
13
|
-
//#endregion
|
|
14
21
|
//# sourceMappingURL=oxfmt.base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxfmt.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/oxfmt.base.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"oxfmt.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/oxfmt.base.ts"],"mappings":";;qBA4Ba,aAAWA,sBAAA;WApBV;;;aAEH;;WACqB;;;aAG5B;;;aASiB"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { createMergeConfigFn } from "../merge-config/merge-config.js";
|
|
2
|
+
import { resolveProjectTailwind } from "../utils.js";
|
|
3
|
+
// src/configs/oxfmt.base.ts
|
|
4
|
+
const tailwindStylesheet = resolveProjectTailwind();
|
|
2
5
|
const oxfmtConfig = createMergeConfigFn({
|
|
3
6
|
printWidth: 120,
|
|
4
7
|
semi: false,
|
|
8
|
+
astro: { allowShorthand: false },
|
|
9
|
+
experimentalOperatorPosition: "start",
|
|
5
10
|
jsdoc: true,
|
|
6
11
|
sortImports: { groups: [
|
|
7
12
|
"builtin",
|
|
@@ -15,9 +20,9 @@ const oxfmtConfig = createMergeConfigFn({
|
|
|
15
20
|
"side_effect",
|
|
16
21
|
["style", "side_effect_style"]
|
|
17
22
|
] },
|
|
18
|
-
|
|
23
|
+
sortPackageJson: { sortScripts: true },
|
|
24
|
+
sortTailwindcss: tailwindStylesheet ? { stylesheet: tailwindStylesheet } : true
|
|
19
25
|
});
|
|
20
|
-
//#endregion
|
|
21
26
|
export { oxfmtConfig };
|
|
22
27
|
|
|
23
28
|
//# sourceMappingURL=oxfmt.base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxfmt.base.js","names":[],"sources":["../../src/configs/oxfmt.base.ts"],"sourcesContent":["import type { OxfmtConfig } from \"oxfmt\"\n\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\n\nconst baseConfig = {\n printWidth: 120,\n semi: false,\n jsdoc: true,\n sortImports: {\n groups: [\n \"builtin\",\n \"external\",\n [\"subpath\", \"internal\"],\n [\"index\", \"sibling\", \"parent\"],\n \"side_effect\",\n [\"style\", \"side_effect_style\"],\n ],\n },\n sortTailwindcss: true,\n} as const satisfies OxfmtConfig\n\nexport const oxfmtConfig = createMergeConfigFn<OxfmtConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"oxfmt.base.js","names":[],"sources":["../../src/configs/oxfmt.base.ts"],"sourcesContent":["import type { OxfmtConfig } from \"oxfmt\"\n\nimport { createMergeConfigFn } from \"#merge-config/merge-config.ts\"\nimport { resolveProjectTailwind } from \"#utils.ts\"\n\nconst tailwindStylesheet = resolveProjectTailwind()\n\nconst baseConfig = {\n printWidth: 120,\n semi: false,\n astro: { allowShorthand: false },\n experimentalOperatorPosition: \"start\",\n jsdoc: true,\n sortImports: {\n groups: [\n \"builtin\",\n \"external\",\n [\"subpath\", \"internal\"],\n [\"index\", \"sibling\", \"parent\"],\n \"side_effect\",\n [\"style\", \"side_effect_style\"],\n ],\n },\n sortPackageJson: { sortScripts: true },\n // Sort against the project's stylesheet so classes from plugins and `@theme` are known.\n sortTailwindcss: tailwindStylesheet ? { stylesheet: tailwindStylesheet } : true,\n} as const satisfies OxfmtConfig\n\nexport const oxfmtConfig = createMergeConfigFn<OxfmtConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;;AAKA,MAAM,qBAAqB,uBAAuB;AAuBlD,MAAa,cAAc,oBAAoD;CApB7E,YAAY;CACZ,MAAM;CACN,OAAO,EAAE,gBAAgB,MAAM;CAC/B,8BAA8B;CAC9B,OAAO;CACP,aAAa,EACX,QAAQ;EACN;EACA;EACA,CAAC,WAAW,UAAU;EACtB;GAAC;GAAS;GAAW;EAAQ;EAC7B;EACA,CAAC,SAAS,mBAAmB;CAC/B,EACF;CACA,iBAAiB,EAAE,aAAa,KAAK;CAErC,iBAAiB,qBAAqB,EAAE,YAAY,mBAAmB,IAAI;AAGE,CAAU"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { OptionalMergeConfigFn } from "../merge-config/merge-config.js";
|
|
2
|
-
import { OxlintConfig } from "oxlint";
|
|
3
|
-
|
|
2
|
+
import { DummyRule, OxlintConfig, OxlintOverride } from "oxlint";
|
|
3
|
+
type PluginRules = Record<string, DummyRule>;
|
|
4
4
|
export declare const oxlintConfig: OptionalMergeConfigFn<OxlintConfig, {
|
|
5
|
-
|
|
5
|
+
options: {
|
|
6
6
|
readonly reportUnusedDisableDirectives: "error";
|
|
7
7
|
readonly typeAware: true;
|
|
8
8
|
readonly typeCheck: true;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
categories: {
|
|
11
11
|
readonly correctness: "error";
|
|
12
12
|
readonly nursery: "error";
|
|
13
13
|
readonly pedantic: "error";
|
|
@@ -16,121 +16,134 @@ export declare const oxlintConfig: OptionalMergeConfigFn<OxlintConfig, {
|
|
|
16
16
|
readonly style: "error";
|
|
17
17
|
readonly suspicious: "error";
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
plugins: ["eslint", "react", "unicorn", "typescript", "oxc", "import", "jsdoc", "vitest", "jsx-a11y", "react-perf", "promise", "node"];
|
|
20
|
+
jsPlugins: string[];
|
|
21
|
+
overrides: ({
|
|
22
22
|
readonly files: [".release-it.ts", "astro.config.ts", "commitlint.config.ts", "knip.ts", "oxfmt.config.ts", "oxlint.config.ts", "prisma.config.ts", "tsdown.config.ts"];
|
|
23
23
|
readonly rules: {
|
|
24
24
|
readonly "import/no-default-export": "off";
|
|
25
25
|
};
|
|
26
|
-
}
|
|
26
|
+
} | {
|
|
27
27
|
readonly files: ["bask.ts"];
|
|
28
28
|
readonly rules: {
|
|
29
29
|
readonly "clean-modules/require-direct-exports": "off";
|
|
30
30
|
readonly "import/export": "off";
|
|
31
31
|
};
|
|
32
|
-
}
|
|
32
|
+
} | {
|
|
33
33
|
readonly files: [".release-it.ts"];
|
|
34
34
|
readonly rules: {
|
|
35
35
|
readonly "no-template-curly-in-string": "off";
|
|
36
36
|
};
|
|
37
|
-
}
|
|
37
|
+
} | {
|
|
38
38
|
readonly files: ["**/*.tsx"];
|
|
39
39
|
readonly rules: {
|
|
40
|
-
readonly "func-style": ["error", "
|
|
41
|
-
readonly
|
|
42
|
-
readonly namedExports: "ignore";
|
|
43
|
-
};
|
|
40
|
+
readonly "func-style": ["error", "declaration", {
|
|
41
|
+
readonly allowArrowFunctions: true;
|
|
44
42
|
}];
|
|
45
43
|
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
} | (Omit<OxlintOverride, "rules"> & {
|
|
45
|
+
rules?: PluginRules;
|
|
46
|
+
}))[];
|
|
47
|
+
rules: {
|
|
48
|
+
curly: ["error", "multi-or-nest"];
|
|
49
|
+
"func-style": ["error", "expression"];
|
|
50
|
+
"require-unicode-regexp": ["error", {
|
|
51
|
+
readonly requireFlag: "v";
|
|
52
|
+
}];
|
|
53
|
+
"react/function-component-definition": ["error", {
|
|
54
|
+
readonly namedComponents: "function-declaration";
|
|
55
|
+
readonly unnamedComponents: "arrow-function";
|
|
56
|
+
}];
|
|
57
|
+
"react/jsx-curly-brace-presence": ["error", {
|
|
54
58
|
readonly children: "never";
|
|
55
59
|
readonly propElementValues: "always";
|
|
56
60
|
readonly props: "never";
|
|
57
61
|
}];
|
|
58
|
-
|
|
59
|
-
readonly requireFlag: "v";
|
|
60
|
-
}];
|
|
61
|
-
readonly "unicorn/filename-case": ["error", {
|
|
62
|
+
"unicorn/filename-case": ["error", {
|
|
62
63
|
readonly cases: {
|
|
63
64
|
readonly kebabCase: true;
|
|
64
65
|
readonly pascalCase: true;
|
|
65
66
|
};
|
|
66
67
|
}];
|
|
67
|
-
|
|
68
|
+
"unicorn/no-useless-undefined": ["error", {
|
|
68
69
|
readonly checkArguments: false;
|
|
69
70
|
}];
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
71
|
+
"capitalized-comments": "off";
|
|
72
|
+
"id-length": "off";
|
|
73
|
+
"init-declarations": "off";
|
|
74
|
+
"max-classes-per-file": "off";
|
|
75
|
+
"max-lines": "off";
|
|
76
|
+
"max-lines-per-function": "off";
|
|
77
|
+
"max-statements": "off";
|
|
78
|
+
"no-console": "off";
|
|
79
|
+
"no-continue": "off";
|
|
80
|
+
"no-duplicate-imports": "off";
|
|
81
|
+
"no-inline-comments": "off";
|
|
82
|
+
"no-magic-numbers": "off";
|
|
83
|
+
"no-plusplus": "off";
|
|
84
|
+
"no-regex-spaces": "off";
|
|
85
|
+
"no-ternary": "off";
|
|
86
|
+
"no-undef": "off";
|
|
87
|
+
"no-undefined": "off";
|
|
88
|
+
"no-useless-return": "off";
|
|
89
|
+
"no-void": "off";
|
|
90
|
+
"one-var": "off";
|
|
91
|
+
"require-await": "off";
|
|
92
|
+
"sort-imports": "off";
|
|
93
|
+
"sort-keys": "off";
|
|
94
|
+
"import/exports-last": "off";
|
|
95
|
+
"import/group-exports": "off";
|
|
96
|
+
"import/max-dependencies": "off";
|
|
97
|
+
"import/no-named-export": "off";
|
|
98
|
+
"import/no-nodejs-modules": "off";
|
|
99
|
+
"import/no-unassigned-import": "off";
|
|
100
|
+
"import/prefer-default-export": "off";
|
|
101
|
+
"jsdoc/require-param": "off";
|
|
102
|
+
"jsdoc/require-returns": "off";
|
|
103
|
+
"node/callback-return": "off";
|
|
104
|
+
"node/no-process-env": "off";
|
|
105
|
+
"node/no-sync": "off";
|
|
106
|
+
"node/no-top-level-await": "off";
|
|
107
|
+
"oxc/no-async-await": "off";
|
|
108
|
+
"oxc/no-optional-chaining": "off";
|
|
109
|
+
"oxc/no-rest-spread-properties": "off";
|
|
110
|
+
"react/exhaustive-effect-dependencies": "off";
|
|
111
|
+
"react/forbid-component-props": "off";
|
|
112
|
+
"react/hooks": "off";
|
|
113
|
+
"react/invariant": "off";
|
|
114
|
+
"react/jsx-filename-extension": "off";
|
|
115
|
+
"react/jsx-max-depth": "off";
|
|
116
|
+
"react/jsx-no-literals": "off";
|
|
117
|
+
"react/memo-dependencies": "off";
|
|
118
|
+
"react/no-deriving-state-in-effects": "off";
|
|
119
|
+
"react/react-in-jsx-scope": "off";
|
|
120
|
+
"react/rule-suppression": "off";
|
|
121
|
+
"react/todo": "off";
|
|
122
|
+
"typescript/consistent-return": "off";
|
|
123
|
+
"typescript/explicit-function-return-type": "off";
|
|
124
|
+
"typescript/explicit-module-boundary-types": "off";
|
|
125
|
+
"typescript/prefer-readonly-parameter-types": "off";
|
|
126
|
+
"typescript/strict-boolean-expressions": "off";
|
|
127
|
+
"unicorn/no-array-callback-reference": "off";
|
|
128
|
+
"unicorn/no-array-method-this-argument": "off";
|
|
129
|
+
"unicorn/no-await-expression-member": "off";
|
|
130
|
+
"unicorn/no-process-exit": "off";
|
|
131
|
+
"unicorn/number-literal-case": "off";
|
|
132
|
+
"unicorn/switch-case-braces": "off";
|
|
133
|
+
"vitest/no-hooks": "off";
|
|
134
|
+
"vitest/no-importing-vitest-globals": "off";
|
|
135
|
+
"vitest/prefer-describe-function-title": "off";
|
|
136
|
+
"vitest/prefer-expect-assertions": "off";
|
|
137
|
+
"vitest/prefer-importing-vitest-globals": "off";
|
|
138
|
+
"vitest/prefer-lowercase-title": "off";
|
|
139
|
+
"vitest/prefer-to-be-falsy": "off";
|
|
140
|
+
"vitest/prefer-to-be-truthy": "off";
|
|
141
|
+
"vitest/require-hook": "off";
|
|
142
|
+
"vitest/require-test-timeout": "off";
|
|
143
|
+
};
|
|
144
|
+
settings: {
|
|
145
|
+
[k: string]: unknown;
|
|
133
146
|
};
|
|
134
147
|
}>;
|
|
135
|
-
|
|
148
|
+
export {};
|
|
136
149
|
//# sourceMappingURL=oxlint.base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/oxlint.base.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"oxlint.base.d.ts","names":["_$_merge_config_merge_config_ts0.OptionalMergeConfigFn"],"sources":["../../src/configs/oxlint.base.ts"],"mappings":";;KAmBK,cAAc,eAAe;qBAoUrB,cAhU4CA,sBAgUhC;;aAxMrB;aACA;aACA;;;aAIA;aACA;aACA;aACA;aACA;aACA;aACA;;;;;;;eA+BI;;;;;eAMA;eACA;;;;;eAMA;;;;;;;;;;IAhLiD,QAAA;;;;;;eAgMF;;;eAI9B;eAA2C;;;eAER;eAA4B;eAAiB;;;;iBAKxF;iBAAiB;;;;;;IAON;IACX;IACQ;IACG;IACX;IACa;IACR;IACJ;IACC;IACS;IACF;IACF;IACL;IACI;IACL;IACF;IACI;IACK;IACV;IACA;IACM;IACD;IACH;IAEU;IACC;IACG;IACD;IACE;IACG;IACC;IAET;IACE;IAED;IACD;IACP;IACW;IAEL;IACM;IACK;IAEO;IACR;IACjB;IACI;IACa;IACT;IACE;IACE;IACW;IACV;IACF;IACZ;IAEkB;IACY;IACC;IACC;IACL;IAEF;IACE;IACH;IACX;IACI;IACD;IAEX;IACmB;IACG;IACN;IACO;IACT;IACJ;IACC;IACP;IACQ"}
|