@pezkuwi/dev-test 0.85.1 → 0.85.4
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/.skip-deno +0 -0
- package/cjs/packageInfo.js +1 -1
- package/env/expect.d.ts +267 -264
- package/env/jest.d.ts +122 -118
- package/env/lifecycle.d.ts +11 -7
- package/env/suite.d.ts +10 -10
- package/globals.cjs +1 -1
- package/globals.d.ts +7 -9
- package/package.json +11 -11
- package/packageInfo.js +1 -1
- package/tsconfig.build.json +16 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.spec.json +17 -0
- package/tsconfig.spec.tsbuildinfo +1 -0
- package/types.d.ts +12 -9
- package/cjs/detectOther.d.ts +0 -2
- package/cjs/detectOther.js +0 -3
- package/cjs/root.d.ts +0 -2
- package/cjs/root.js +0 -6
- package/cjs/rootJs/Clazz.d.ts +0 -18
- package/cjs/rootJs/Clazz.js +0 -36
- package/cjs/rootJs/Jsx.d.ts +0 -5
- package/cjs/rootJs/Jsx.js +0 -16
- package/cjs/rootJs/JsxChild.d.ts +0 -9
- package/cjs/rootJs/JsxChild.js +0 -9
- package/cjs/rootJs/augmented.d.ts +0 -8
- package/cjs/rootJs/augmented.js +0 -3
- package/cjs/rootJs/index.d.ts +0 -19
- package/cjs/rootJs/index.js +0 -51
- package/cjs/rootTests.d.ts +0 -2
- package/cjs/rootTests.js +0 -44
- package/cjs/sample.d.ts +0 -1
- package/cjs/sample.js +0 -4
- package/config/eslint.js +0 -160
- package/config/eslint.rules.js +0 -214
- package/config/prettier.cjs +0 -22
- package/config/rollup.js +0 -113
- package/config/tsconfig.json +0 -32
- package/config/typedoc.cjs +0 -18
- package/detectOther.d.ts +0 -2
- package/detectOther.js +0 -1
- package/root.d.ts +0 -2
- package/root.js +0 -2
- package/rootJs/Clazz.d.ts +0 -18
- package/rootJs/Clazz.js +0 -32
- package/rootJs/Jsx.d.ts +0 -5
- package/rootJs/Jsx.js +0 -13
- package/rootJs/JsxChild.d.ts +0 -9
- package/rootJs/JsxChild.js +0 -6
- package/rootJs/augmented.d.ts +0 -8
- package/rootJs/augmented.js +0 -2
- package/rootJs/dynamic.d.mts +0 -8
- package/rootJs/dynamic.mjs +0 -13
- package/rootJs/index.d.ts +0 -19
- package/rootJs/index.js +0 -39
- package/rootJs/testJson.json +0 -5
- package/rootStatic/zagros.svg +0 -1
- package/rootTests.d.ts +0 -2
- package/rootTests.js +0 -41
- package/scripts/pezkuwi-ci-ghact-build.mjs +0 -536
- package/scripts/pezkuwi-ci-ghact-docs.mjs +0 -14
- package/scripts/pezkuwi-ci-ghpages-force.mjs +0 -43
- package/scripts/pezkuwi-dev-build-docs.mjs +0 -19
- package/scripts/pezkuwi-dev-build-ts.mjs +0 -1518
- package/scripts/pezkuwi-dev-circular.mjs +0 -29
- package/scripts/pezkuwi-dev-clean-build.mjs +0 -61
- package/scripts/pezkuwi-dev-contrib.mjs +0 -74
- package/scripts/pezkuwi-dev-copy-dir.mjs +0 -44
- package/scripts/pezkuwi-dev-copy-to.mjs +0 -53
- package/scripts/pezkuwi-dev-deno-map.mjs +0 -35
- package/scripts/pezkuwi-dev-run-lint.mjs +0 -40
- package/scripts/pezkuwi-dev-run-node-ts.mjs +0 -9
- package/scripts/pezkuwi-dev-run-test.mjs +0 -163
- package/scripts/pezkuwi-dev-version.mjs +0 -143
- package/scripts/pezkuwi-dev-yarn-only.mjs +0 -11
- package/scripts/pezkuwi-exec-eslint.mjs +0 -7
- package/scripts/pezkuwi-exec-ghpages.mjs +0 -11
- package/scripts/pezkuwi-exec-ghrelease.mjs +0 -7
- package/scripts/pezkuwi-exec-node-test.mjs +0 -368
- package/scripts/pezkuwi-exec-rollup.mjs +0 -7
- package/scripts/pezkuwi-exec-tsc.mjs +0 -7
- package/scripts/pezkuwi-exec-webpack.mjs +0 -7
- package/scripts/util.mjs +0 -540
package/cjs/detectOther.d.ts
DELETED
package/cjs/detectOther.js
DELETED
package/cjs/root.d.ts
DELETED
package/cjs/root.js
DELETED
package/cjs/rootJs/Clazz.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare class Clazz {
|
|
2
|
-
#private;
|
|
3
|
-
readonly and: number;
|
|
4
|
-
static staticProperty: string;
|
|
5
|
-
static staticFunction: () => string | null;
|
|
6
|
-
/**
|
|
7
|
-
* @param and the number we should and with
|
|
8
|
-
*/
|
|
9
|
-
constructor(and: number);
|
|
10
|
-
get something(): number;
|
|
11
|
-
doAsync(): Promise<boolean>;
|
|
12
|
-
/**
|
|
13
|
-
* @description Sets something to something
|
|
14
|
-
* @param something The addition
|
|
15
|
-
*/
|
|
16
|
-
setSomething: (something?: number) => number;
|
|
17
|
-
toString(): string;
|
|
18
|
-
}
|
package/cjs/rootJs/Clazz.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Clazz = void 0;
|
|
4
|
-
class Clazz {
|
|
5
|
-
#something = 123_456_789;
|
|
6
|
-
and;
|
|
7
|
-
static staticProperty = 'foobar';
|
|
8
|
-
static staticFunction = () => Clazz.staticProperty;
|
|
9
|
-
/**
|
|
10
|
-
* @param and the number we should and with
|
|
11
|
-
*/
|
|
12
|
-
constructor(and) {
|
|
13
|
-
this.and = and;
|
|
14
|
-
this.#something = this.#something & and;
|
|
15
|
-
}
|
|
16
|
-
get something() {
|
|
17
|
-
return this.#something;
|
|
18
|
-
}
|
|
19
|
-
async doAsync() {
|
|
20
|
-
const res = await new Promise((resolve) => resolve(true));
|
|
21
|
-
console.log(res);
|
|
22
|
-
return res;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @description Sets something to something
|
|
26
|
-
* @param something The addition
|
|
27
|
-
*/
|
|
28
|
-
setSomething = (something) => {
|
|
29
|
-
this.#something = (something ?? 123_456) & this.and;
|
|
30
|
-
return this.#something;
|
|
31
|
-
};
|
|
32
|
-
toString() {
|
|
33
|
-
return `something=${this.#something}`;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.Clazz = Clazz;
|
package/cjs/rootJs/Jsx.d.ts
DELETED
package/cjs/rootJs/Jsx.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const styled_components_1 = require("styled-components");
|
|
7
|
-
const JsxChild_js_1 = tslib_1.__importDefault(require("./JsxChild.js"));
|
|
8
|
-
function Hidden({ children, className }) {
|
|
9
|
-
const [isMessageVisible, setMessageVisibility] = (0, react_1.useState)(false);
|
|
10
|
-
const onShow = (0, react_1.useCallback)((e) => setMessageVisibility(e.target.checked), []);
|
|
11
|
-
return ((0, jsx_runtime_1.jsxs)(StyledDiv, { className: className, children: [(0, jsx_runtime_1.jsx)("label", { htmlFor: 'toggle', children: "Show Message" }), (0, jsx_runtime_1.jsx)("input", { checked: isMessageVisible, id: 'toggle', onChange: onShow, type: 'checkbox' }), isMessageVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [children, (0, jsx_runtime_1.jsx)(JsxChild_js_1.default, { label: 'hello' })] }))] }));
|
|
12
|
-
}
|
|
13
|
-
const StyledDiv = styled_components_1.styled.div `
|
|
14
|
-
background: red;
|
|
15
|
-
`;
|
|
16
|
-
exports.default = react_1.default.memo(Hidden);
|
package/cjs/rootJs/JsxChild.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface Props {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
label?: string;
|
|
6
|
-
}
|
|
7
|
-
declare function Child({ children, className, label }: Props): React.ReactElement<Props>;
|
|
8
|
-
declare const _default: React.MemoExoticComponent<typeof Child>;
|
|
9
|
-
export default _default;
|
package/cjs/rootJs/JsxChild.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
function Child({ children, className, label }) {
|
|
7
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: className, children: [label || '', children] }));
|
|
8
|
-
}
|
|
9
|
-
exports.default = react_1.default.memo(Child);
|
package/cjs/rootJs/augmented.js
DELETED
package/cjs/rootJs/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** This should appear as-is in the output with: 1. extension added, 2. augmented.d.ts correct */
|
|
2
|
-
import './augmented.js';
|
|
3
|
-
/** Double double work, i.e. re-exports */
|
|
4
|
-
export { Clazz } from './Clazz.js';
|
|
5
|
-
/** Function to ensure that BigInt does not have the Babel Math.pow() transform */
|
|
6
|
-
export declare function bigIntExp(): bigint;
|
|
7
|
-
/** Function to ensure that dynamic imports work */
|
|
8
|
-
export declare function dynamic(a: number, b: number): Promise<number>;
|
|
9
|
-
/** Function to ensure we have json correctly imported */
|
|
10
|
-
export declare function json(): string;
|
|
11
|
-
/** Check support for the ?? operator */
|
|
12
|
-
export declare function jsOpExp(a?: number): number;
|
|
13
|
-
/** This is an actual check to ensure PURE is all-happy */
|
|
14
|
-
export declare const pureOpExp: number;
|
|
15
|
-
declare const fooA = 1;
|
|
16
|
-
declare const fooB = 2;
|
|
17
|
-
declare const fooC = 3;
|
|
18
|
-
declare const fooD = 4;
|
|
19
|
-
export { fooA, fooB, fooC, fooD };
|
package/cjs/rootJs/index.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fooD = exports.fooC = exports.fooB = exports.fooA = exports.pureOpExp = exports.Clazz = void 0;
|
|
4
|
-
exports.bigIntExp = bigIntExp;
|
|
5
|
-
exports.dynamic = dynamic;
|
|
6
|
-
exports.json = json;
|
|
7
|
-
exports.jsOpExp = jsOpExp;
|
|
8
|
-
const tslib_1 = require("tslib");
|
|
9
|
-
/** This should appear as-is in the output with: 1. extension added, 2. augmented.d.ts correct */
|
|
10
|
-
require("./augmented.js");
|
|
11
|
-
/** This import should appear as-in in the ouput (cjs without asserts) */
|
|
12
|
-
const testJson_json_1 = tslib_1.__importDefault(require("@pezkuwi/dev/rootJs/testJson.json"));
|
|
13
|
-
/** Double double work, i.e. re-exports */
|
|
14
|
-
var Clazz_js_1 = require("./Clazz.js");
|
|
15
|
-
Object.defineProperty(exports, "Clazz", { enumerable: true, get: function () { return Clazz_js_1.Clazz; } });
|
|
16
|
-
/** Function to ensure that BigInt does not have the Babel Math.pow() transform */
|
|
17
|
-
function bigIntExp() {
|
|
18
|
-
// 123_456n * 137_858_491_849n
|
|
19
|
-
return 123456789n * (13n ** 10n);
|
|
20
|
-
}
|
|
21
|
-
/** Function to ensure that dynamic imports work */
|
|
22
|
-
async function dynamic(a, b) {
|
|
23
|
-
// NOTE we go via this path so it points to the same location in both ESM
|
|
24
|
-
// and CJS output (a './dynamic' import would be different otherwise)
|
|
25
|
-
const { sum } = await import('@pezkuwi/dev/rootJs/dynamic.mjs');
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
27
|
-
return sum(a, b);
|
|
28
|
-
}
|
|
29
|
-
/** Function to ensure we have json correctly imported */
|
|
30
|
-
function json() {
|
|
31
|
-
return testJson_json_1.default.test.json;
|
|
32
|
-
}
|
|
33
|
-
/** Check support for the ?? operator */
|
|
34
|
-
function jsOpExp(a) {
|
|
35
|
-
const defaults = {
|
|
36
|
-
a: 42,
|
|
37
|
-
b: 43,
|
|
38
|
-
c: 44
|
|
39
|
-
};
|
|
40
|
-
return a ?? defaults.a;
|
|
41
|
-
}
|
|
42
|
-
/** This is an actual check to ensure PURE is all-happy */
|
|
43
|
-
exports.pureOpExp = jsOpExp();
|
|
44
|
-
const fooA = 1;
|
|
45
|
-
exports.fooA = fooA;
|
|
46
|
-
const fooB = 2;
|
|
47
|
-
exports.fooB = fooB;
|
|
48
|
-
const fooC = 3;
|
|
49
|
-
exports.fooC = fooC;
|
|
50
|
-
const fooD = 4;
|
|
51
|
-
exports.fooD = fooD;
|
package/cjs/rootTests.d.ts
DELETED
package/cjs/rootTests.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runTests = runTests;
|
|
4
|
-
function runTests({ Clazz, TEST_PURE, bigIntExp, dynamic, jsOpExp, json }) {
|
|
5
|
-
describe('Clazz', () => {
|
|
6
|
-
it('has staticProperty', () => {
|
|
7
|
-
expect(Clazz.staticProperty).toBe('foobar');
|
|
8
|
-
});
|
|
9
|
-
it('creates an instance with get/set', () => {
|
|
10
|
-
const c = new Clazz(456);
|
|
11
|
-
expect(c.something).toBe(123_456_789 & 456);
|
|
12
|
-
c.setSomething(123);
|
|
13
|
-
expect(c.something).toBe(123 & 456);
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
describe('TEST_PURE', () => {
|
|
17
|
-
it('should have the correct value', () => {
|
|
18
|
-
expect(TEST_PURE).toBe('testRoot');
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
describe('dynamic()', () => {
|
|
22
|
-
it('should allow dynamic import usage', async () => {
|
|
23
|
-
expect(await dynamic(5, 37)).toBe(42);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
describe('bigIntExp()', () => {
|
|
27
|
-
it('should return the correct value', () => {
|
|
28
|
-
expect(bigIntExp()).toBe(123456789n * 137858491849n);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
describe('jsOpExp', () => {
|
|
32
|
-
it('handles 0 ?? 42 correctly', () => {
|
|
33
|
-
expect(jsOpExp(0)).toBe(0);
|
|
34
|
-
});
|
|
35
|
-
it('handles undefined ?? 42 correctly', () => {
|
|
36
|
-
expect(jsOpExp()).toBe(42);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
describe('json()', () => {
|
|
40
|
-
it('should return the correct value', () => {
|
|
41
|
-
expect(json()).toBe('works');
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
}
|
package/cjs/sample.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export let foo: string;
|
package/cjs/sample.js
DELETED
package/config/eslint.js
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
// Copyright 2017-2025 @pezkuwi/dev authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
// @ts-expect-error No definition for this one
|
|
5
|
-
import eslintJs from '@eslint/js';
|
|
6
|
-
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
7
|
-
import tsParser from '@typescript-eslint/parser';
|
|
8
|
-
// @ts-expect-error No definition for this one
|
|
9
|
-
import standardConfig from 'eslint-config-standard';
|
|
10
|
-
import deprecationPlugin from 'eslint-plugin-deprecation';
|
|
11
|
-
// @ts-expect-error No definition for this one
|
|
12
|
-
import headerPlugin from 'eslint-plugin-header';
|
|
13
|
-
// @ts-expect-error No definition for this one
|
|
14
|
-
import importPlugin from 'eslint-plugin-import';
|
|
15
|
-
// @ts-expect-error No definition for this one
|
|
16
|
-
import importNewlinesPlugin from 'eslint-plugin-import-newlines';
|
|
17
|
-
// @ts-expect-error No definition for this one
|
|
18
|
-
import jestPlugin from 'eslint-plugin-jest';
|
|
19
|
-
// @ts-expect-error No definition for this one
|
|
20
|
-
import nPlugin from 'eslint-plugin-n';
|
|
21
|
-
// @ts-expect-error No definition for this one
|
|
22
|
-
import promisePlugin from 'eslint-plugin-promise';
|
|
23
|
-
// @ts-expect-error No definition for this one
|
|
24
|
-
import reactPlugin from 'eslint-plugin-react';
|
|
25
|
-
// @ts-expect-error No definition for this one
|
|
26
|
-
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
27
|
-
// @ts-expect-error No definition for this one
|
|
28
|
-
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
|
|
29
|
-
// @ts-expect-error No definition for this one
|
|
30
|
-
import sortDestructureKeysPlugin from 'eslint-plugin-sort-destructure-keys';
|
|
31
|
-
import globals from 'globals';
|
|
32
|
-
|
|
33
|
-
import { overrideAll, overrideJs, overrideJsx, overrideSpec } from './eslint.rules.js';
|
|
34
|
-
|
|
35
|
-
const EXT_JS = ['.cjs', '.js', '.mjs'];
|
|
36
|
-
const EXT_TS = ['.ts', '.tsx'];
|
|
37
|
-
const EXT_ALL = [...EXT_JS, ...EXT_TS];
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
* Converts a list of EXT_* defined above to globs
|
|
42
|
-
* @param {string[]} exts
|
|
43
|
-
* @returns {string[]}
|
|
44
|
-
*/
|
|
45
|
-
function extsToGlobs (exts) {
|
|
46
|
-
return exts.map((e) => `**/*${e}`);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export default [
|
|
50
|
-
{
|
|
51
|
-
ignores: [
|
|
52
|
-
'**/.github/',
|
|
53
|
-
'**/.vscode/',
|
|
54
|
-
'**/.yarn/',
|
|
55
|
-
'**/build/',
|
|
56
|
-
'**/build-*/',
|
|
57
|
-
'**/coverage/'
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
languageOptions: {
|
|
62
|
-
globals: {
|
|
63
|
-
...globals.browser,
|
|
64
|
-
...globals.node
|
|
65
|
-
},
|
|
66
|
-
parser: tsParser,
|
|
67
|
-
parserOptions: {
|
|
68
|
-
ecmaVersion: 'latest',
|
|
69
|
-
project: './tsconfig.eslint.json',
|
|
70
|
-
sourceType: 'module',
|
|
71
|
-
warnOnUnsupportedTypeScriptVersion: false
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
plugins: {
|
|
75
|
-
'@typescript-eslint': tsPlugin,
|
|
76
|
-
deprecation: deprecationPlugin,
|
|
77
|
-
header: headerPlugin,
|
|
78
|
-
import: importPlugin,
|
|
79
|
-
'import-newlines': importNewlinesPlugin,
|
|
80
|
-
n: nPlugin,
|
|
81
|
-
promise: promisePlugin,
|
|
82
|
-
'simple-import-sort': simpleImportSortPlugin,
|
|
83
|
-
'sort-destructure-keys': sortDestructureKeysPlugin
|
|
84
|
-
},
|
|
85
|
-
settings: {
|
|
86
|
-
'import/extensions': EXT_ALL,
|
|
87
|
-
'import/parsers': {
|
|
88
|
-
'@typescript-eslint/parser': EXT_TS,
|
|
89
|
-
espree: EXT_JS
|
|
90
|
-
},
|
|
91
|
-
'import/resolver': {
|
|
92
|
-
node: {
|
|
93
|
-
extensions: EXT_ALL
|
|
94
|
-
},
|
|
95
|
-
typescript: {
|
|
96
|
-
project: './tsconfig.eslint.json'
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
files: extsToGlobs(EXT_ALL),
|
|
103
|
-
rules: {
|
|
104
|
-
...eslintJs.configs.recommended.rules,
|
|
105
|
-
...standardConfig.rules,
|
|
106
|
-
...tsPlugin.configs['recommended-type-checked'].rules,
|
|
107
|
-
...tsPlugin.configs['stylistic-type-checked'].rules,
|
|
108
|
-
...overrideAll
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
files: extsToGlobs(EXT_JS),
|
|
113
|
-
rules: {
|
|
114
|
-
...overrideJs
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
files: [
|
|
119
|
-
'**/*.tsx',
|
|
120
|
-
'**/use*.ts'
|
|
121
|
-
],
|
|
122
|
-
plugins: {
|
|
123
|
-
react: reactPlugin,
|
|
124
|
-
'react-hooks': reactHooksPlugin
|
|
125
|
-
},
|
|
126
|
-
rules: {
|
|
127
|
-
...reactPlugin.configs.recommended.rules,
|
|
128
|
-
...reactHooksPlugin.configs.recommended.rules,
|
|
129
|
-
...overrideJsx
|
|
130
|
-
},
|
|
131
|
-
settings: {
|
|
132
|
-
react: {
|
|
133
|
-
version: 'detect'
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
files: [
|
|
139
|
-
'**/*.spec.ts',
|
|
140
|
-
'**/*.spec.tsx'
|
|
141
|
-
],
|
|
142
|
-
languageOptions: {
|
|
143
|
-
globals: {
|
|
144
|
-
...globals.jest
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
plugins: {
|
|
148
|
-
jest: jestPlugin
|
|
149
|
-
},
|
|
150
|
-
rules: {
|
|
151
|
-
...jestPlugin.configs.recommended.rules,
|
|
152
|
-
...overrideSpec
|
|
153
|
-
},
|
|
154
|
-
settings: {
|
|
155
|
-
jest: {
|
|
156
|
-
version: 27
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
];
|
package/config/eslint.rules.js
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
// Copyright 2017-2025 @pezkuwi/dev authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import JSON5 from 'json5';
|
|
5
|
-
import fs from 'node:fs';
|
|
6
|
-
import path from 'node:path';
|
|
7
|
-
import process from 'node:process';
|
|
8
|
-
|
|
9
|
-
const FIXME = {
|
|
10
|
-
// This is in the new 6.0.0 and we should switch this on
|
|
11
|
-
// at some point. For a first iteration we keep as-is
|
|
12
|
-
'@typescript-eslint/prefer-nullish-coalescing': 'off'
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Returns a copyright header pattern (using tsconfig.base.json)
|
|
17
|
-
*
|
|
18
|
-
* @returns {string}
|
|
19
|
-
*/
|
|
20
|
-
function getHeaderPattern () {
|
|
21
|
-
const tsPath = path.join(process.cwd(), 'tsconfig.base.json');
|
|
22
|
-
|
|
23
|
-
if (!fs.existsSync(tsPath)) {
|
|
24
|
-
throw new Error(`Unable to load ${tsPath}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const tsConfig = JSON5.parse(fs.readFileSync(tsPath, 'utf-8'));
|
|
28
|
-
|
|
29
|
-
if (!tsConfig?.compilerOptions?.paths) {
|
|
30
|
-
throw new Error(`Unable to extract compilerOptions.paths structure from ${tsPath}`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const paths = Object.keys(tsConfig.compilerOptions.paths);
|
|
34
|
-
|
|
35
|
-
if (!paths.length) {
|
|
36
|
-
throw new Error(`No keys found in compilerOptions.paths from ${tsPath}`);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const packages = paths.reduce((packages, k) => {
|
|
40
|
-
const [pd, pk] = k.split('/');
|
|
41
|
-
|
|
42
|
-
if (pd !== '@pezkuwi' || !pk) {
|
|
43
|
-
throw new Error(`Non @pezkuwi path in ${tsPath}`);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return packages.length
|
|
47
|
-
? `${packages}|${pk}`
|
|
48
|
-
: pk;
|
|
49
|
-
}, '');
|
|
50
|
-
const fullyear = new Date().getFullYear();
|
|
51
|
-
const years = [];
|
|
52
|
-
|
|
53
|
-
for (let i = 17, last = fullyear - 2000; i < last; i++) {
|
|
54
|
-
years.push(`${i}`);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return ` Copyright 20(${years.join('|')})(-${fullyear})? @pezkuwi/(${packages})`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const overrideAll = {
|
|
61
|
-
...FIXME,
|
|
62
|
-
// the next 2 enforce isolatedModules & verbatimModuleSyntax
|
|
63
|
-
'@typescript-eslint/consistent-type-exports': 'error',
|
|
64
|
-
'@typescript-eslint/consistent-type-imports': 'error',
|
|
65
|
-
'@typescript-eslint/dot-notation': 'error',
|
|
66
|
-
'@typescript-eslint/indent': ['error', 2],
|
|
67
|
-
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
68
|
-
// ts itself checks and ignores those starting with _, align the linting
|
|
69
|
-
'@typescript-eslint/no-unused-vars': ['error', {
|
|
70
|
-
args: 'all',
|
|
71
|
-
argsIgnorePattern: '^_',
|
|
72
|
-
caughtErrors: 'all',
|
|
73
|
-
caughtErrorsIgnorePattern: '^_',
|
|
74
|
-
destructuredArrayIgnorePattern: '^_',
|
|
75
|
-
vars: 'all',
|
|
76
|
-
varsIgnorePattern: '^_'
|
|
77
|
-
}],
|
|
78
|
-
'@typescript-eslint/type-annotation-spacing': 'error',
|
|
79
|
-
'arrow-parens': ['error', 'always'],
|
|
80
|
-
'brace-style': ['error', '1tbs'],
|
|
81
|
-
curly: ['error', 'all'],
|
|
82
|
-
'default-param-last': 'off', // conflicts with TS version
|
|
83
|
-
'deprecation/deprecation': 'error',
|
|
84
|
-
'dot-notation': 'off', // conflicts with TS version
|
|
85
|
-
'func-style': ['error', 'declaration', {
|
|
86
|
-
allowArrowFunctions: true
|
|
87
|
-
}],
|
|
88
|
-
// this does help with declarations, but also
|
|
89
|
-
// applies to invocations, which is an issue...
|
|
90
|
-
// 'function-paren-newline': ['error', 'never'],
|
|
91
|
-
'function-call-argument-newline': ['error', 'consistent'],
|
|
92
|
-
'header/header': ['error', 'line', [
|
|
93
|
-
{ pattern: getHeaderPattern() },
|
|
94
|
-
' SPDX-License-Identifier: Apache-2.0'
|
|
95
|
-
], 2],
|
|
96
|
-
'import-newlines/enforce': ['error', {
|
|
97
|
-
forceSingleLine: true,
|
|
98
|
-
items: 2048
|
|
99
|
-
}],
|
|
100
|
-
'import/export': 'error',
|
|
101
|
-
'import/extensions': ['error', 'ignorePackages', {
|
|
102
|
-
cjs: 'always',
|
|
103
|
-
js: 'always',
|
|
104
|
-
json: 'always',
|
|
105
|
-
jsx: 'never',
|
|
106
|
-
mjs: 'always',
|
|
107
|
-
ts: 'never',
|
|
108
|
-
tsx: 'never'
|
|
109
|
-
}],
|
|
110
|
-
'import/first': 'error',
|
|
111
|
-
'import/newline-after-import': 'error',
|
|
112
|
-
'import/no-duplicates': 'error',
|
|
113
|
-
'import/order': 'off', // conflicts with simple-import-sort
|
|
114
|
-
indent: 'off', // required as 'off' since typescript-eslint has own versions
|
|
115
|
-
'no-extra-semi': 'error',
|
|
116
|
-
'no-unused-vars': 'off',
|
|
117
|
-
'no-use-before-define': 'off',
|
|
118
|
-
'object-curly-newline': ['error', {
|
|
119
|
-
ExportDeclaration: { minProperties: 2048 },
|
|
120
|
-
ImportDeclaration: { minProperties: 2048 },
|
|
121
|
-
ObjectPattern: { minProperties: 2048 }
|
|
122
|
-
}],
|
|
123
|
-
'padding-line-between-statements': [
|
|
124
|
-
'error',
|
|
125
|
-
{ blankLine: 'always', next: '*', prev: ['const', 'let', 'var'] },
|
|
126
|
-
{ blankLine: 'any', next: ['const', 'let', 'var'], prev: ['const', 'let', 'var'] },
|
|
127
|
-
{ blankLine: 'always', next: 'block-like', prev: '*' },
|
|
128
|
-
{ blankLine: 'always', next: '*', prev: 'block-like' },
|
|
129
|
-
{ blankLine: 'always', next: 'function', prev: '*' },
|
|
130
|
-
{ blankLine: 'always', next: '*', prev: 'function' },
|
|
131
|
-
{ blankLine: 'always', next: 'try', prev: '*' },
|
|
132
|
-
{ blankLine: 'always', next: '*', prev: 'try' },
|
|
133
|
-
{ blankLine: 'always', next: 'return', prev: '*' },
|
|
134
|
-
{ blankLine: 'always', next: 'import', prev: '*' },
|
|
135
|
-
{ blankLine: 'always', next: '*', prev: 'import' },
|
|
136
|
-
{ blankLine: 'any', next: 'import', prev: 'import' }
|
|
137
|
-
],
|
|
138
|
-
semi: ['error', 'always'],
|
|
139
|
-
'simple-import-sort/exports': 'error',
|
|
140
|
-
'simple-import-sort/imports': ['error', {
|
|
141
|
-
groups: [
|
|
142
|
-
['^\u0000'], // all side-effects (0 at start)
|
|
143
|
-
['\u0000$', '^@pezkuwi.*\u0000$', '^\\..*\u0000$'], // types (0 at end)
|
|
144
|
-
// ['^node:'], // node
|
|
145
|
-
['^[^/\\.]'], // non-pezkuwi
|
|
146
|
-
['^@pezkuwi'], // pezkuwi
|
|
147
|
-
['^\\.\\.(?!/?$)', '^\\.\\./?$', '^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'] // local (. last)
|
|
148
|
-
]
|
|
149
|
-
}],
|
|
150
|
-
'sort-destructure-keys/sort-destructure-keys': ['error', {
|
|
151
|
-
caseSensitive: true
|
|
152
|
-
}],
|
|
153
|
-
'sort-keys': 'error',
|
|
154
|
-
'spaced-comment': ['error', 'always', {
|
|
155
|
-
block: {
|
|
156
|
-
// pure export helpers
|
|
157
|
-
markers: ['#__PURE__']
|
|
158
|
-
},
|
|
159
|
-
line: {
|
|
160
|
-
// TS reference types
|
|
161
|
-
markers: ['/ <reference']
|
|
162
|
-
}
|
|
163
|
-
}]
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export const overrideJsx = {
|
|
167
|
-
'jsx-quotes': ['error', 'prefer-single'],
|
|
168
|
-
// swap from recommended warning to error
|
|
169
|
-
'react-hooks/exhaustive-deps': 'error',
|
|
170
|
-
'react/jsx-closing-bracket-location': ['warn', 'tag-aligned'],
|
|
171
|
-
'react/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
|
|
172
|
-
'react/jsx-fragments': 'error',
|
|
173
|
-
'react/jsx-max-props-per-line': ['warn', {
|
|
174
|
-
maximum: 1,
|
|
175
|
-
when: 'always'
|
|
176
|
-
}],
|
|
177
|
-
'react/jsx-newline': ['error', {
|
|
178
|
-
prevent: true
|
|
179
|
-
}],
|
|
180
|
-
'react/jsx-no-bind': 'error',
|
|
181
|
-
'react/jsx-props-no-multi-spaces': 'error',
|
|
182
|
-
'react/jsx-sort-props': ['warn', {
|
|
183
|
-
noSortAlphabetically: false
|
|
184
|
-
}],
|
|
185
|
-
'react/jsx-tag-spacing': ['error', {
|
|
186
|
-
afterOpening: 'never',
|
|
187
|
-
beforeClosing: 'never',
|
|
188
|
-
beforeSelfClosing: 'always',
|
|
189
|
-
closingSlash: 'never'
|
|
190
|
-
}],
|
|
191
|
-
'react/prop-types': 'off' // this is a completely broken rule
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
export const overrideJs = {
|
|
195
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
196
|
-
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
197
|
-
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
198
|
-
'@typescript-eslint/no-unsafe-call': 'off',
|
|
199
|
-
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
200
|
-
'@typescript-eslint/no-unsafe-return': 'off',
|
|
201
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
202
|
-
'@typescript-eslint/restrict-plus-operands': 'off',
|
|
203
|
-
'@typescript-eslint/restrict-template-expressions': 'off'
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
export const overrideSpec = {
|
|
207
|
-
// in the specs we are a little less worried about
|
|
208
|
-
// specific correctness, i.e. we can have dangling bits
|
|
209
|
-
'@typescript-eslint/no-unsafe-call': 'off',
|
|
210
|
-
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
211
|
-
'jest/expect-expect': ['warn', {
|
|
212
|
-
assertFunctionNames: ['assert', 'expect']
|
|
213
|
-
}]
|
|
214
|
-
};
|
package/config/prettier.cjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Copyright 2017-2025 @pezkuwi/dev authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
arrowParens: 'always',
|
|
6
|
-
bracketSpacing: true,
|
|
7
|
-
embeddedLanguageFormatting: 'off',
|
|
8
|
-
endOfLine: 'lf',
|
|
9
|
-
htmlWhitespaceSensitivity: 'ignore',
|
|
10
|
-
jsxBracketSameLine: false,
|
|
11
|
-
jsxSingleQuote: true,
|
|
12
|
-
parser: 'typescript',
|
|
13
|
-
printWidth: 2048,
|
|
14
|
-
proseWrap: 'preserve',
|
|
15
|
-
quoteProps: 'as-needed',
|
|
16
|
-
requirePragma: true, // only on those files explicitly asked for
|
|
17
|
-
semi: true,
|
|
18
|
-
singleQuote: true,
|
|
19
|
-
tabWidth: 2,
|
|
20
|
-
trailingComma: 'none',
|
|
21
|
-
useTabs: false
|
|
22
|
-
};
|