@eslint-react/shared 1.26.0-beta.3 → 1.26.0-beta.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 +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +16 -0
- package/dist/index.mjs +15 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -52,6 +52,9 @@ declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallb
|
|
|
52
52
|
*/
|
|
53
53
|
declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
|
|
54
54
|
|
|
55
|
+
declare function isInEditorEnv(): boolean;
|
|
56
|
+
declare function isInGitHooksOrLintStaged(): boolean;
|
|
57
|
+
|
|
55
58
|
declare const getId: () => string;
|
|
56
59
|
|
|
57
60
|
declare function getReactVersion(fallback?: string): string;
|
|
@@ -2301,4 +2304,4 @@ type RuleNamespace = "x" | "dom" | "web-api" | "hooks-extra" | "naming-conventio
|
|
|
2301
2304
|
*/
|
|
2302
2305
|
type RuleFeature = "CFG" | "CHK" | "DBG" | "FIX" | "MOD" | "TSC";
|
|
2303
2306
|
|
|
2304
|
-
export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RuleNamespace, type RuleOptions, type RulePreset, type RuleSeverity, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, toNormalizedSettings, unsafeDecodeSettings };
|
|
2307
|
+
export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RuleNamespace, type RuleOptions, type RulePreset, type RuleSeverity, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged, toNormalizedSettings, unsafeDecodeSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,9 @@ declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallb
|
|
|
52
52
|
*/
|
|
53
53
|
declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
|
|
54
54
|
|
|
55
|
+
declare function isInEditorEnv(): boolean;
|
|
56
|
+
declare function isInGitHooksOrLintStaged(): boolean;
|
|
57
|
+
|
|
55
58
|
declare const getId: () => string;
|
|
56
59
|
|
|
57
60
|
declare function getReactVersion(fallback?: string): string;
|
|
@@ -2301,4 +2304,4 @@ type RuleNamespace = "x" | "dom" | "web-api" | "hooks-extra" | "naming-conventio
|
|
|
2301
2304
|
*/
|
|
2302
2305
|
type RuleFeature = "CFG" | "CHK" | "DBG" | "FIX" | "MOD" | "TSC";
|
|
2303
2306
|
|
|
2304
|
-
export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RuleNamespace, type RuleOptions, type RulePreset, type RuleSeverity, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, toNormalizedSettings, unsafeDecodeSettings };
|
|
2307
|
+
export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RuleNamespace, type RuleOptions, type RulePreset, type RuleSeverity, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged, toNormalizedSettings, unsafeDecodeSettings };
|
package/dist/index.js
CHANGED
|
@@ -222,6 +222,20 @@ var getDocsUrl = (pluginName) => (ruleName) => {
|
|
|
222
222
|
};
|
|
223
223
|
var createRuleForPlugin = (pluginName) => utils.ESLintUtils.RuleCreator(getDocsUrl(pluginName));
|
|
224
224
|
|
|
225
|
+
// src/env.ts
|
|
226
|
+
function isInEditorEnv() {
|
|
227
|
+
if (process.env["CI"]) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
if (isInGitHooksOrLintStaged()) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
return !!(process.env["VSCODE_PID"] || process.env["VSCODE_CWD"] || process.env["JETBRAINS_IDE"] || process.env["VIM"] || process.env["NVIM"]);
|
|
234
|
+
}
|
|
235
|
+
function isInGitHooksOrLintStaged() {
|
|
236
|
+
return !!(process.env["GIT_PARAMS"] || process.env["VSCODE_GIT_COMMAND"] || process.env["npm_lifecycle_script"]?.startsWith("lint-staged"));
|
|
237
|
+
}
|
|
238
|
+
|
|
225
239
|
// src/get-id.ts
|
|
226
240
|
var id = 0n;
|
|
227
241
|
var getId = () => (id++).toString();
|
|
@@ -1477,5 +1491,7 @@ exports.defineSettings = defineSettings;
|
|
|
1477
1491
|
exports.getId = getId;
|
|
1478
1492
|
exports.getReactVersion = getReactVersion;
|
|
1479
1493
|
exports.getSettingsFromContext = getSettingsFromContext;
|
|
1494
|
+
exports.isInEditorEnv = isInEditorEnv;
|
|
1495
|
+
exports.isInGitHooksOrLintStaged = isInGitHooksOrLintStaged;
|
|
1480
1496
|
exports.toNormalizedSettings = toNormalizedSettings;
|
|
1481
1497
|
exports.unsafeDecodeSettings = unsafeDecodeSettings;
|
package/dist/index.mjs
CHANGED
|
@@ -214,6 +214,20 @@ var getDocsUrl = (pluginName) => (ruleName) => {
|
|
|
214
214
|
};
|
|
215
215
|
var createRuleForPlugin = (pluginName) => ESLintUtils.RuleCreator(getDocsUrl(pluginName));
|
|
216
216
|
|
|
217
|
+
// src/env.ts
|
|
218
|
+
function isInEditorEnv() {
|
|
219
|
+
if (process.env["CI"]) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
if (isInGitHooksOrLintStaged()) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
return !!(process.env["VSCODE_PID"] || process.env["VSCODE_CWD"] || process.env["JETBRAINS_IDE"] || process.env["VIM"] || process.env["NVIM"]);
|
|
226
|
+
}
|
|
227
|
+
function isInGitHooksOrLintStaged() {
|
|
228
|
+
return !!(process.env["GIT_PARAMS"] || process.env["VSCODE_GIT_COMMAND"] || process.env["npm_lifecycle_script"]?.startsWith("lint-staged"));
|
|
229
|
+
}
|
|
230
|
+
|
|
217
231
|
// src/get-id.ts
|
|
218
232
|
var id = 0n;
|
|
219
233
|
var getId = () => (id++).toString();
|
|
@@ -1445,4 +1459,4 @@ function getSettingsFromContext(context) {
|
|
|
1445
1459
|
}
|
|
1446
1460
|
var defineSettings = identity;
|
|
1447
1461
|
|
|
1448
|
-
export { CustomComponentPropSchema, CustomComponentSchema, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, toNormalizedSettings, unsafeDecodeSettings };
|
|
1462
|
+
export { CustomComponentPropSchema, CustomComponentSchema, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged, toNormalizedSettings, unsafeDecodeSettings };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "1.26.0-beta.
|
|
3
|
+
"version": "1.26.0-beta.5",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@typescript-eslint/utils": "^8.22.0",
|
|
37
37
|
"picomatch": "^4.0.2",
|
|
38
38
|
"ts-pattern": "^5.6.2",
|
|
39
|
-
"@eslint-react/eff": "1.26.0-beta.
|
|
39
|
+
"@eslint-react/eff": "1.26.0-beta.5"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/picomatch": "^3.0.2",
|