xenopomp-essentials 0.1.3-rc.0 → 0.1.3-rc.3

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.
@@ -0,0 +1 @@
1
+ export * from './ririd';
@@ -0,0 +1,33 @@
1
+ import type { RiridOptions } from '../types';
2
+
3
+ export const defaultRiridOptions: RiridOptions = {
4
+ next: true,
5
+ react: true,
6
+ jsonc: false,
7
+ yaml: false,
8
+ stylistic: {
9
+ semi: true,
10
+ quotes: 'single',
11
+ },
12
+ typescript: {
13
+ overrides: {
14
+ 'ts/consistent-type-definitions': ['error', 'interface'],
15
+ 'ts/interface-name-prefix': 'off',
16
+ 'ts/explicit-function-return-type': 'off',
17
+ 'ts/explicit-module-boundary-types': 'off',
18
+ 'ts/no-explicit-any': 'off',
19
+ },
20
+ },
21
+ rules: {
22
+ 'import/order': 'off',
23
+ 'react/react-in-jsx-scope': 'off',
24
+ 'react/prop-types': 'off',
25
+ 'antfu/top-level-function': 'off',
26
+ 'perfectionist/sort-imports': 'off',
27
+ 'perfectionist/sort-named-imports': 'off',
28
+ 'perfectionist/sort-named-exports': 'off',
29
+ 'antfu/consistent-chaining': 'off',
30
+ 'perfectionist/sort-exports': 'off',
31
+ 'style/no-multiple-empty-lines': 'off',
32
+ },
33
+ };
@@ -0,0 +1,97 @@
1
+ import ririd from '@ririd/eslint-config';
2
+ import { deepmerge } from 'deepmerge-ts';
3
+ import globals from 'globals';
4
+
5
+ import { defaultRiridOptions } from './defaults';
6
+ import type { RiridOptions, RiridReturn, UserConfig } from './types';
7
+
8
+ /**
9
+ * XenoPOMP`s default ESLint config. Uses @ririd/eslint-config
10
+ * under the hood.
11
+ *
12
+ * @param options
13
+ * @param userConfigs
14
+ *
15
+ * @example
16
+ * import { xenopomp } from 'xenopomp-essentials';
17
+ *
18
+ * export default xenopomp(
19
+ * // Setup Ririd options
20
+ * {
21
+ * react: false,
22
+ * },
23
+ *
24
+ * // Setup custom user configs
25
+ * {
26
+ * name: 'Custom config #1',
27
+ * rules: {
28
+ * 'some/rule-name': 'warn',
29
+ * },
30
+ * // ...
31
+ * },
32
+ * // ...
33
+ * );
34
+ */
35
+ export default function xenopomp(
36
+ options?: RiridOptions,
37
+ ...userConfigs: UserConfig[]
38
+ ): RiridReturn {
39
+ return ririd(
40
+ deepmerge(defaultRiridOptions, options),
41
+
42
+ // User configs
43
+ {
44
+ name: 'Old config',
45
+ languageOptions: {
46
+ globals: {
47
+ ...globals.browser,
48
+ ...globals.jquery,
49
+ ...globals.node,
50
+
51
+ // Rewrite globals anyway
52
+ document: 'readonly',
53
+ navigator: 'readonly',
54
+ window: 'readonly',
55
+ },
56
+ },
57
+
58
+ // Ignore patterns
59
+ ignores: [
60
+ '**/.next/*',
61
+ '**/node_modules/*',
62
+ '**/.github/*',
63
+ 'cypress',
64
+ '**/__tests__/e2e/*',
65
+ '*.json',
66
+ '**/*.d.ts',
67
+ '.eslintrc.js',
68
+ 'eslint.config.js',
69
+ '.prettierrc',
70
+ '.stylelintrc.js',
71
+ 'tsconfig.json',
72
+ 'package.json',
73
+ '*.md',
74
+ '*.config.ts',
75
+ '*.config.js',
76
+ '*.md',
77
+ ],
78
+ },
79
+ {
80
+ name: 'Rules breakup #1',
81
+ rules: { '@next/next/no-duplicate-head': 'off' },
82
+ },
83
+ {
84
+ name: 'Rules breakup #2',
85
+ rules: {
86
+ 'style/operator-linebreak': 'off',
87
+ 'test/consistent-test-it': 'off',
88
+ 'test/prefer-lowercase-title': 'off',
89
+ 'style/jsx-quotes': 'off',
90
+ 'style/multiline-ternary': 'off',
91
+ 'style/indent': 'off',
92
+ },
93
+ ignores: ['cypress'],
94
+ },
95
+ ...userConfigs,
96
+ );
97
+ }
@@ -0,0 +1 @@
1
+ export * from './ririd';
@@ -0,0 +1,8 @@
1
+ import type ririd from '@ririd/eslint-config';
2
+
3
+ import type { Defined } from '@/types';
4
+
5
+ export type RiridReturn = ReturnType<typeof ririd>;
6
+ export type RiridParams = Parameters<typeof ririd>;
7
+ export type RiridOptions = Defined<RiridParams[0]>;
8
+ export type UserConfig = Defined<RiridParams[1]>;
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.0",
3
+ "version": "0.1.3-rc.3",
4
4
  "author": "XenoPOMP <101574433+XenoPOMP@users.noreply.github.com>",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,6 +41,7 @@
41
41
  "@types/react": "^19.0.8",
42
42
  "deepmerge-ts": "^7.1.5",
43
43
  "eslint": "^9.22.0",
44
+ "eslint-flat-config-utils": "^2.0.1",
44
45
  "globals": "^16.0.0",
45
46
  "next": "^15.1.6",
46
47
  "react": "^19.0.0",
@@ -1,37 +0,0 @@
1
- import ririd from '@ririd/eslint-config';
2
- import { D as Defined } from '../shared/xenopomp-essentials.BFV6RP1V.mjs';
3
-
4
- type RiridParams = Parameters<typeof ririd>;
5
- type RiridOptions = Defined<RiridParams[0]>;
6
- type UserConfig = Defined<RiridParams[1]>;
7
-
8
- /**
9
- * XenoPOMP`s default ESLint config. Uses @ririd/eslint-config
10
- * under the hood.
11
- *
12
- * @param options
13
- * @param userConfigs
14
- *
15
- * @example
16
- * import { xenopomp } from 'xenopomp-essentials';
17
- *
18
- * export default xenopomp(
19
- * // Setup Ririd options
20
- * {
21
- * react: false,
22
- * },
23
- *
24
- * // Setup custom user configs
25
- * {
26
- * name: 'Custom config #1',
27
- * rules: {
28
- * 'some/rule-name': 'warn',
29
- * },
30
- * // ...
31
- * },
32
- * // ...
33
- * );
34
- */
35
- declare function xenopomp(options?: RiridOptions, ...userConfigs: UserConfig[]): ReturnType<typeof ririd>;
36
-
37
- export { xenopomp as default };
package/eslint/index.d.ts DELETED
@@ -1,37 +0,0 @@
1
- import ririd from '@ririd/eslint-config';
2
- import { D as Defined } from '../shared/xenopomp-essentials.BFV6RP1V.js';
3
-
4
- type RiridParams = Parameters<typeof ririd>;
5
- type RiridOptions = Defined<RiridParams[0]>;
6
- type UserConfig = Defined<RiridParams[1]>;
7
-
8
- /**
9
- * XenoPOMP`s default ESLint config. Uses @ririd/eslint-config
10
- * under the hood.
11
- *
12
- * @param options
13
- * @param userConfigs
14
- *
15
- * @example
16
- * import { xenopomp } from 'xenopomp-essentials';
17
- *
18
- * export default xenopomp(
19
- * // Setup Ririd options
20
- * {
21
- * react: false,
22
- * },
23
- *
24
- * // Setup custom user configs
25
- * {
26
- * name: 'Custom config #1',
27
- * rules: {
28
- * 'some/rule-name': 'warn',
29
- * },
30
- * // ...
31
- * },
32
- * // ...
33
- * );
34
- */
35
- declare function xenopomp(options?: RiridOptions, ...userConfigs: UserConfig[]): ReturnType<typeof ririd>;
36
-
37
- export { xenopomp as default };
package/eslint/index.mjs DELETED
@@ -1 +0,0 @@
1
- import s from"@ririd/eslint-config";import{deepmerge as r}from"deepmerge-ts";import e from"globals";const n={next:!0,react:!0,jsonc:!1,yaml:!1,stylistic:{semi:!0,quotes:"single"},typescript:{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"}},rules:{"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"}};function i(t,...o){return s(r(n,t),{name:"Old config",languageOptions:{globals:{...e.browser,...e.jquery,...e.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:"Rules breakup #1",rules:{"@next/next/no-duplicate-head":"off"}},{name:"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"]},...o)}export{i as default};
@@ -1,7 +0,0 @@
1
- /**
2
- * Removes undefined from union type.
3
- * @since 0.0.1
4
- */
5
- type Defined<T> = Exclude<T, undefined>;
6
-
7
- export type { Defined as D };
@@ -1,7 +0,0 @@
1
- /**
2
- * Removes undefined from union type.
3
- * @since 0.0.1
4
- */
5
- type Defined<T> = Exclude<T, undefined>;
6
-
7
- export type { Defined as D };