eslint-plugin-hyper-fetch 7.0.0
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/.eslintrc.json +11 -0
- package/README.md +87 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +15121 -0
- package/dist/index.js.map +7 -0
- package/package.json +66 -0
- package/src/client-generic-types/README.md +21 -0
- package/src/client-generic-types/client-generic-types.ts +81 -0
- package/src/client-generic-types/index.ts +1 -0
- package/src/index.ts +17 -0
- package/src/request-generic-types/README.md +21 -0
- package/src/request-generic-types/index.ts +1 -0
- package/src/request-generic-types/request-generic-types.ts +82 -0
- package/src/utils/generic-utilities.types.ts +81 -0
- package/src/utils/is-hf-declaration.types.ts +58 -0
- package/tsconfig.json +9 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["plugin:@nx/react", "../../.eslintrc.js"],
|
|
3
|
+
"parserOptions": {
|
|
4
|
+
"project": ["./tsconfig.json"]
|
|
5
|
+
},
|
|
6
|
+
"rules": {
|
|
7
|
+
"react/jsx-props-no-spreading": 0,
|
|
8
|
+
"react/require-default-props": 0
|
|
9
|
+
},
|
|
10
|
+
"ignorePatterns": ["dist/", "coverage/", "jest.config.ts", "/*.js"]
|
|
11
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Eslint Plugin Hyper Fetch
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<a href="https://bettertyped.com/">
|
|
5
|
+
<img src="https://custom-icon-badges.demolab.com/static/v1?label=&message=BetterTyped&color=333&logo=BT" />
|
|
6
|
+
</a>
|
|
7
|
+
<a href="https://github.com/BetterTyped/hyper-fetch">
|
|
8
|
+
<img src="https://custom-icon-badges.demolab.com/github/stars/BetterTyped/hyper-fetch?logo=star&color=118ab2" />
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://github.com/BetterTyped/hyper-fetch/blob/main/License.md">
|
|
11
|
+
<img src="https://custom-icon-badges.demolab.com/github/license/BetterTyped/hyper-fetch?logo=law&color=yellow" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@hyper-fetch/react">
|
|
14
|
+
<img src="https://custom-icon-badges.demolab.com/npm/v/@hyper-fetch/react.svg?logo=npm&color=e76f51" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://api.codeclimate.com/v1/badges/eade9435e75ecea0c004/test_coverage">
|
|
17
|
+
<img src="https://api.codeclimate.com/v1/badges/eade9435e75ecea0c004/test_coverage" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/BetterTyped/hyper-fetch">
|
|
20
|
+
<img src="https://custom-icon-badges.demolab.com/badge/typescript-%23007ACC.svg?logo=typescript&logoColor=white" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://www.npmjs.com/package/@hyper-fetch/react">
|
|
23
|
+
<img src="https://custom-icon-badges.demolab.com/bundlephobia/minzip/@hyper-fetch/react?color=64BC4B&logo=package" />
|
|
24
|
+
</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
## About
|
|
28
|
+
|
|
29
|
+
**`Eslint Plugin Hyper Fetch`** is a plugin for eslint rules to add some additional functionality for your code static
|
|
30
|
+
analysis. It allows to find generic types issues like typos, missing values or completely incorrect usage of types.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
Assuming you already have ESLint installed, run:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
#npm
|
|
38
|
+
npm i eslint-plugin-hyper-fetch
|
|
39
|
+
|
|
40
|
+
#yarn
|
|
41
|
+
yarn add -D eslint-plugin-hyper-fetch
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then extend the recommended eslint config:
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
{
|
|
48
|
+
"extends": [
|
|
49
|
+
// ...
|
|
50
|
+
"plugin:hyper-fetch/recommended"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Custom Configuration
|
|
56
|
+
|
|
57
|
+
If you want more fine-grained configuration, you can instead add a snippet like this to your ESLint configuration file:
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
{
|
|
61
|
+
"plugins": [
|
|
62
|
+
// ...
|
|
63
|
+
"hyper-fetch"
|
|
64
|
+
],
|
|
65
|
+
"rules": {
|
|
66
|
+
// ...
|
|
67
|
+
"hyper-fetch/client-generic-types": "error",
|
|
68
|
+
"hyper-fetch/request-generic-types": "error"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Help me keep working on this project ❤️
|
|
74
|
+
|
|
75
|
+
- [Become a Sponsor on GitHub](https://github.com/sponsors/prc5)
|
|
76
|
+
|
|
77
|
+
## Sources
|
|
78
|
+
|
|
79
|
+
- #### [Installation](https://hyperfetch.bettertyped.com/docs/getting-started/installation)
|
|
80
|
+
- #### [Docs](https://hyperfetch.bettertyped.com/docs/react/overview)
|
|
81
|
+
- #### [API](https://hyperfetch.bettertyped.com/api/)
|
|
82
|
+
- #### [NPM](https://www.npmjs.com/package/@hyper-fetch/react)
|
|
83
|
+
- #### [Guides](https://hyperfetch.bettertyped.com/guides/basic/setup)
|
|
84
|
+
|
|
85
|
+
## Other Packages
|
|
86
|
+
|
|
87
|
+
- - #### [Hyper Fetch](https://github.com/BetterTyped/hyper-fetch/tree/main/packages/core)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as _typescript_eslint_utils_dist_ts_eslint from '@typescript-eslint/utils/dist/ts-eslint';
|
|
2
|
+
import * as _typescript_eslint_types_dist_generated_ast_spec from '@typescript-eslint/types/dist/generated/ast-spec';
|
|
3
|
+
|
|
4
|
+
declare const configs: {
|
|
5
|
+
recommended: {
|
|
6
|
+
plugins: string[];
|
|
7
|
+
rules: {
|
|
8
|
+
"hyper-fetch/request-generic-types": string;
|
|
9
|
+
"hyper-fetch/client-generic-types": string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare const rules: {
|
|
14
|
+
"request-generic-types": _typescript_eslint_utils_dist_ts_eslint.RuleModule<"emptyGeneric" | "unexpectedGenerics" | "notMatchingGenerics", [], {
|
|
15
|
+
CallExpression(node: _typescript_eslint_types_dist_generated_ast_spec.CallExpression): void;
|
|
16
|
+
}>;
|
|
17
|
+
"client-generic-types": _typescript_eslint_utils_dist_ts_eslint.RuleModule<"emptyGeneric" | "unexpectedGenerics" | "notMatchingGenerics", [], {
|
|
18
|
+
CallExpression(node: _typescript_eslint_types_dist_generated_ast_spec.CallExpression): void;
|
|
19
|
+
ImportDeclaration: (node: _typescript_eslint_types_dist_generated_ast_spec.ImportDeclaration) => void;
|
|
20
|
+
"Program:exit": () => void;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { configs, rules };
|