eslint-plugin-function 0.0.4 → 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/README.md +45 -0
- package/dist/index.js +1 -1
- package/package.json +2 -3
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# eslint-plugin-function
|
|
2
|
+
|
|
3
|
+
The ESLint plugin for function-related rules.
|
|
4
|
+
|
|
5
|
+
> [!WARNING]
|
|
6
|
+
> This package is a work in progress and is not yet ready for production use.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
# npm
|
|
12
|
+
npm install --save-dev eslint-plugin-function
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Configure ESLint
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
// eslint.config.js
|
|
19
|
+
|
|
20
|
+
// @ts-check
|
|
21
|
+
import eslintJs from "@eslint/js";
|
|
22
|
+
import tseslint from "typescript-eslint";
|
|
23
|
+
import pluginFunction from "eslint-plugin-function";
|
|
24
|
+
|
|
25
|
+
export default tseslint.config({
|
|
26
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
27
|
+
extends: [
|
|
28
|
+
eslintJs.configs.recommended,
|
|
29
|
+
tseslint.configs.recommended,
|
|
30
|
+
],
|
|
31
|
+
plugins: {
|
|
32
|
+
function: pluginFunction,
|
|
33
|
+
},
|
|
34
|
+
languageOptions: {
|
|
35
|
+
parser: tseslint.parser,
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: "./tsconfig.json",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
rules: {
|
|
41
|
+
// Enforce functions matching the given pattern always return a boolean value
|
|
42
|
+
"function/function-return-boolean": ["error", { pattern: "/^(is|has|should)/" }],
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
```
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-function",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "ESLint plugin for function",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"description": "(WIP) The ESLint plugin for function-related rules.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"@typescript-eslint/type-utils": "^8.28.0",
|
|
23
23
|
"@typescript-eslint/types": "^8.28.0",
|
|
24
24
|
"@typescript-eslint/utils": "^8.28.0",
|
|
25
|
-
"string-ts": "^2.2.1",
|
|
26
25
|
"ts-pattern": "^5.6.2"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|