Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit 2cc615d

Browse files
feat(rule): add max-classes-per-file
1 parent aade9a7 commit 2cc615d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

environments/shared/recommended.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ module.exports = {
6868
// error. Matches: err, Err, error, someErr, someError, any_error, ...
6969
'handle-callback-err': ['error', '^.*(e|E)rr(or)?'],
7070

71+
// Enforce a maximum number of classes per file
72+
// Files containing multiple classes can often result in a less navigable and poorly structured
73+
// codebase. Best practice is to keep each file limited to a single responsibility.
74+
'max-classes-per-file': ['warn', 1],
75+
7176
// Disallow await inside of loops
7277
// Performing an operation on each element of an iterable is a common task. However, performing
7378
// an await as part of each operation is an indication that the program is not taking full

0 commit comments

Comments
 (0)