Skip to content

Commit

Permalink
feat: Add ESLint rule for stricter code formatting and readability
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhanshuku01 committed Apr 12, 2024
1 parent 5aa35ce commit fe3c71a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,23 @@ module.exports = {
files: ['*.js', '*.cjs', '*.mjs'],
extends: [
'standard'
]
],
rules: {
indent: ['error', 2, { SwitchCase: 1 }],
semi: ['error', 'always'],
quotes: ['error', 'single', { avoidEscape: true }],
'comma-spacing': 'error',
'object-curly-spacing': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'no-console': 'error',
'no-unused-vars': ['error', { args: 'after-used', ignoreRestSiblings: true }],
'no-empty-function': 'error',
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'keyword-spacing': 'error',
'spaced-comment': ['error', 'always'],
'no-else-return': 'error'
}

},
{
files: ['*.test.js'],
Expand Down Expand Up @@ -52,4 +68,4 @@ module.exports = {
}
}
]
}
};

0 comments on commit fe3c71a

Please sign in to comment.