@venizia/dev-configs 0.3.0 → 0.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 +112 -31
- package/dist/compilers/bun.d.ts.map +1 -1
- package/dist/compilers/bun.js +1 -0
- package/dist/compilers/bun.js.map +1 -1
- package/dist/formatters/oxfmt.d.ts +14 -0
- package/dist/formatters/oxfmt.d.ts.map +1 -1
- package/dist/formatters/oxfmt.js +19 -1
- package/dist/formatters/oxfmt.js.map +1 -1
- package/dist/linters/browser.d.ts +19 -0
- package/dist/linters/browser.d.ts.map +1 -0
- package/dist/linters/browser.js +32 -0
- package/dist/linters/browser.js.map +1 -0
- package/dist/linters/eslint.d.ts +1 -1
- package/dist/linters/eslint.js +1 -1
- package/dist/linters/house/common.d.ts +20 -0
- package/dist/linters/house/common.d.ts.map +1 -0
- package/dist/linters/house/common.js +29 -0
- package/dist/linters/house/common.js.map +1 -0
- package/dist/linters/house/configs.d.ts +16 -0
- package/dist/linters/house/configs.d.ts.map +1 -0
- package/dist/linters/house/configs.js +45 -0
- package/dist/linters/house/configs.js.map +1 -0
- package/dist/linters/house/index.d.ts +6 -0
- package/dist/linters/house/index.d.ts.map +1 -0
- package/dist/linters/house/index.js +22 -0
- package/dist/linters/house/index.js.map +1 -0
- package/dist/linters/house/max-params-own.rule.d.ts +19 -0
- package/dist/linters/house/max-params-own.rule.d.ts.map +1 -0
- package/dist/linters/house/max-params-own.rule.js +122 -0
- package/dist/linters/house/max-params-own.rule.js.map +1 -0
- package/dist/linters/house/no-new-error.rule.d.ts +15 -0
- package/dist/linters/house/no-new-error.rule.d.ts.map +1 -0
- package/dist/linters/house/no-new-error.rule.js +43 -0
- package/dist/linters/house/no-new-error.rule.js.map +1 -0
- package/dist/linters/house/plugin.d.ts +4 -0
- package/dist/linters/house/plugin.d.ts.map +1 -0
- package/dist/linters/house/plugin.js +15 -0
- package/dist/linters/house/plugin.js.map +1 -0
- package/dist/linters/index.d.ts +2 -0
- package/dist/linters/index.d.ts.map +1 -1
- package/dist/linters/index.js +2 -0
- package/dist/linters/index.js.map +1 -1
- package/dist/linters/oxlint.d.ts +25 -0
- package/dist/linters/oxlint.d.ts.map +1 -1
- package/dist/linters/oxlint.js +43 -1
- package/dist/linters/oxlint.js.map +1 -1
- package/dist/linters/react.d.ts +7 -5
- package/dist/linters/react.d.ts.map +1 -1
- package/dist/linters/react.js +27 -12
- package/dist/linters/react.js.map +1 -1
- package/dist/linters/rules/no-unused-vars.rule.d.ts +5 -0
- package/dist/linters/rules/no-unused-vars.rule.d.ts.map +1 -1
- package/dist/linters/rules/no-unused-vars.rule.js +2 -2
- package/dist/linters/rules/no-unused-vars.rule.js.map +1 -1
- package/dist/linters/rules/prefer-nullish-coalescing.rule.d.ts +7 -0
- package/dist/linters/rules/prefer-nullish-coalescing.rule.d.ts.map +1 -1
- package/dist/linters/rules/prefer-nullish-coalescing.rule.js.map +1 -1
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +18 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/rejection.helper.d.ts +21 -0
- package/dist/testing/rejection.helper.d.ts.map +1 -0
- package/dist/testing/rejection.helper.js +37 -0
- package/dist/testing/rejection.helper.js.map +1 -0
- package/package.json +7 -6
- package/src/tsconfig/tsconfig.browser.json +11 -0
- package/src/tsconfig/tsconfig.react.json +7 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./rejection.helper"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Awaits a task that must reject and returns what it rejected with; throws when the task resolves.
|
|
3
|
+
*
|
|
4
|
+
* bun types the async matchers (`expect(task).rejects` / `.resolves`) as `void`, so
|
|
5
|
+
* `await expect(task).rejects.toThrow()` is refused by `await-thenable` - and left un-awaited the
|
|
6
|
+
* assertion never runs. Awaiting the task itself needs no matcher and no cast:
|
|
7
|
+
* `expectRejection({ task, message })` or `expect(await rejectionOf(task)).toBeInstanceOf(Error)`,
|
|
8
|
+
* and for a resolution `expect(await task).toMatchObject(...)`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const rejectionOf: (task: Promise<unknown>) => Promise<unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* The task rejects with an Error whose message contains `message` (a string) or matches it (a
|
|
13
|
+
* RegExp). The message is compared as a string on purpose: bun 1.4.2 `toMatchObject` with an
|
|
14
|
+
* asymmetric matcher overwrites the matched property on the object it checks, so a later read of
|
|
15
|
+
* `error.message` gets the matcher back.
|
|
16
|
+
*/
|
|
17
|
+
export declare const expectRejection: (opts: {
|
|
18
|
+
task: Promise<unknown>;
|
|
19
|
+
message: string | RegExp;
|
|
20
|
+
}) => Promise<void>;
|
|
21
|
+
//# sourceMappingURL=rejection.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rejection.helper.d.ts","sourceRoot":"","sources":["../../src/testing/rejection.helper.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GAAU,MAAM,OAAO,CAAC,OAAO,CAAC,KAAG,OAAO,CAAC,OAAO,CAQzE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAU,MAAM;IAC1C,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B,KAAG,OAAO,CAAC,IAAI,CAMf,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.expectRejection = exports.rejectionOf = void 0;
|
|
4
|
+
const bun_test_1 = require("bun:test");
|
|
5
|
+
/**
|
|
6
|
+
* Awaits a task that must reject and returns what it rejected with; throws when the task resolves.
|
|
7
|
+
*
|
|
8
|
+
* bun types the async matchers (`expect(task).rejects` / `.resolves`) as `void`, so
|
|
9
|
+
* `await expect(task).rejects.toThrow()` is refused by `await-thenable` - and left un-awaited the
|
|
10
|
+
* assertion never runs. Awaiting the task itself needs no matcher and no cast:
|
|
11
|
+
* `expectRejection({ task, message })` or `expect(await rejectionOf(task)).toBeInstanceOf(Error)`,
|
|
12
|
+
* and for a resolution `expect(await task).toMatchObject(...)`.
|
|
13
|
+
*/
|
|
14
|
+
const rejectionOf = async (task) => {
|
|
15
|
+
try {
|
|
16
|
+
await task;
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return error;
|
|
20
|
+
}
|
|
21
|
+
return bun_test_1.expect.unreachable('Expected the task to reject, but it resolved');
|
|
22
|
+
};
|
|
23
|
+
exports.rejectionOf = rejectionOf;
|
|
24
|
+
/**
|
|
25
|
+
* The task rejects with an Error whose message contains `message` (a string) or matches it (a
|
|
26
|
+
* RegExp). The message is compared as a string on purpose: bun 1.4.2 `toMatchObject` with an
|
|
27
|
+
* asymmetric matcher overwrites the matched property on the object it checks, so a later read of
|
|
28
|
+
* `error.message` gets the matcher back.
|
|
29
|
+
*/
|
|
30
|
+
const expectRejection = async (opts) => {
|
|
31
|
+
const { task, message } = opts;
|
|
32
|
+
const reason = await (0, exports.rejectionOf)(task);
|
|
33
|
+
(0, bun_test_1.expect)(reason).toBeInstanceOf(Error);
|
|
34
|
+
(0, bun_test_1.expect)(reason instanceof Error ? reason.message : String(reason)).toMatch(message);
|
|
35
|
+
};
|
|
36
|
+
exports.expectRejection = expectRejection;
|
|
37
|
+
//# sourceMappingURL=rejection.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rejection.helper.js","sourceRoot":"","sources":["../../src/testing/rejection.helper.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC;;;;;;;;GAQG;AACI,MAAM,WAAW,GAAG,KAAK,EAAE,IAAsB,EAAoB,EAAE;IAC5E,IAAI,CAAC;QACH,MAAM,IAAI,CAAC;IACb,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,iBAAM,CAAC,WAAW,CAAC,8CAA8C,CAAC,CAAC;AAC5E,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB;AAEF;;;;;GAKG;AACI,MAAM,eAAe,GAAG,KAAK,EAAE,IAGrC,EAAiB,EAAE;IAClB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAW,EAAC,IAAI,CAAC,CAAC;IAEvC,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,IAAA,iBAAM,EAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACrF,CAAC,CAAC;AATW,QAAA,eAAe,mBAS1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/dev-configs",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1-1",
|
|
4
4
|
"description": "Shareable development configurations for TypeScript projects: oxlint and oxfmt presets with per-rule builders, the ESLint naming-convention rule, the legacy ESLint flat config and Prettier presets, and TypeScript compiler options with critical decorator support (experimentalDecorators, emitDecoratorMetadata, useDefineForClassFields). Single source of truth for consistent code style, type checking, and build settings across monorepo packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build-tools",
|
|
@@ -78,8 +78,14 @@
|
|
|
78
78
|
"types": "./dist/linters/index.d.ts",
|
|
79
79
|
"default": "./dist/linters/index.js"
|
|
80
80
|
},
|
|
81
|
+
"./testing": {
|
|
82
|
+
"types": "./dist/testing/index.d.ts",
|
|
83
|
+
"default": "./dist/testing/index.js"
|
|
84
|
+
},
|
|
81
85
|
"./tsconfig.base.json": "./src/tsconfig/tsconfig.base.json",
|
|
82
86
|
"./tsconfig.common.json": "./src/tsconfig/tsconfig.common.json",
|
|
87
|
+
"./tsconfig.browser.json": "./src/tsconfig/tsconfig.browser.json",
|
|
88
|
+
"./tsconfig.react.json": "./src/tsconfig/tsconfig.react.json",
|
|
83
89
|
"./package.json": "./package.json"
|
|
84
90
|
},
|
|
85
91
|
"files": [
|
|
@@ -106,7 +112,6 @@
|
|
|
106
112
|
},
|
|
107
113
|
"peerDependencies": {
|
|
108
114
|
"eslint": "^9.0.0 || ^10.0.0",
|
|
109
|
-
"jiti": ">=2.2.0",
|
|
110
115
|
"oxfmt": ">=0.73.0",
|
|
111
116
|
"oxlint": ">=1.88.0",
|
|
112
117
|
"oxlint-tsgolint": ">=7.0.2004",
|
|
@@ -117,9 +122,6 @@
|
|
|
117
122
|
"eslint": {
|
|
118
123
|
"optional": true
|
|
119
124
|
},
|
|
120
|
-
"jiti": {
|
|
121
|
-
"optional": true
|
|
122
|
-
},
|
|
123
125
|
"oxfmt": {
|
|
124
126
|
"optional": true
|
|
125
127
|
},
|
|
@@ -139,7 +141,6 @@
|
|
|
139
141
|
"devDependencies": {
|
|
140
142
|
"@types/bun": "^1.4.1",
|
|
141
143
|
"eslint": "^10.10.0",
|
|
142
|
-
"jiti": "^2.7.0",
|
|
143
144
|
"oxfmt": "0.73.0",
|
|
144
145
|
"oxlint": "1.88.0",
|
|
145
146
|
"oxlint-tsgolint": "7.0.2004",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./tsconfig.base.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
/* A browser library: a bundler (Vite, webpack) resolves the imports, the DOM is there, Bun is not */
|
|
6
|
+
"lib": ["ES2025", "DOM", "DOM.Iterable"],
|
|
7
|
+
"types": [],
|
|
8
|
+
"module": "ESNext",
|
|
9
|
+
"moduleResolution": "bundler"
|
|
10
|
+
}
|
|
11
|
+
}
|