eslint-plugin-function-rule 0.0.6 → 0.0.7
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 +5 -17
- package/dist/index.js +5 -5
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { RuleDefinition, RuleVisitor } from "@eslint/core";
|
|
1
|
+
import { Rule } from "eslint";
|
|
3
2
|
|
|
4
3
|
//#region index.d.ts
|
|
5
|
-
declare function
|
|
6
|
-
declare function functionRule(create:
|
|
4
|
+
declare function defineRuleListener(ruleListener: Rule.RuleListener): Rule.RuleListener;
|
|
5
|
+
declare function functionRule(create: Rule.RuleModule["create"]): {
|
|
7
6
|
readonly rules: {
|
|
8
7
|
readonly "function-rule": {
|
|
9
8
|
readonly meta: {
|
|
10
9
|
readonly fixable: "code";
|
|
11
10
|
readonly hasSuggestions: true;
|
|
12
11
|
};
|
|
13
|
-
readonly create: (context:
|
|
14
|
-
LangOptions: _eslint_core0.LanguageOptions;
|
|
15
|
-
Code: _eslint_core0.SourceCode<{
|
|
16
|
-
LangOptions: _eslint_core0.LanguageOptions;
|
|
17
|
-
RootNode: unknown;
|
|
18
|
-
SyntaxElementWithLoc: unknown;
|
|
19
|
-
ConfigNode: unknown;
|
|
20
|
-
}>;
|
|
21
|
-
RuleOptions: unknown[];
|
|
22
|
-
Node: unknown;
|
|
23
|
-
MessageIds: string;
|
|
24
|
-
}>) => RuleVisitor;
|
|
12
|
+
readonly create: (context: Rule.RuleContext) => Rule.RuleListener;
|
|
25
13
|
};
|
|
26
14
|
};
|
|
27
15
|
};
|
|
28
16
|
//#endregion
|
|
29
|
-
export { functionRule as default,
|
|
17
|
+
export { functionRule as default, defineRuleListener };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region index.ts
|
|
2
2
|
const id = 0;
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
for (const key of Object.keys(
|
|
6
|
-
return
|
|
3
|
+
function defineRuleListener(ruleListener) {
|
|
4
|
+
const listener = {};
|
|
5
|
+
for (const key of Object.keys(ruleListener)) listener[key + `[type!=${id}]`] = ruleListener[key];
|
|
6
|
+
return listener;
|
|
7
7
|
}
|
|
8
8
|
function functionRule(create) {
|
|
9
9
|
return { rules: { "function-rule": {
|
|
@@ -16,4 +16,4 @@ function functionRule(create) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
|
-
export { functionRule as default,
|
|
19
|
+
export { functionRule as default, defineRuleListener };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-function-rule",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"package.json"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"string-ts": "^2.2.1",
|
|
19
18
|
"@eslint/core": "^0.17.0"
|
|
20
19
|
},
|
|
21
20
|
"devDependencies": {
|
|
22
21
|
"tsdown": "^0.16.1"
|
|
23
22
|
},
|
|
24
23
|
"peerDependencies": {
|
|
24
|
+
"eslint": "^9.39.1",
|
|
25
25
|
"typescript": "^5"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|