Skip to content

Commit 0f67cb6

Browse files
Merge pull request #56 from biswalom22/fix/rule-naming
Updated node -> advanced in docusarus
2 parents e72cdb7 + bf291dc commit 0f67cb6

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed
Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Node
1+
# Advanced
22

3-
## Node Plugin Configuration
3+
## Advanced Plugin Configuration
44

5-
To enhance code quality, maintainability, and enforce best practices in your Node projects, the Eslint Plugin Hub provides several Node.js-focused rules. These rules help manage code complexity and promote efficient memory usage patterns critical for server-side applications.
5+
To enhance code quality, maintainability, and enforce best practices in your projects, the Eslint Plugin Hub provides several advanced rules. These rules help manage code complexity and promote efficient memory usage patterns critical for server-side applications.
66

7-
### Node Rules
7+
### Advanced Rules
88

99
| Rule Name | Description |
1010
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
@@ -26,7 +26,7 @@ ESLint v9+ uses `eslint.config.js` (flat config). Older versions use `.eslintrc.
2626

2727
**For Flat Config (e.g., `eslint.config.js`):**
2828

29-
You can extend a pre-defined Node.js configuration from the plugin or configure rules manually.
29+
You can extend a pre-defined advanced configuration from the plugin or configure rules manually.
3030

3131
```javascript
3232
// eslint.config.js
@@ -106,7 +106,7 @@ export default [
106106
];
107107
```
108108

109-
## Node.js Rule Details
109+
## Advanced Rule Details
110110

111111
### 1. minimize-complexflows
112112

@@ -374,9 +374,9 @@ Encourages efficient memory management by discouraging the creation of new commo
374374

375375
Okay, I understand! You want the documentation for avoid-runtime-heap-allocation formatted precisely like the Docusaurus-style Markdown you provided for the minimize-complex-flows rule.
376376

377-
Here's the documentation for node/avoid-runtime-heap-allocation in that format:
377+
Here's the documentation for advanced/avoid-runtime-heap-allocation in that format:
378378

379-
node/avoid-runtime-heap-allocation
379+
advanced/avoid-runtime-heap-allocation
380380
Description:
381381
Encourages efficient memory management by discouraging the creation of new common data structures (arrays [], objects {}, new Map(), new Set(), etc.) directly within function bodies, and especially inside loops. This practice helps to reduce garbage collection pressure and improve performance.
382382

@@ -525,7 +525,7 @@ function processBatchWithLoopCheck(batch) {
525525
`ESLint Warning: Runtime allocation of 'Object' ({ id: batch[i].id }) detected inside a loop within function processBatchWithLoopCheck. This can severely impact performance. Pre-allocate and reuse this structure.`
526526

527527
`Scenario 3: Option allowedConstructs: ['Map']
528-
("hub/node/avoid-runtime-heap-allocation": ["warn", { "allowedConstructs": ["Map"] }])`
528+
("hub/advanced/avoid-runtime-heap-allocation": ["warn", { "allowedConstructs": ["Map"] }])`
529529

530530
Valid (Should NOT produce warnings from this rule for Map):
531531

@@ -584,10 +584,13 @@ export default [
584584
'hub/fixed-loop-bounds': 'error',
585585

586586
// Or, enable with custom options:
587-
'hub/fixed-loop-bounds': ['error', {
588-
disallowInfiniteWhile: true, // Default: true
589-
disallowExternalFlagLoops: false // Example: Allow external flag loops
590-
}],
587+
'hub/fixed-loop-bounds': [
588+
'error',
589+
{
590+
disallowInfiniteWhile: true, // Default: true
591+
disallowExternalFlagLoops: false, // Example: Allow external flag loops
592+
},
593+
],
591594
},
592595
},
593596
];
@@ -707,7 +710,7 @@ You might consider disabling `disallowExternalFlagLoops` if you have loops where
707710
3. **Modern Variable Declarations**: Discourages `var` usage in favor of `let` and `const`
708711

709712
#### configuration
710-
713+
711714
```js
712715
{
713716
rules: {

docs-docusaurus/sidebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const sidebars = {
1010
{
1111
type: 'category',
1212
label: 'Rules',
13-
items: ['general', 'react', 'angular', 'node'],
13+
items: ['general', 'react', 'angular', 'advanced'],
1414
},
1515
{
1616
type: 'category',

0 commit comments

Comments
 (0)