@adamhl8/configs 0.20.2 → 0.21.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.md +11 -0
- package/dist/configs/oxlint.base.d.ts +15 -1
- package/dist/configs/oxlint.base.d.ts.map +1 -1
- package/dist/configs/oxlint.base.js +17 -2
- package/dist/configs/oxlint.base.js.map +1 -1
- package/dist/configs/vitest.base.d.ts +20 -0
- package/dist/configs/vitest.base.d.ts.map +1 -0
- package/dist/configs/vitest.base.js +13 -0
- package/dist/configs/vitest.base.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -43,3 +43,14 @@ const config = tsdownConfig({ ... })
|
|
|
43
43
|
|
|
44
44
|
export default defineConfig(config)
|
|
45
45
|
```
|
|
46
|
+
|
|
47
|
+
### vitest
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { vitestConfig } from "@adamhl8/configs"
|
|
51
|
+
import { defineConfig } from "vitest/config"
|
|
52
|
+
|
|
53
|
+
const config = vitestConfig({ ... })
|
|
54
|
+
|
|
55
|
+
export default defineConfig(config)
|
|
56
|
+
```
|
|
@@ -18,7 +18,7 @@ declare const baseConfig: {
|
|
|
18
18
|
readonly typeCheck: true;
|
|
19
19
|
};
|
|
20
20
|
readonly overrides: [{
|
|
21
|
-
readonly files: ["knip.ts", "oxfmt.config.ts", "oxlint.config.ts", "tsdown.config.ts"];
|
|
21
|
+
readonly files: ["knip.ts", "oxfmt.config.ts", "oxlint.config.ts", "tsdown.config.ts", "vitest.config.ts"];
|
|
22
22
|
readonly rules: {
|
|
23
23
|
readonly "import/no-default-export": "off";
|
|
24
24
|
};
|
|
@@ -41,9 +41,11 @@ declare const baseConfig: {
|
|
|
41
41
|
readonly "import/no-named-export": "off";
|
|
42
42
|
readonly "import/no-nodejs-modules": "off";
|
|
43
43
|
readonly "import/prefer-default-export": "off";
|
|
44
|
+
readonly "init-declarations": "off";
|
|
44
45
|
readonly "jsdoc/require-param": "off";
|
|
45
46
|
readonly "jsdoc/require-returns": "off";
|
|
46
47
|
readonly "max-classes-per-file": "off";
|
|
48
|
+
readonly "max-lines": "off";
|
|
47
49
|
readonly "max-lines-per-function": "off";
|
|
48
50
|
readonly "max-statements": "off";
|
|
49
51
|
readonly "no-console": "off";
|
|
@@ -54,13 +56,25 @@ declare const baseConfig: {
|
|
|
54
56
|
readonly "no-ternary": "off";
|
|
55
57
|
readonly "no-undef": "off";
|
|
56
58
|
readonly "no-undefined": "off";
|
|
59
|
+
readonly "node/callback-return": "off";
|
|
60
|
+
readonly "oxc/no-optional-chaining": "off";
|
|
57
61
|
readonly "oxc/no-rest-spread-properties": "off";
|
|
58
62
|
readonly "sort-imports": "off";
|
|
63
|
+
readonly "typescript/consistent-return": "off";
|
|
59
64
|
readonly "typescript/explicit-function-return-type": "off";
|
|
60
65
|
readonly "typescript/explicit-module-boundary-types": "off";
|
|
61
66
|
readonly "typescript/prefer-readonly-parameter-types": "off";
|
|
62
67
|
readonly "typescript/strict-boolean-expressions": "off";
|
|
68
|
+
readonly "unicorn/no-array-callback-reference": "off";
|
|
69
|
+
readonly "unicorn/no-array-method-this-argument": "off";
|
|
63
70
|
readonly "unicorn/switch-case-braces": "off";
|
|
71
|
+
readonly "vitest/no-importing-vitest-globals": "off";
|
|
72
|
+
readonly "vitest/prefer-expect-assertions": "off";
|
|
73
|
+
readonly "vitest/prefer-lowercase-title": "off";
|
|
74
|
+
readonly "vitest/prefer-to-be-falsy": "off";
|
|
75
|
+
readonly "vitest/prefer-to-be-truthy": "off";
|
|
76
|
+
readonly "vitest/require-hook": "off";
|
|
77
|
+
readonly "vitest/require-test-timeout": "off";
|
|
64
78
|
};
|
|
65
79
|
readonly settings: {
|
|
66
80
|
readonly vitest: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.base.d.ts","names":[],"sources":["../../src/configs/oxlint.base.ts"],"mappings":";;;;cAKM,UAAA;EAAA
|
|
1
|
+
{"version":3,"file":"oxlint.base.d.ts","names":[],"sources":["../../src/configs/oxlint.base.ts"],"mappings":";;;;cAKM,UAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4FO,YAAA,EAAc,qBAAA,CAAsB,YAAA,SAAqB,UAAA"}
|
|
@@ -19,7 +19,8 @@ const oxlintConfig = createMergeConfigFn({
|
|
|
19
19
|
"knip.ts",
|
|
20
20
|
"oxfmt.config.ts",
|
|
21
21
|
"oxlint.config.ts",
|
|
22
|
-
"tsdown.config.ts"
|
|
22
|
+
"tsdown.config.ts",
|
|
23
|
+
"vitest.config.ts"
|
|
23
24
|
],
|
|
24
25
|
rules: { "import/no-default-export": "off" }
|
|
25
26
|
}],
|
|
@@ -56,9 +57,11 @@ const oxlintConfig = createMergeConfigFn({
|
|
|
56
57
|
"import/no-named-export": "off",
|
|
57
58
|
"import/no-nodejs-modules": "off",
|
|
58
59
|
"import/prefer-default-export": "off",
|
|
60
|
+
"init-declarations": "off",
|
|
59
61
|
"jsdoc/require-param": "off",
|
|
60
62
|
"jsdoc/require-returns": "off",
|
|
61
63
|
"max-classes-per-file": "off",
|
|
64
|
+
"max-lines": "off",
|
|
62
65
|
"max-lines-per-function": "off",
|
|
63
66
|
"max-statements": "off",
|
|
64
67
|
"no-console": "off",
|
|
@@ -69,13 +72,25 @@ const oxlintConfig = createMergeConfigFn({
|
|
|
69
72
|
"no-ternary": "off",
|
|
70
73
|
"no-undef": "off",
|
|
71
74
|
"no-undefined": "off",
|
|
75
|
+
"node/callback-return": "off",
|
|
76
|
+
"oxc/no-optional-chaining": "off",
|
|
72
77
|
"oxc/no-rest-spread-properties": "off",
|
|
73
78
|
"sort-imports": "off",
|
|
79
|
+
"typescript/consistent-return": "off",
|
|
74
80
|
"typescript/explicit-function-return-type": "off",
|
|
75
81
|
"typescript/explicit-module-boundary-types": "off",
|
|
76
82
|
"typescript/prefer-readonly-parameter-types": "off",
|
|
77
83
|
"typescript/strict-boolean-expressions": "off",
|
|
78
|
-
"unicorn/
|
|
84
|
+
"unicorn/no-array-callback-reference": "off",
|
|
85
|
+
"unicorn/no-array-method-this-argument": "off",
|
|
86
|
+
"unicorn/switch-case-braces": "off",
|
|
87
|
+
"vitest/no-importing-vitest-globals": "off",
|
|
88
|
+
"vitest/prefer-expect-assertions": "off",
|
|
89
|
+
"vitest/prefer-lowercase-title": "off",
|
|
90
|
+
"vitest/prefer-to-be-falsy": "off",
|
|
91
|
+
"vitest/prefer-to-be-truthy": "off",
|
|
92
|
+
"vitest/require-hook": "off",
|
|
93
|
+
"vitest/require-test-timeout": "off"
|
|
79
94
|
},
|
|
80
95
|
settings: { vitest: { typecheck: true } }
|
|
81
96
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.base.js","names":[],"sources":["../../src/configs/oxlint.base.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\nimport type { OptionalMergeConfigFn } from \"#/utils.ts\"\n\nconst baseConfig = {\n categories: {\n correctness: \"error\",\n nursery: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n overrides: [\n {\n files: [\"knip.ts\", \"oxfmt.config.ts\", \"oxlint.config.ts\", \"tsdown.config.ts\"],\n rules: {\n \"import/no-default-export\": \"off\",\n },\n },\n ],\n plugins: [\n \"eslint\",\n \"react\",\n \"unicorn\",\n \"typescript\",\n \"oxc\",\n \"import\",\n \"jsdoc\",\n \"vitest\",\n \"jsx-a11y\",\n \"react-perf\",\n \"promise\",\n \"node\",\n ],\n rules: {\n curly: [\"error\", \"multi-or-nest\"],\n \"func-style\": [\"error\", \"expression\"],\n \"node/no-sync\": [\"error\", { ignores: [\"existsSync\", \"spawnSync\"] }],\n \"sort-keys\": [\"error\", \"asc\", { allowLineSeparatedGroups: true, natural: true }],\n\n \"capitalized-comments\": \"off\",\n \"id-length\": \"off\",\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"jsdoc/require-param\": \"off\",\n \"jsdoc/require-returns\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-console\": \"off\",\n \"no-continue\": \"off\",\n \"no-duplicate-imports\": \"off\",\n \"no-inline-comments\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-ternary\": \"off\",\n \"no-undef\": \"off\",\n \"no-undefined\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"sort-imports\": \"off\",\n \"typescript/explicit-function-return-type\": \"off\",\n \"typescript/explicit-module-boundary-types\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/strict-boolean-expressions\": \"off\",\n \"unicorn/switch-case-braces\": \"off\",\n },\n settings: {\n vitest: {\n typecheck: true,\n },\n },\n} as const satisfies OxlintConfig\n\nexport const oxlintConfig: OptionalMergeConfigFn<OxlintConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"oxlint.base.js","names":[],"sources":["../../src/configs/oxlint.base.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\nimport type { OptionalMergeConfigFn } from \"#/utils.ts\"\n\nconst baseConfig = {\n categories: {\n correctness: \"error\",\n nursery: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n overrides: [\n {\n files: [\"knip.ts\", \"oxfmt.config.ts\", \"oxlint.config.ts\", \"tsdown.config.ts\", \"vitest.config.ts\"],\n rules: {\n \"import/no-default-export\": \"off\",\n },\n },\n ],\n plugins: [\n \"eslint\",\n \"react\",\n \"unicorn\",\n \"typescript\",\n \"oxc\",\n \"import\",\n \"jsdoc\",\n \"vitest\",\n \"jsx-a11y\",\n \"react-perf\",\n \"promise\",\n \"node\",\n ],\n rules: {\n curly: [\"error\", \"multi-or-nest\"],\n \"func-style\": [\"error\", \"expression\"],\n \"node/no-sync\": [\"error\", { ignores: [\"existsSync\", \"spawnSync\"] }],\n \"sort-keys\": [\"error\", \"asc\", { allowLineSeparatedGroups: true, natural: true }],\n\n \"capitalized-comments\": \"off\",\n \"id-length\": \"off\",\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"init-declarations\": \"off\",\n \"jsdoc/require-param\": \"off\",\n \"jsdoc/require-returns\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-console\": \"off\",\n \"no-continue\": \"off\",\n \"no-duplicate-imports\": \"off\",\n \"no-inline-comments\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-ternary\": \"off\",\n \"no-undef\": \"off\",\n \"no-undefined\": \"off\",\n \"node/callback-return\": \"off\",\n \"oxc/no-optional-chaining\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"sort-imports\": \"off\",\n \"typescript/consistent-return\": \"off\",\n \"typescript/explicit-function-return-type\": \"off\",\n \"typescript/explicit-module-boundary-types\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/strict-boolean-expressions\": \"off\",\n \"unicorn/no-array-callback-reference\": \"off\",\n \"unicorn/no-array-method-this-argument\": \"off\",\n \"unicorn/switch-case-braces\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/require-hook\": \"off\",\n \"vitest/require-test-timeout\": \"off\",\n },\n settings: {\n vitest: {\n typecheck: true,\n },\n },\n} as const satisfies OxlintConfig\n\nexport const oxlintConfig: OptionalMergeConfigFn<OxlintConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";AAiGA,MAAa,eAAuE,oBAAoB;CA3FtG,YAAY;EACV,aAAa;EACb,SAAS;EACT,UAAU;EACV,MAAM;EACN,aAAa;EACb,OAAO;EACP,YAAY;CACd;CACA,SAAS;EACP,+BAA+B;EAC/B,WAAW;EACX,WAAW;CACb;CACA,WAAW,CACT;EACE,OAAO;GAAC;GAAW;GAAmB;GAAoB;GAAoB;EAAkB;EAChG,OAAO,EACL,4BAA4B,MAC9B;CACF,CACF;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EACL,OAAO,CAAC,SAAS,eAAe;EAChC,cAAc,CAAC,SAAS,YAAY;EACpC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,cAAc,WAAW,EAAE,CAAC;EAClE,aAAa;GAAC;GAAS;GAAO;IAAE,0BAA0B;IAAM,SAAS;GAAK;EAAC;EAE/E,wBAAwB;EACxB,aAAa;EACb,uBAAuB;EACvB,wBAAwB;EACxB,0BAA0B;EAC1B,4BAA4B;EAC5B,gCAAgC;EAChC,qBAAqB;EACrB,uBAAuB;EACvB,yBAAyB;EACzB,wBAAwB;EACxB,aAAa;EACb,0BAA0B;EAC1B,kBAAkB;EAClB,cAAc;EACd,eAAe;EACf,wBAAwB;EACxB,sBAAsB;EACtB,oBAAoB;EACpB,cAAc;EACd,YAAY;EACZ,gBAAgB;EAChB,wBAAwB;EACxB,4BAA4B;EAC5B,iCAAiC;EACjC,gBAAgB;EAChB,gCAAgC;EAChC,4CAA4C;EAC5C,6CAA6C;EAC7C,8CAA8C;EAC9C,yCAAyC;EACzC,uCAAuC;EACvC,yCAAyC;EACzC,8BAA8B;EAC9B,sCAAsC;EACtC,mCAAmC;EACnC,iCAAiC;EACjC,6BAA6B;EAC7B,8BAA8B;EAC9B,uBAAuB;EACvB,+BAA+B;CACjC;CACA,UAAU,EACR,QAAQ,EACN,WAAW,KACb,EACF;AAGsG,CAAU"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OptionalMergeConfigFn } from "../utils.js";
|
|
2
|
+
import { ViteUserConfig } from "vitest/config";
|
|
3
|
+
|
|
4
|
+
//#region src/configs/vitest.base.d.ts
|
|
5
|
+
declare const baseConfig: {
|
|
6
|
+
readonly test: {
|
|
7
|
+
readonly coverage: {
|
|
8
|
+
readonly enabled: true;
|
|
9
|
+
readonly reporter: ["text"];
|
|
10
|
+
};
|
|
11
|
+
readonly expect: {
|
|
12
|
+
readonly requireAssertions: true;
|
|
13
|
+
};
|
|
14
|
+
readonly setupFiles: ["src/test-setup.ts"];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
declare const vitestConfig: OptionalMergeConfigFn<ViteUserConfig, typeof baseConfig>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { vitestConfig };
|
|
20
|
+
//# sourceMappingURL=vitest.base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.base.d.ts","names":[],"sources":["../../src/configs/vitest.base.ts"],"mappings":";;;;cAKM,UAAA;EAAA;;;;;;;;;;;cAaO,YAAA,EAAc,qBAAA,CAAsB,cAAA,SAAuB,UAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createMergeConfigFn } from "../utils.js";
|
|
2
|
+
const vitestConfig = createMergeConfigFn({ test: {
|
|
3
|
+
coverage: {
|
|
4
|
+
enabled: true,
|
|
5
|
+
reporter: ["text"]
|
|
6
|
+
},
|
|
7
|
+
expect: { requireAssertions: true },
|
|
8
|
+
setupFiles: ["src/test-setup.ts"]
|
|
9
|
+
} });
|
|
10
|
+
//#endregion
|
|
11
|
+
export { vitestConfig };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=vitest.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.base.js","names":[],"sources":["../../src/configs/vitest.base.ts"],"sourcesContent":["import type { ViteUserConfig } from \"vitest/config\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\nimport type { OptionalMergeConfigFn } from \"#/utils.ts\"\n\nconst baseConfig = {\n test: {\n coverage: {\n enabled: true,\n reporter: [\"text\"],\n },\n expect: {\n requireAssertions: true,\n },\n setupFiles: [\"src/test-setup.ts\"],\n },\n} as const satisfies ViteUserConfig\n\nexport const vitestConfig: OptionalMergeConfigFn<ViteUserConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";AAkBA,MAAa,eAAyE,oBAAoB,EAZxG,MAAM;CACJ,UAAU;EACR,SAAS;EACT,UAAU,CAAC,MAAM;CACnB;CACA,QAAQ,EACN,mBAAmB,KACrB;CACA,YAAY,CAAC,mBAAmB;AAClC,EAGwG,CAAU"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import { knipConfig } from "./configs/knip.base.js";
|
|
|
2
2
|
import { tsdownBinConfig, tsdownConfig } from "./configs/tsdown.base.js";
|
|
3
3
|
import { oxlintConfig } from "./configs/oxlint.base.js";
|
|
4
4
|
import { oxfmtConfig } from "./configs/oxfmt.base.js";
|
|
5
|
-
|
|
5
|
+
import { vitestConfig } from "./configs/vitest.base.js";
|
|
6
|
+
export { knipConfig, oxfmtConfig, oxlintConfig, tsdownBinConfig, tsdownConfig, vitestConfig };
|
package/dist/index.js
CHANGED
|
@@ -2,4 +2,5 @@ import { knipConfig } from "./configs/knip.base.js";
|
|
|
2
2
|
import { tsdownBinConfig, tsdownConfig } from "./configs/tsdown.base.js";
|
|
3
3
|
import { oxlintConfig } from "./configs/oxlint.base.js";
|
|
4
4
|
import { oxfmtConfig } from "./configs/oxfmt.base.js";
|
|
5
|
-
|
|
5
|
+
import { vitestConfig } from "./configs/vitest.base.js";
|
|
6
|
+
export { knipConfig, oxfmtConfig, oxlintConfig, tsdownBinConfig, tsdownConfig, vitestConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamhl8/configs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"homepage": "https://github.com/adamhl8/configs",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/adamhl8/configs/issues"
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"oxlint-tsgolint": "^0.23.0",
|
|
57
57
|
"publint": "^0.3.21",
|
|
58
58
|
"tsdown": "^0.22.3",
|
|
59
|
-
"typescript": "^6.0.3"
|
|
59
|
+
"typescript": "^6.0.3",
|
|
60
|
+
"vitest": "^4.1.9"
|
|
60
61
|
},
|
|
61
62
|
"peerDependencies": {
|
|
62
63
|
"typescript": "^6.0.0"
|