@eslint-react/eslint 5.30.0-beta.8 → 5.30.0-beta.9
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.ts +0 -10
- package/dist/index.js +1 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -18,16 +18,6 @@ export type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
|
18
18
|
export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
|
|
19
19
|
name: string;
|
|
20
20
|
};
|
|
21
|
-
/**
|
|
22
|
-
* Merge the rule options supplied by the user with the rule's default options.
|
|
23
|
-
*
|
|
24
|
-
* Properties whose value is `null` or `undefined` keep the default value.
|
|
25
|
-
*
|
|
26
|
-
* @param options The rule options supplied by the user.
|
|
27
|
-
* @param defaults The rule's default options.
|
|
28
|
-
* @returns The merged rule options.
|
|
29
|
-
*/
|
|
30
|
-
export declare function complete<O extends object, D extends NoInfer<O>>(options: Partial<O> | null | undefined, defaults: D): O & Omit<D, keyof O>;
|
|
31
21
|
/**
|
|
32
22
|
* Gets the source text of the given node or token.
|
|
33
23
|
* Can be used as `(context, node)` to get the text directly,
|
package/dist/index.js
CHANGED
|
@@ -4,14 +4,6 @@ function getDocsUrl(ruleName) {
|
|
|
4
4
|
return `https://eslint-react.xyz/docs/rules/${ruleName}`;
|
|
5
5
|
}
|
|
6
6
|
const createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
7
|
-
function complete(options, defaults) {
|
|
8
|
-
const result = { ...defaults };
|
|
9
|
-
for (const key in options) {
|
|
10
|
-
const value = options[key];
|
|
11
|
-
if (value != null) Reflect.set(result, key, value);
|
|
12
|
-
}
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
7
|
function getText(context, ...rest) {
|
|
16
8
|
if (rest.length === 1) return context.sourceCode.getText(rest[0]);
|
|
17
9
|
return (node) => context.sourceCode.getText(node);
|
|
@@ -36,4 +28,4 @@ function merge(base, ...rest) {
|
|
|
36
28
|
}
|
|
37
29
|
return base;
|
|
38
30
|
}
|
|
39
|
-
export {
|
|
31
|
+
export { createRule, getConstrainedTypeAtLocation, getText, merge, report };
|