xenopomp-essentials 0.1.3-rc.4 → 0.1.3-rc.5
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/eslint/index.d.mts +18 -21
- package/eslint/index.d.ts +18 -21
- package/eslint/index.mjs +1 -1
- package/index.d.mts +7 -2
- package/index.d.ts +7 -2
- package/package.json +10 -3
- package/shared/xenopomp-essentials.BFV6RP1V.d.mts +0 -7
- package/shared/xenopomp-essentials.BFV6RP1V.d.ts +0 -7
package/eslint/index.d.mts
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { D as Defined } from '../shared/xenopomp-essentials.BFV6RP1V.mjs';
|
|
1
|
+
import { antfu, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
interface CustomConfig {
|
|
4
|
+
all?: boolean;
|
|
5
|
+
next?: boolean;
|
|
6
|
+
}
|
|
7
7
|
|
|
8
|
+
type UserConfigItem = Parameters<typeof antfu>[1];
|
|
9
|
+
type Configs = ReturnType<typeof antfu>;
|
|
10
|
+
|
|
11
|
+
type Options = OptionsConfig & CustomConfig & TypedFlatConfigItem;
|
|
8
12
|
/**
|
|
9
|
-
* XenoPOMP`s default ESLint config. Uses @
|
|
10
|
-
* under the hood.
|
|
13
|
+
* XenoPOMP`s default ESLint config. Uses @antfu/eslint-config under the hood.
|
|
11
14
|
*
|
|
12
15
|
* @param options
|
|
13
16
|
* @param userConfigs
|
|
14
17
|
*
|
|
15
18
|
* @example
|
|
16
|
-
* import { xenopomp } from 'xenopomp-essentials';
|
|
17
|
-
*
|
|
18
19
|
* export default xenopomp(
|
|
19
|
-
* // Setup
|
|
20
|
+
* // Setup antfu config
|
|
20
21
|
* {
|
|
21
|
-
* react:
|
|
22
|
+
* react: true,
|
|
23
|
+
* next: false,
|
|
22
24
|
* },
|
|
23
|
-
*
|
|
24
|
-
* // Setup custom user configs
|
|
25
|
+
* // User configs
|
|
25
26
|
* {
|
|
26
|
-
* name: '
|
|
27
|
-
* rules: {
|
|
28
|
-
* 'some/rule-name': 'warn',
|
|
29
|
-
* },
|
|
30
|
-
* // ...
|
|
27
|
+
* name: 'My custom config',
|
|
28
|
+
* rules: { ... }
|
|
31
29
|
* },
|
|
32
|
-
* // ...
|
|
33
30
|
* );
|
|
34
31
|
*/
|
|
35
|
-
declare function xenopomp(options?:
|
|
32
|
+
declare function xenopomp(options?: Options, ...userConfigs: UserConfigItem[]): Configs;
|
|
36
33
|
|
|
37
|
-
export { xenopomp as default };
|
|
34
|
+
export { type Configs, type CustomConfig, type Options, type UserConfigItem, xenopomp as default };
|
package/eslint/index.d.ts
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { D as Defined } from '../shared/xenopomp-essentials.BFV6RP1V.js';
|
|
1
|
+
import { antfu, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
interface CustomConfig {
|
|
4
|
+
all?: boolean;
|
|
5
|
+
next?: boolean;
|
|
6
|
+
}
|
|
7
7
|
|
|
8
|
+
type UserConfigItem = Parameters<typeof antfu>[1];
|
|
9
|
+
type Configs = ReturnType<typeof antfu>;
|
|
10
|
+
|
|
11
|
+
type Options = OptionsConfig & CustomConfig & TypedFlatConfigItem;
|
|
8
12
|
/**
|
|
9
|
-
* XenoPOMP`s default ESLint config. Uses @
|
|
10
|
-
* under the hood.
|
|
13
|
+
* XenoPOMP`s default ESLint config. Uses @antfu/eslint-config under the hood.
|
|
11
14
|
*
|
|
12
15
|
* @param options
|
|
13
16
|
* @param userConfigs
|
|
14
17
|
*
|
|
15
18
|
* @example
|
|
16
|
-
* import { xenopomp } from 'xenopomp-essentials';
|
|
17
|
-
*
|
|
18
19
|
* export default xenopomp(
|
|
19
|
-
* // Setup
|
|
20
|
+
* // Setup antfu config
|
|
20
21
|
* {
|
|
21
|
-
* react:
|
|
22
|
+
* react: true,
|
|
23
|
+
* next: false,
|
|
22
24
|
* },
|
|
23
|
-
*
|
|
24
|
-
* // Setup custom user configs
|
|
25
|
+
* // User configs
|
|
25
26
|
* {
|
|
26
|
-
* name: '
|
|
27
|
-
* rules: {
|
|
28
|
-
* 'some/rule-name': 'warn',
|
|
29
|
-
* },
|
|
30
|
-
* // ...
|
|
27
|
+
* name: 'My custom config',
|
|
28
|
+
* rules: { ... }
|
|
31
29
|
* },
|
|
32
|
-
* // ...
|
|
33
30
|
* );
|
|
34
31
|
*/
|
|
35
|
-
declare function xenopomp(options?:
|
|
32
|
+
declare function xenopomp(options?: Options, ...userConfigs: UserConfigItem[]): Configs;
|
|
36
33
|
|
|
37
|
-
export { xenopomp as default };
|
|
34
|
+
export { type Configs, type CustomConfig, type Options, type UserConfigItem, xenopomp as default };
|
package/eslint/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{GLOB_JSX as a,GLOB_TSX as i,interopDefault as f,GLOB_MARKDOWN_CODE as l,antfu as p}from"@antfu/eslint-config";import{deepmerge as o}from"deepmerge-ts";import r from"globals";import c from"eslint-plugin-prettier/recommended";const u="XenoPOMP",n=u.toLowerCase();async function m(){return[{files:[a,i],name:`${n}:react`,rules:{"react-refresh/only-export-components":"off","react/no-clone-element":"off","react/no-missing-component-display-name":"off"}}]}async function d(){const e=await f(import("@next/eslint-plugin-next"));return[{name:`${n}:next`,plugins:{"@next/next":e},rules:{"@next/next/google-font-display":"warn","@next/next/google-font-preconnect":"warn","@next/next/next-script-for-ga":"warn","@next/next/no-async-client-component":"warn","@next/next/no-before-interactive-script-outside-document":"warn","@next/next/no-css-tags":"warn","@next/next/no-head-element":"warn","@next/next/no-html-link-for-pages":"warn","@next/next/no-img-element":"warn","@next/next/no-page-custom-font":"warn","@next/next/no-styled-jsx-in-document":"warn","@next/next/no-sync-scripts":"warn","@next/next/no-title-in-document-head":"warn","@next/next/no-typos":"warn","@next/next/no-unwanted-polyfillio":"warn","@next/next/inline-script-id":"error","@next/next/no-assign-module-variable":"error","@next/next/no-document-import-in-page":"error","@next/next/no-duplicate-head":"error","@next/next/no-head-import-in-document":"error","@next/next/no-script-component-in-head":"error"}}]}async function x(){return[{name:`${n}:markdown`,files:[l],rules:{"import/no-unresolved":"off","unused-imports/no-unused-imports":"off","unused-imports/no-unused-vars":"off","no-alert":"off","no-console":"off","no-restricted-imports":"off","no-undef":"off","no-unused-expressions":"off","no-unused-vars":"off","antfu/no-cjs-exports":"off","antfu/no-ts-export-equal":"off","ts/no-redeclare":"off","ts/no-unused-vars":"off","ts/no-var-requires":"off","ts/consistent-type-imports":"off"}}]}async function y(){return[{name:`${n}:all`,rules:{"antfu/no-cjs-exports":"off","import/prefer-default-export":"off","import/extensions":"off","no-restricted-globals":"off","node/prefer-global/process":"off","jsonc/comma-dangle":"off","style/jsx-quotes":["error","prefer-double"],"style/jsx-one-expression-per-line":["error",{allow:"single-line"}],"style/arrow-parens":["error","as-needed"],"unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["warn",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_"}],"@stylistic/indent":["error",2,{ArrayExpression:1,CallExpression:{arguments:1},flatTernaryExpressions:!1,FunctionDeclaration:{body:1,parameters:1},FunctionExpression:{body:1,parameters:1},ignoreComments:!1,ignoredNodes:["TemplateLiteral *","TSIntersectionType","TSTypeParameterInstantiation","FunctionExpression > .params[decorators.length > 0]","FunctionExpression > .params > :matches(Decorator, :not(:first-child))","ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"],ImportDeclaration:1,MemberExpression:1,ObjectExpression:1,offsetTernaryExpressions:!0,outerIIFEBody:1,SwitchCase:1,VariableDeclarator:1}]}}]}async function g(){return[{name:`${n}:old_config`,languageOptions:{globals:{...r.browser,...r.jquery,...r.node,document:"readonly",navigator:"readonly",window:"readonly"}},ignores:["**/.next/*","**/node_modules/*","**/.github/*","cypress","**/__tests__/e2e/*","*.json","**/*.d.ts",".eslintrc.js","eslint.config.js",".prettierrc",".stylelintrc.js","tsconfig.json","package.json","*.md","*.config.ts","*.config.js","*.md"]},{name:`${n}:rules_breakup_1`,rules:{"@next/next/no-duplicate-head":"off"}},{name:`${n}:rules_breakup_2`,rules:{"style/operator-linebreak":"off","test/consistent-test-it":"off","test/prefer-lowercase-title":"off","style/jsx-quotes":"off","style/multiline-ternary":"off","style/indent":"off"},ignores:["cypress"]},{name:`${n}:prettier`,rules:{"antfu/if-newline":"off"}}]}async function w(){return[c]}function h(e,...s){const t=[];return e={...e,react:o(!0,e?.react),vue:o(!1,e?.vue),jsonc:o(!1,e?.jsonc),yaml:o(!1,e?.yaml),stylistic:o({semi:!0,quotes:"single"},e?.stylistic),typescript:o({overrides:{"ts/consistent-type-definitions":["error","interface"],"ts/interface-name-prefix":"off","ts/explicit-function-return-type":"off","ts/explicit-module-boundary-types":"off","ts/no-explicit-any":"off"}},e?.typescript),rules:o({"import/order":"off","react/react-in-jsx-scope":"off","react/prop-types":"off","antfu/top-level-function":"off","perfectionist/sort-imports":"off","perfectionist/sort-named-imports":"off","perfectionist/sort-named-exports":"off","antfu/consistent-chaining":"off","perfectionist/sort-exports":"off","style/no-multiple-empty-lines":"off"},e?.rules)},(e.react??!0)&&t.push(m()),(e.all??!0)&&t.push(y()),(e.next??!1)&&t.push(d()),(e.markdown??!0)&&t.push(x()),t.push(g()),t.push(w()),p(e,...t,...s)}export{h as default};
|
package/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ElementType, ComponentProps, FC, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
2
|
-
export { D as Defined } from './shared/xenopomp-essentials.BFV6RP1V.mjs';
|
|
3
2
|
import { Jsonifiable } from 'type-fest';
|
|
4
3
|
import * as transliteration from 'transliteration';
|
|
5
4
|
|
|
@@ -233,6 +232,12 @@ type DeepInject<T, I extends AnyObject> = T extends object ? {
|
|
|
233
232
|
[K in keyof T]: T[K] extends object ? T[K] & I & DeepInject<T[K], I> : T[K];
|
|
234
233
|
} & I : T;
|
|
235
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Removes undefined from union type.
|
|
237
|
+
* @since 0.0.1
|
|
238
|
+
*/
|
|
239
|
+
type Defined<T> = Exclude<T, undefined>;
|
|
240
|
+
|
|
236
241
|
/**
|
|
237
242
|
* Return never if type does not match JSON schema.
|
|
238
243
|
*
|
|
@@ -561,4 +566,4 @@ declare const minmax: (num: number, [min, max]: [min: number | undefined, max: n
|
|
|
561
566
|
*/
|
|
562
567
|
declare function jsxDotNotation<Props = EmptyObject, Rest extends Record<string, FC<AnyObject>> = EmptyObject>(comp: FC<Props>, rest: Rest): FC<Props> & Rest;
|
|
563
568
|
|
|
564
|
-
export { type AnyFC, type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DeepInject, type DeepWriteable, type EmptyObject, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type Preid, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type VersionData, type WeakOmit, type Writeable, capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
|
|
569
|
+
export { type AnyFC, type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DeepInject, type DeepWriteable, type Defined, type EmptyObject, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type Preid, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type VersionData, type WeakOmit, type Writeable, capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ElementType, ComponentProps, FC, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
2
|
-
export { D as Defined } from './shared/xenopomp-essentials.BFV6RP1V.js';
|
|
3
2
|
import { Jsonifiable } from 'type-fest';
|
|
4
3
|
import * as transliteration from 'transliteration';
|
|
5
4
|
|
|
@@ -233,6 +232,12 @@ type DeepInject<T, I extends AnyObject> = T extends object ? {
|
|
|
233
232
|
[K in keyof T]: T[K] extends object ? T[K] & I & DeepInject<T[K], I> : T[K];
|
|
234
233
|
} & I : T;
|
|
235
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Removes undefined from union type.
|
|
237
|
+
* @since 0.0.1
|
|
238
|
+
*/
|
|
239
|
+
type Defined<T> = Exclude<T, undefined>;
|
|
240
|
+
|
|
236
241
|
/**
|
|
237
242
|
* Return never if type does not match JSON schema.
|
|
238
243
|
*
|
|
@@ -561,4 +566,4 @@ declare const minmax: (num: number, [min, max]: [min: number | undefined, max: n
|
|
|
561
566
|
*/
|
|
562
567
|
declare function jsxDotNotation<Props = EmptyObject, Rest extends Record<string, FC<AnyObject>> = EmptyObject>(comp: FC<Props>, rest: Rest): FC<Props> & Rest;
|
|
563
568
|
|
|
564
|
-
export { type AnyFC, type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DeepInject, type DeepWriteable, type EmptyObject, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type Preid, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type VersionData, type WeakOmit, type Writeable, capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
|
|
569
|
+
export { type AnyFC, type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DeepInject, type DeepWriteable, type Defined, type EmptyObject, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type Preid, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type VersionData, type WeakOmit, type Writeable, capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xenopomp-essentials",
|
|
3
|
-
"version": "0.1.3-rc.
|
|
3
|
+
"version": "0.1.3-rc.5",
|
|
4
4
|
"author": "XenoPOMP <101574433+XenoPOMP@users.noreply.github.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@types/react": ">=19",
|
|
31
31
|
"eslint": "^9",
|
|
32
|
+
"eslint-config-prettier": ">=10.1.1",
|
|
33
|
+
"eslint-plugin-prettier": ">=5.2.3",
|
|
32
34
|
"next": ">=15",
|
|
33
35
|
"react": ">=19",
|
|
34
36
|
"type-fest": ">=4",
|
|
@@ -36,11 +38,13 @@
|
|
|
36
38
|
"zod": "*"
|
|
37
39
|
},
|
|
38
40
|
"dependencies": {
|
|
39
|
-
"@
|
|
41
|
+
"@antfu/eslint-config": "^4.10.1",
|
|
42
|
+
"@next/eslint-plugin-next": "^15.2.3",
|
|
40
43
|
"@types/react": "^19.0.8",
|
|
41
44
|
"deepmerge-ts": "^7.1.5",
|
|
42
45
|
"eslint": "^9.22.0",
|
|
43
|
-
"eslint-
|
|
46
|
+
"eslint-config-prettier": "^10.1.1",
|
|
47
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
44
48
|
"globals": "^16.0.0",
|
|
45
49
|
"next": "^15.1.6",
|
|
46
50
|
"react": "^19.0.0",
|
|
@@ -50,11 +54,14 @@
|
|
|
50
54
|
"zod": "^3.24.1"
|
|
51
55
|
},
|
|
52
56
|
"devDependencies": {
|
|
57
|
+
"@eslint-react/eslint-plugin": "^1.36.1",
|
|
53
58
|
"@testing-library/dom": "^10.4.0",
|
|
54
59
|
"@testing-library/react": "^16.2.0",
|
|
55
60
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|
|
56
61
|
"@vitejs/plugin-react": "^4.3.4",
|
|
57
62
|
"@vitest/coverage-istanbul": "^3.0.4",
|
|
63
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
64
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
58
65
|
"esno": "^4.8.0",
|
|
59
66
|
"husky": "^9.1.7",
|
|
60
67
|
"hygen": "^6.2.11",
|