eslint-plugin-function 0.0.0 → 0.0.1
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 +20 -0
- package/dist/index.js +82 -1
- package/package.json +13 -2
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
|
+
|
|
3
|
+
type Options = [
|
|
4
|
+
undefined | {
|
|
5
|
+
pattern: string;
|
|
6
|
+
}
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
declare const _default: {
|
|
10
|
+
readonly meta: {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly version: string;
|
|
13
|
+
};
|
|
14
|
+
readonly rules: {
|
|
15
|
+
readonly "function-definition": _typescript_eslint_utils_ts_eslint.RuleModule<"functionDefinition", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
16
|
+
readonly "function-return-boolean": _typescript_eslint_utils_ts_eslint.RuleModule<"functionReturnBoolean", Options, unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { _default as default };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,83 @@
|
|
|
1
|
-
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
2
|
|
|
3
|
+
// package.json
|
|
4
|
+
var name = "eslint-plugin-function";
|
|
5
|
+
var version = "0.0.0";
|
|
6
|
+
function getDocsUrl() {
|
|
7
|
+
return "TODO: add docs for local ESLint rules";
|
|
8
|
+
}
|
|
9
|
+
var createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
10
|
+
|
|
11
|
+
// src/rules/function-definition.ts
|
|
12
|
+
var RULE_NAME = "function-definition";
|
|
13
|
+
var RULE_FEATURES = [];
|
|
14
|
+
var function_definition_default = createRule({
|
|
15
|
+
meta: {
|
|
16
|
+
type: "problem",
|
|
17
|
+
docs: {
|
|
18
|
+
description: "Enforce a consistent function definition style.",
|
|
19
|
+
[Symbol.for("rule_features")]: RULE_FEATURES
|
|
20
|
+
},
|
|
21
|
+
messages: {
|
|
22
|
+
functionDefinition: ""
|
|
23
|
+
},
|
|
24
|
+
schema: []
|
|
25
|
+
},
|
|
26
|
+
name: RULE_NAME,
|
|
27
|
+
create,
|
|
28
|
+
defaultOptions: []
|
|
29
|
+
});
|
|
30
|
+
function create(context) {
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/rules/function-return-boolean.ts
|
|
35
|
+
var RULE_NAME2 = "function-return-boolean";
|
|
36
|
+
var RULE_FEATURES2 = [];
|
|
37
|
+
var defaultOptions = [
|
|
38
|
+
{
|
|
39
|
+
pattern: "is[A-Z].*"
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
var function_return_boolean_default = createRule({
|
|
43
|
+
meta: {
|
|
44
|
+
type: "problem",
|
|
45
|
+
docs: {
|
|
46
|
+
description: "Enforce functions that match the pattern `is[A-Z].*` return a boolean.",
|
|
47
|
+
[Symbol.for("rule_features")]: RULE_FEATURES2
|
|
48
|
+
},
|
|
49
|
+
messages: {
|
|
50
|
+
functionReturnBoolean: "This function should return a boolean."
|
|
51
|
+
},
|
|
52
|
+
schema: [{
|
|
53
|
+
type: "object",
|
|
54
|
+
properties: {
|
|
55
|
+
pattern: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "The pattern to match function names against."
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
additionalProperties: false
|
|
61
|
+
}]
|
|
62
|
+
},
|
|
63
|
+
name: RULE_NAME2,
|
|
64
|
+
create: create2,
|
|
65
|
+
defaultOptions
|
|
66
|
+
});
|
|
67
|
+
function create2(context) {
|
|
68
|
+
return {};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// src/index.ts
|
|
72
|
+
var index_default = {
|
|
73
|
+
meta: {
|
|
74
|
+
name,
|
|
75
|
+
version
|
|
76
|
+
},
|
|
77
|
+
rules: {
|
|
78
|
+
"function-definition": function_definition_default,
|
|
79
|
+
"function-return-boolean": function_return_boolean_default
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export { index_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-function",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "ESLint plugin for function",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -14,8 +14,19 @@
|
|
|
14
14
|
"dist",
|
|
15
15
|
"package.json"
|
|
16
16
|
],
|
|
17
|
-
"dependencies": {
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@eslint-react/ast": "^1.38.0",
|
|
19
|
+
"@eslint-react/kit": "^1.38.0",
|
|
20
|
+
"@typescript-eslint/scope-manager": "^8.28.0",
|
|
21
|
+
"@typescript-eslint/type-utils": "^8.28.0",
|
|
22
|
+
"@typescript-eslint/types": "^8.28.0",
|
|
23
|
+
"@typescript-eslint/utils": "^8.28.0",
|
|
24
|
+
"string-ts": "^2.2.1",
|
|
25
|
+
"ts-pattern": "^5.6.2"
|
|
26
|
+
},
|
|
18
27
|
"devDependencies": {
|
|
28
|
+
"@tsconfig/node22": "^22.0.1",
|
|
29
|
+
"@tsconfig/strictest": "^2.0.5",
|
|
19
30
|
"tsup": "^8.4.0"
|
|
20
31
|
},
|
|
21
32
|
"peerDependencies": {
|