@eslint-react/shared 1.5.25-next.3 → 1.5.25-next.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/dist/index.d.mts +85 -95
- package/dist/index.d.ts +85 -95
- package/dist/index.js +54 -35
- package/dist/index.mjs +34 -34
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
import * as
|
|
3
|
-
import { InferOutput } from 'valibot';
|
|
4
|
-
import { ReadonlyDeep } from 'type-fest';
|
|
2
|
+
import * as S from '@effect/schema/Schema';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* -----------------------------------------------------------------------------
|
|
@@ -38,97 +36,89 @@ declare const HOST_SVG_COMPONENT_TYPES: readonly ["a", "animate", "animateMotion
|
|
|
38
36
|
|
|
39
37
|
declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds>>) => ESLintUtils.RuleModule<MessageIds, Options>;
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
readonly importSource: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
125
|
-
readonly jsxPragma: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
126
|
-
readonly jsxPragmaFrag: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
127
|
-
readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
|
|
128
|
-
readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
129
|
-
}, undefined>, never>;
|
|
130
|
-
}, undefined>;
|
|
131
|
-
type ESLintSettings = ReadonlyDeep<InferOutput<typeof ESLintSettingsSchema>>;
|
|
39
|
+
declare const ESLintReactSettings: S.Struct<{
|
|
40
|
+
additionalHooks: S.optional<S.Struct<{
|
|
41
|
+
use: S.optional<typeof S.String>;
|
|
42
|
+
useCallback: S.optional<S.Array$<typeof S.String>>;
|
|
43
|
+
useContext: S.optional<S.Array$<typeof S.String>>;
|
|
44
|
+
useDebugValue: S.optional<S.Array$<typeof S.String>>;
|
|
45
|
+
useDeferredValue: S.optional<S.Array$<typeof S.String>>;
|
|
46
|
+
useEffect: S.optional<S.Array$<typeof S.String>>;
|
|
47
|
+
useId: S.optional<S.Array$<typeof S.String>>;
|
|
48
|
+
useImperativeHandle: S.optional<S.Array$<typeof S.String>>;
|
|
49
|
+
useInsertionEffect: S.optional<S.Array$<typeof S.String>>;
|
|
50
|
+
useLayoutEffect: S.optional<S.Array$<typeof S.String>>;
|
|
51
|
+
useMemo: S.optional<S.Array$<typeof S.String>>;
|
|
52
|
+
useOptimistic: S.optional<S.Array$<typeof S.String>>;
|
|
53
|
+
useReducer: S.optional<S.Array$<typeof S.String>>;
|
|
54
|
+
useRef: S.optional<S.Array$<typeof S.String>>;
|
|
55
|
+
useState: S.optional<S.Array$<typeof S.String>>;
|
|
56
|
+
useSyncExternalStore: S.optional<S.Array$<typeof S.String>>;
|
|
57
|
+
useTransition: S.optional<S.Array$<typeof S.String>>;
|
|
58
|
+
}>>;
|
|
59
|
+
importSource: S.optional<typeof S.String>;
|
|
60
|
+
jsxPragma: S.optional<typeof S.String>;
|
|
61
|
+
jsxPragmaFrag: S.optional<typeof S.String>;
|
|
62
|
+
strict: S.optional<typeof S.Boolean>;
|
|
63
|
+
version: S.optional<typeof S.String>;
|
|
64
|
+
}>;
|
|
65
|
+
type ESLintReactSettings = S.Schema.Type<typeof ESLintReactSettings>;
|
|
66
|
+
declare const ESLintSettings: S.Struct<{
|
|
67
|
+
"react-x": S.optional<S.Struct<{
|
|
68
|
+
additionalHooks: S.optional<S.Struct<{
|
|
69
|
+
use: S.optional<typeof S.String>;
|
|
70
|
+
useCallback: S.optional<S.Array$<typeof S.String>>;
|
|
71
|
+
useContext: S.optional<S.Array$<typeof S.String>>;
|
|
72
|
+
useDebugValue: S.optional<S.Array$<typeof S.String>>;
|
|
73
|
+
useDeferredValue: S.optional<S.Array$<typeof S.String>>;
|
|
74
|
+
useEffect: S.optional<S.Array$<typeof S.String>>;
|
|
75
|
+
useId: S.optional<S.Array$<typeof S.String>>;
|
|
76
|
+
useImperativeHandle: S.optional<S.Array$<typeof S.String>>;
|
|
77
|
+
useInsertionEffect: S.optional<S.Array$<typeof S.String>>;
|
|
78
|
+
useLayoutEffect: S.optional<S.Array$<typeof S.String>>;
|
|
79
|
+
useMemo: S.optional<S.Array$<typeof S.String>>;
|
|
80
|
+
useOptimistic: S.optional<S.Array$<typeof S.String>>;
|
|
81
|
+
useReducer: S.optional<S.Array$<typeof S.String>>;
|
|
82
|
+
useRef: S.optional<S.Array$<typeof S.String>>;
|
|
83
|
+
useState: S.optional<S.Array$<typeof S.String>>;
|
|
84
|
+
useSyncExternalStore: S.optional<S.Array$<typeof S.String>>;
|
|
85
|
+
useTransition: S.optional<S.Array$<typeof S.String>>;
|
|
86
|
+
}>>;
|
|
87
|
+
importSource: S.optional<typeof S.String>;
|
|
88
|
+
jsxPragma: S.optional<typeof S.String>;
|
|
89
|
+
jsxPragmaFrag: S.optional<typeof S.String>;
|
|
90
|
+
strict: S.optional<typeof S.Boolean>;
|
|
91
|
+
version: S.optional<typeof S.String>;
|
|
92
|
+
}>>;
|
|
93
|
+
reactOptions: S.optional<S.Struct<{
|
|
94
|
+
additionalHooks: S.optional<S.Struct<{
|
|
95
|
+
use: S.optional<typeof S.String>;
|
|
96
|
+
useCallback: S.optional<S.Array$<typeof S.String>>;
|
|
97
|
+
useContext: S.optional<S.Array$<typeof S.String>>;
|
|
98
|
+
useDebugValue: S.optional<S.Array$<typeof S.String>>;
|
|
99
|
+
useDeferredValue: S.optional<S.Array$<typeof S.String>>;
|
|
100
|
+
useEffect: S.optional<S.Array$<typeof S.String>>;
|
|
101
|
+
useId: S.optional<S.Array$<typeof S.String>>;
|
|
102
|
+
useImperativeHandle: S.optional<S.Array$<typeof S.String>>;
|
|
103
|
+
useInsertionEffect: S.optional<S.Array$<typeof S.String>>;
|
|
104
|
+
useLayoutEffect: S.optional<S.Array$<typeof S.String>>;
|
|
105
|
+
useMemo: S.optional<S.Array$<typeof S.String>>;
|
|
106
|
+
useOptimistic: S.optional<S.Array$<typeof S.String>>;
|
|
107
|
+
useReducer: S.optional<S.Array$<typeof S.String>>;
|
|
108
|
+
useRef: S.optional<S.Array$<typeof S.String>>;
|
|
109
|
+
useState: S.optional<S.Array$<typeof S.String>>;
|
|
110
|
+
useSyncExternalStore: S.optional<S.Array$<typeof S.String>>;
|
|
111
|
+
useTransition: S.optional<S.Array$<typeof S.String>>;
|
|
112
|
+
}>>;
|
|
113
|
+
importSource: S.optional<typeof S.String>;
|
|
114
|
+
jsxPragma: S.optional<typeof S.String>;
|
|
115
|
+
jsxPragmaFrag: S.optional<typeof S.String>;
|
|
116
|
+
strict: S.optional<typeof S.Boolean>;
|
|
117
|
+
version: S.optional<typeof S.String>;
|
|
118
|
+
}>>;
|
|
119
|
+
}>;
|
|
120
|
+
type ESLintSettings = S.Schema.Type<typeof ESLintSettings>;
|
|
121
|
+
|
|
132
122
|
declare function getESLintReactSettings(data: unknown): ESLintReactSettings;
|
|
133
123
|
|
|
134
|
-
export {
|
|
124
|
+
export { ESLintReactSettings, ESLintSettings, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, getESLintReactSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
import * as
|
|
3
|
-
import { InferOutput } from 'valibot';
|
|
4
|
-
import { ReadonlyDeep } from 'type-fest';
|
|
2
|
+
import * as S from '@effect/schema/Schema';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* -----------------------------------------------------------------------------
|
|
@@ -38,97 +36,89 @@ declare const HOST_SVG_COMPONENT_TYPES: readonly ["a", "animate", "animateMotion
|
|
|
38
36
|
|
|
39
37
|
declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds>>) => ESLintUtils.RuleModule<MessageIds, Options>;
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
readonly importSource: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
125
|
-
readonly jsxPragma: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
126
|
-
readonly jsxPragmaFrag: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
127
|
-
readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
|
|
128
|
-
readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
129
|
-
}, undefined>, never>;
|
|
130
|
-
}, undefined>;
|
|
131
|
-
type ESLintSettings = ReadonlyDeep<InferOutput<typeof ESLintSettingsSchema>>;
|
|
39
|
+
declare const ESLintReactSettings: S.Struct<{
|
|
40
|
+
additionalHooks: S.optional<S.Struct<{
|
|
41
|
+
use: S.optional<typeof S.String>;
|
|
42
|
+
useCallback: S.optional<S.Array$<typeof S.String>>;
|
|
43
|
+
useContext: S.optional<S.Array$<typeof S.String>>;
|
|
44
|
+
useDebugValue: S.optional<S.Array$<typeof S.String>>;
|
|
45
|
+
useDeferredValue: S.optional<S.Array$<typeof S.String>>;
|
|
46
|
+
useEffect: S.optional<S.Array$<typeof S.String>>;
|
|
47
|
+
useId: S.optional<S.Array$<typeof S.String>>;
|
|
48
|
+
useImperativeHandle: S.optional<S.Array$<typeof S.String>>;
|
|
49
|
+
useInsertionEffect: S.optional<S.Array$<typeof S.String>>;
|
|
50
|
+
useLayoutEffect: S.optional<S.Array$<typeof S.String>>;
|
|
51
|
+
useMemo: S.optional<S.Array$<typeof S.String>>;
|
|
52
|
+
useOptimistic: S.optional<S.Array$<typeof S.String>>;
|
|
53
|
+
useReducer: S.optional<S.Array$<typeof S.String>>;
|
|
54
|
+
useRef: S.optional<S.Array$<typeof S.String>>;
|
|
55
|
+
useState: S.optional<S.Array$<typeof S.String>>;
|
|
56
|
+
useSyncExternalStore: S.optional<S.Array$<typeof S.String>>;
|
|
57
|
+
useTransition: S.optional<S.Array$<typeof S.String>>;
|
|
58
|
+
}>>;
|
|
59
|
+
importSource: S.optional<typeof S.String>;
|
|
60
|
+
jsxPragma: S.optional<typeof S.String>;
|
|
61
|
+
jsxPragmaFrag: S.optional<typeof S.String>;
|
|
62
|
+
strict: S.optional<typeof S.Boolean>;
|
|
63
|
+
version: S.optional<typeof S.String>;
|
|
64
|
+
}>;
|
|
65
|
+
type ESLintReactSettings = S.Schema.Type<typeof ESLintReactSettings>;
|
|
66
|
+
declare const ESLintSettings: S.Struct<{
|
|
67
|
+
"react-x": S.optional<S.Struct<{
|
|
68
|
+
additionalHooks: S.optional<S.Struct<{
|
|
69
|
+
use: S.optional<typeof S.String>;
|
|
70
|
+
useCallback: S.optional<S.Array$<typeof S.String>>;
|
|
71
|
+
useContext: S.optional<S.Array$<typeof S.String>>;
|
|
72
|
+
useDebugValue: S.optional<S.Array$<typeof S.String>>;
|
|
73
|
+
useDeferredValue: S.optional<S.Array$<typeof S.String>>;
|
|
74
|
+
useEffect: S.optional<S.Array$<typeof S.String>>;
|
|
75
|
+
useId: S.optional<S.Array$<typeof S.String>>;
|
|
76
|
+
useImperativeHandle: S.optional<S.Array$<typeof S.String>>;
|
|
77
|
+
useInsertionEffect: S.optional<S.Array$<typeof S.String>>;
|
|
78
|
+
useLayoutEffect: S.optional<S.Array$<typeof S.String>>;
|
|
79
|
+
useMemo: S.optional<S.Array$<typeof S.String>>;
|
|
80
|
+
useOptimistic: S.optional<S.Array$<typeof S.String>>;
|
|
81
|
+
useReducer: S.optional<S.Array$<typeof S.String>>;
|
|
82
|
+
useRef: S.optional<S.Array$<typeof S.String>>;
|
|
83
|
+
useState: S.optional<S.Array$<typeof S.String>>;
|
|
84
|
+
useSyncExternalStore: S.optional<S.Array$<typeof S.String>>;
|
|
85
|
+
useTransition: S.optional<S.Array$<typeof S.String>>;
|
|
86
|
+
}>>;
|
|
87
|
+
importSource: S.optional<typeof S.String>;
|
|
88
|
+
jsxPragma: S.optional<typeof S.String>;
|
|
89
|
+
jsxPragmaFrag: S.optional<typeof S.String>;
|
|
90
|
+
strict: S.optional<typeof S.Boolean>;
|
|
91
|
+
version: S.optional<typeof S.String>;
|
|
92
|
+
}>>;
|
|
93
|
+
reactOptions: S.optional<S.Struct<{
|
|
94
|
+
additionalHooks: S.optional<S.Struct<{
|
|
95
|
+
use: S.optional<typeof S.String>;
|
|
96
|
+
useCallback: S.optional<S.Array$<typeof S.String>>;
|
|
97
|
+
useContext: S.optional<S.Array$<typeof S.String>>;
|
|
98
|
+
useDebugValue: S.optional<S.Array$<typeof S.String>>;
|
|
99
|
+
useDeferredValue: S.optional<S.Array$<typeof S.String>>;
|
|
100
|
+
useEffect: S.optional<S.Array$<typeof S.String>>;
|
|
101
|
+
useId: S.optional<S.Array$<typeof S.String>>;
|
|
102
|
+
useImperativeHandle: S.optional<S.Array$<typeof S.String>>;
|
|
103
|
+
useInsertionEffect: S.optional<S.Array$<typeof S.String>>;
|
|
104
|
+
useLayoutEffect: S.optional<S.Array$<typeof S.String>>;
|
|
105
|
+
useMemo: S.optional<S.Array$<typeof S.String>>;
|
|
106
|
+
useOptimistic: S.optional<S.Array$<typeof S.String>>;
|
|
107
|
+
useReducer: S.optional<S.Array$<typeof S.String>>;
|
|
108
|
+
useRef: S.optional<S.Array$<typeof S.String>>;
|
|
109
|
+
useState: S.optional<S.Array$<typeof S.String>>;
|
|
110
|
+
useSyncExternalStore: S.optional<S.Array$<typeof S.String>>;
|
|
111
|
+
useTransition: S.optional<S.Array$<typeof S.String>>;
|
|
112
|
+
}>>;
|
|
113
|
+
importSource: S.optional<typeof S.String>;
|
|
114
|
+
jsxPragma: S.optional<typeof S.String>;
|
|
115
|
+
jsxPragmaFrag: S.optional<typeof S.String>;
|
|
116
|
+
strict: S.optional<typeof S.Boolean>;
|
|
117
|
+
version: S.optional<typeof S.String>;
|
|
118
|
+
}>>;
|
|
119
|
+
}>;
|
|
120
|
+
type ESLintSettings = S.Schema.Type<typeof ESLintSettings>;
|
|
121
|
+
|
|
132
122
|
declare function getESLintReactSettings(data: unknown): ESLintReactSettings;
|
|
133
123
|
|
|
134
|
-
export {
|
|
124
|
+
export { ESLintReactSettings, ESLintSettings, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, getESLintReactSettings };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var utils = require('@typescript-eslint/utils');
|
|
4
|
-
var
|
|
4
|
+
var S = require('@effect/schema/Schema');
|
|
5
|
+
|
|
6
|
+
function _interopNamespace(e) {
|
|
7
|
+
if (e && e.__esModule) return e;
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var S__namespace = /*#__PURE__*/_interopNamespace(S);
|
|
5
25
|
|
|
6
26
|
// src/constants.ts
|
|
7
27
|
var NPM_SCOPE = "@eslint-react";
|
|
@@ -189,46 +209,45 @@ var getDocsUrl = (pluginName) => (ruleName) => {
|
|
|
189
209
|
return `${WEBSITE_URL}/docs/rules/${pluginName}-${ruleName}`;
|
|
190
210
|
};
|
|
191
211
|
var createRuleForPlugin = (pluginName) => utils.ESLintUtils.RuleCreator(getDocsUrl(pluginName));
|
|
192
|
-
var
|
|
193
|
-
additionalHooks:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
var ESLintReactSettings = S__namespace.Struct({
|
|
213
|
+
additionalHooks: S__namespace.optional(
|
|
214
|
+
S__namespace.Struct({
|
|
215
|
+
use: S__namespace.optional(S__namespace.String),
|
|
216
|
+
useCallback: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
217
|
+
useContext: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
218
|
+
useDebugValue: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
219
|
+
useDeferredValue: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
220
|
+
useEffect: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
221
|
+
useId: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
222
|
+
useImperativeHandle: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
223
|
+
useInsertionEffect: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
224
|
+
useLayoutEffect: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
225
|
+
useMemo: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
226
|
+
useOptimistic: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
227
|
+
useReducer: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
228
|
+
useRef: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
229
|
+
useState: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
230
|
+
useSyncExternalStore: S__namespace.optional(S__namespace.Array(S__namespace.String)),
|
|
231
|
+
useTransition: S__namespace.optional(S__namespace.Array(S__namespace.String))
|
|
232
|
+
})
|
|
233
|
+
),
|
|
234
|
+
importSource: S__namespace.optional(S__namespace.String),
|
|
235
|
+
jsxPragma: S__namespace.optional(S__namespace.String),
|
|
236
|
+
jsxPragmaFrag: S__namespace.optional(S__namespace.String),
|
|
237
|
+
strict: S__namespace.optional(S__namespace.Boolean),
|
|
238
|
+
version: S__namespace.optional(S__namespace.String)
|
|
217
239
|
});
|
|
218
|
-
var
|
|
219
|
-
"react-x":
|
|
220
|
-
|
|
221
|
-
* @deprecated
|
|
222
|
-
*/
|
|
223
|
-
reactOptions: valibot.optional(ESLintReactSettingsSchema)
|
|
240
|
+
var ESLintSettings = S__namespace.Struct({
|
|
241
|
+
"react-x": S__namespace.optional(ESLintReactSettings),
|
|
242
|
+
reactOptions: S__namespace.optional(ESLintReactSettings)
|
|
224
243
|
});
|
|
225
244
|
function getESLintReactSettings(data) {
|
|
226
|
-
const settings =
|
|
245
|
+
const settings = S.decodeUnknownSync(ESLintSettings)(data);
|
|
227
246
|
return settings["react-x"] ?? settings.reactOptions ?? {};
|
|
228
247
|
}
|
|
229
248
|
|
|
230
|
-
exports.
|
|
231
|
-
exports.
|
|
249
|
+
exports.ESLintReactSettings = ESLintReactSettings;
|
|
250
|
+
exports.ESLintSettings = ESLintSettings;
|
|
232
251
|
exports.GITHUB_URL = GITHUB_URL;
|
|
233
252
|
exports.HOST_HTML_COMPONENT_TYPES = HOST_HTML_COMPONENT_TYPES;
|
|
234
253
|
exports.HOST_SVG_COMPONENT_TYPES = HOST_SVG_COMPONENT_TYPES;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
import
|
|
2
|
+
import * as S from '@effect/schema/Schema';
|
|
3
|
+
import { decodeUnknownSync } from '@effect/schema/Schema';
|
|
3
4
|
|
|
4
5
|
// src/constants.ts
|
|
5
6
|
var NPM_SCOPE = "@eslint-react";
|
|
@@ -187,42 +188,41 @@ var getDocsUrl = (pluginName) => (ruleName) => {
|
|
|
187
188
|
return `${WEBSITE_URL}/docs/rules/${pluginName}-${ruleName}`;
|
|
188
189
|
};
|
|
189
190
|
var createRuleForPlugin = (pluginName) => ESLintUtils.RuleCreator(getDocsUrl(pluginName));
|
|
190
|
-
var
|
|
191
|
-
additionalHooks: optional(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
191
|
+
var ESLintReactSettings = S.Struct({
|
|
192
|
+
additionalHooks: S.optional(
|
|
193
|
+
S.Struct({
|
|
194
|
+
use: S.optional(S.String),
|
|
195
|
+
useCallback: S.optional(S.Array(S.String)),
|
|
196
|
+
useContext: S.optional(S.Array(S.String)),
|
|
197
|
+
useDebugValue: S.optional(S.Array(S.String)),
|
|
198
|
+
useDeferredValue: S.optional(S.Array(S.String)),
|
|
199
|
+
useEffect: S.optional(S.Array(S.String)),
|
|
200
|
+
useId: S.optional(S.Array(S.String)),
|
|
201
|
+
useImperativeHandle: S.optional(S.Array(S.String)),
|
|
202
|
+
useInsertionEffect: S.optional(S.Array(S.String)),
|
|
203
|
+
useLayoutEffect: S.optional(S.Array(S.String)),
|
|
204
|
+
useMemo: S.optional(S.Array(S.String)),
|
|
205
|
+
useOptimistic: S.optional(S.Array(S.String)),
|
|
206
|
+
useReducer: S.optional(S.Array(S.String)),
|
|
207
|
+
useRef: S.optional(S.Array(S.String)),
|
|
208
|
+
useState: S.optional(S.Array(S.String)),
|
|
209
|
+
useSyncExternalStore: S.optional(S.Array(S.String)),
|
|
210
|
+
useTransition: S.optional(S.Array(S.String))
|
|
211
|
+
})
|
|
212
|
+
),
|
|
213
|
+
importSource: S.optional(S.String),
|
|
214
|
+
jsxPragma: S.optional(S.String),
|
|
215
|
+
jsxPragmaFrag: S.optional(S.String),
|
|
216
|
+
strict: S.optional(S.Boolean),
|
|
217
|
+
version: S.optional(S.String)
|
|
215
218
|
});
|
|
216
|
-
var
|
|
217
|
-
"react-x": optional(
|
|
218
|
-
|
|
219
|
-
* @deprecated
|
|
220
|
-
*/
|
|
221
|
-
reactOptions: optional(ESLintReactSettingsSchema)
|
|
219
|
+
var ESLintSettings = S.Struct({
|
|
220
|
+
"react-x": S.optional(ESLintReactSettings),
|
|
221
|
+
reactOptions: S.optional(ESLintReactSettings)
|
|
222
222
|
});
|
|
223
223
|
function getESLintReactSettings(data) {
|
|
224
|
-
const settings =
|
|
224
|
+
const settings = decodeUnknownSync(ESLintSettings)(data);
|
|
225
225
|
return settings["react-x"] ?? settings.reactOptions ?? {};
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
export {
|
|
228
|
+
export { ESLintReactSettings, ESLintSettings, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, getESLintReactSettings };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "1.5.25-next.
|
|
3
|
+
"version": "1.5.25-next.5",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"./package.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
38
|
+
"@effect/schema": "0.68.21",
|
|
39
|
+
"@typescript-eslint/utils": "^7.16.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"effect": "3.5.
|
|
42
|
+
"effect": "3.5.1",
|
|
43
43
|
"tsup": "8.1.0",
|
|
44
44
|
"type-fest": "4.21.0"
|
|
45
45
|
},
|