Skip to content

Commit

Permalink
Add explanatory comments to ESLint rules in .eslintrc.json
Browse files Browse the repository at this point in the history
I added comments to explain what some of the main ESLint rules do. This should make it easier for others to understand the setup and keep things consistent.
  • Loading branch information
AzeemSup authored Oct 31, 2024
1 parent 5bb520e commit c361baa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@
],
"env": { "node": true },
"rules": {
// Ensures array methods like .map() and .forEach() have return statements
"array-callback-return": [
2,
{
"allowImplicit": true
}
],
// Disallows `if` statements as the only statement in an `else` block
"no-lonely-if": 2,
"no-proto": 2,
"eqeqeq": [2, "smart"],
"no-caller": 2,
// Encourages dot notation instead of brackets for property access
"dot-notation": 2,
"no-var": 2,
"prefer-const": 2,
Expand All @@ -28,10 +31,13 @@
"prefer-template": 2,
"one-var": [2, "never"],
"prefer-destructuring": [2, { "object": true }],
// Ensures comments start with a capital letter
"capitalized-comments": 2,
// Enforces a consistent style for multiline comments
"multiline-comment-style": [2, "starred-block"],
"spaced-comment": 2,
"yoda": [2, "never"],
// Requires curly braces for multi-line control statements
"curly": [2, "multi-line"],

"no-else-return": [
Expand Down

0 comments on commit c361baa

Please sign in to comment.