eslint-plugin-nextfriday 1.6.0 → 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-nextfriday",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "A comprehensive ESLint plugin providing custom rules and configurations for Next Friday development workflows.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -1,71 +0,0 @@
1
- # no-explicit-return-type
2
-
3
- Disallow explicit return types on functions.
4
-
5
- This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6
-
7
- ## Rule Details
8
-
9
- This rule encourages relying on TypeScript's type inference instead of explicitly annotating function return types. TypeScript is generally very good at inferring return types, and explicit annotations can add unnecessary verbosity to your code.
10
-
11
- **Incorrect** code for this rule:
12
-
13
- ```typescript
14
- function getName(): string {
15
- return "John Doe";
16
- }
17
-
18
- const getAge = (): number => {
19
- return 25;
20
- };
21
-
22
- function processUser(): void {
23
- console.log("Processing user");
24
- }
25
-
26
- const calculateTotal = (items: Item[]): number => {
27
- return items.reduce((sum, item) => sum + item.price, 0);
28
- };
29
- ```
30
-
31
- **Correct** code for this rule:
32
-
33
- ```typescript
34
- function getName() {
35
- return "John Doe"; // TypeScript infers: string
36
- }
37
-
38
- const getAge = () => {
39
- return 25; // TypeScript infers: number
40
- };
41
-
42
- function processUser() {
43
- console.log("Processing user"); // TypeScript infers: void
44
- }
45
-
46
- const calculateTotal = (items: Item[]) => {
47
- return items.reduce((sum, item) => sum + item.price, 0); // TypeScript infers: number
48
- };
49
- ```
50
-
51
- ## Benefits
52
-
53
- - **Cleaner code**: Reduces visual clutter
54
- - **Automatic updates**: When implementation changes, return type updates automatically
55
- - **Trust TypeScript**: Leverages TypeScript's excellent type inference
56
- - **Consistency**: Encourages a consistent style across the codebase
57
-
58
- ## When Not To Use
59
-
60
- - When you want to explicitly document the return type for API functions
61
- - For public library functions where return types serve as documentation
62
- - When the inferred type is too broad and you want to narrow it
63
- - In cases where explicit return types improve error messages
64
-
65
- ## Auto-fixing
66
-
67
- This rule automatically removes explicit return type annotations when run with the `--fix` option.
68
-
69
- ## Related Rules
70
-
71
- - No related rules