Skip to content

Commit ef2d5a3

Browse files
committed
fix ESLint issues
1 parent 80945b8 commit ef2d5a3

4 files changed

Lines changed: 28 additions & 26 deletions

File tree

Config.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ let MIN_POSTS_TO_UPVOTE = 20,
1616
MAX_POST_AGE_DAYS = 0; // 0 means disabled
1717

1818
let Config = {
19-
minPostToDownvote: function () {
19+
minPostToDownvote() {
2020
return MIN_POSTS_TO_DOWNVOTE;
2121
},
22-
minDaysToDownvote: function () {
22+
minDaysToDownvote() {
2323
return MIN_DAYS_TO_DOWNVOTE;
2424
},
25-
minReputationToDownvote: function () {
25+
minReputationToDownvote() {
2626
return MIN_REPUTATION_TO_DOWNVOTE;
2727
},
28-
minPostToUpvote: function () {
28+
minPostToUpvote() {
2929
return MIN_POSTS_TO_UPVOTE;
3030
},
31-
minDaysToUpvote: function () {
31+
minDaysToUpvote() {
3232
return MIN_DAYS_TO_UPVOTE;
3333
},
34-
maxVotesPerUserInThread: function () {
34+
maxVotesPerUserInThread() {
3535
return MAX_VOTES_PER_USER_AND_THREAD;
3636
},
37-
maxVotesToSameUserInMonth: function () {
37+
maxVotesToSameUserInMonth() {
3838
return MAX_VOTES_TO_SAME_USER_PER_MONTH;
3939
},
40-
maxVotesPerUser: function (reputation) {
40+
maxVotesPerUser(reputation) {
4141
let MIN = 5,
4242
MAX = 50;
4343
let calculatedVotesPerUser = Math.floor(reputation / 10);
@@ -48,56 +48,56 @@ let Config = {
4848
}
4949
return calculatedVotesPerUser;
5050
},
51-
maxDownvotesPerDay: function () {
51+
maxDownvotesPerDay() {
5252
return MAX_DOWNVOTES_PER_DAY;
5353
},
54-
upvoteExtraPercentage: function () {
54+
upvoteExtraPercentage() {
5555
return UPVOTE_EXTRA_PERCENTAGE;
5656
},
57-
downvoteExtraPercentage: function () {
57+
downvoteExtraPercentage() {
5858
return DOWNVOTE_EXTRA_PERCENTAGE;
5959
},
60-
downvotePenalization: function () {
60+
downvotePenalization() {
6161
return DOWNVOTE_PENALIZATION;
6262
},
63-
maxUpvoteWeight: function () {
63+
maxUpvoteWeight() {
6464
return MAX_POINTS_FOR_UPVOTE;
6565
},
66-
maxDownvoteWeight: function () {
66+
maxDownvoteWeight() {
6767
return MAX_POINTS_FOR_DOWNVOTE;
6868
},
69-
getMainLogId: function (voterId, authorId, topicId, postId) {
69+
getMainLogId(voterId, authorId, topicId, postId) {
7070
return REP_LOG_NAMESPACE + ":"
7171
+ voterId + ":"
7272
+ authorId + ":"
7373
+ topicId + ":"
7474
+ postId;
7575
},
76-
getPerThreadLogId: function (voterId, topicId) {
76+
getPerThreadLogId(voterId, topicId) {
7777
return REP_LOG_NAMESPACE + ":user:" + voterId + ":thread:" + topicId;
7878
},
79-
getPerAuthorLogId: function (voterId, authorId) {
79+
getPerAuthorLogId(voterId, authorId) {
8080
let now = new Date();
8181
let month = (now.getMonth() + 1) + "-" + now.getFullYear();
8282
return REP_LOG_NAMESPACE + ":user:" + voterId + ":author:" + authorId + ":month:" + month;
8383
},
84-
getPerUserLogId: function (voterId) {
84+
getPerUserLogId(voterId) {
8585
let now = new Date();
8686
let today = now.getDate() + "-" + (now.getMonth() + 1) + "-" + now.getFullYear();
8787
return REP_LOG_NAMESPACE + ":user:" + voterId + ":day:" + today;
8888
},
89-
getPerUserAndTypeLogId: function (voterId, voteType) {
89+
getPerUserAndTypeLogId(voterId, voteType) {
9090
let now = new Date();
9191
let today = now.getDate() + "-" + (now.getMonth() + 1) + "-" + now.getFullYear();
9292
return REP_LOG_NAMESPACE + ":user:" + voterId + ":day:" + today + ':type:' + voteType;
9393
},
94-
getDisabledCategories: function () {
94+
getDisabledCategories() {
9595
return DISABLED_CATEGORIES_IDS;
9696
},
97-
getMaxPostAgeDays: function() {
97+
getMaxPostAgeDays() {
9898
return MAX_POST_AGE_DAYS;
9999
},
100-
getSettings: function () {
100+
getSettings() {
101101
let settings = {};
102102
settings.minPostsToUpvote = MIN_POSTS_TO_UPVOTE;
103103
settings.minDaysToUpvote = MIN_DAYS_TO_UPVOTE;
@@ -117,7 +117,7 @@ let Config = {
117117
settings.maxPostAgeDays = MAX_POST_AGE_DAYS;
118118
return settings;
119119
},
120-
setSettings: function (settings) {
120+
setSettings(settings) {
121121
MIN_POSTS_TO_UPVOTE = settings.minPostsToUpvote;
122122
MIN_DAYS_TO_UPVOTE = settings.minDaysToUpvote;
123123
MIN_POSTS_TO_DOWNVOTE = settings.minPostsToDownvote;

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
99
![Screenshot](https://raw.githubusercontent.com/exo-do/nodebb-plugin-reputation-rules/master/reputation-rules-acp.png)
1010

11+
## Rules
12+
1113
### Rule #1
1214
**Upvoting** In order to upvote, the user must have
1315
- `{MIN_POSTS_TO_UPVOTE}` posts or more
@@ -57,7 +59,7 @@ Optional: you can limit upvotes and downvotes to recent posts. In other words, i
5759
You can configure what "too old" means for you, for example 30 days, 90 days, or 0 if you want to disable this feature and allow votes in old posts.
5860
**Note** unvotes are always allowed.
5961

60-
### Changelog
62+
## Changelog
6163

6264
v1.2.2
6365

ReputationParams.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ async function recoverParams(voterId, postId) {
2929
}
3030

3131
module.exports = {
32-
recoverParams: recoverParams
32+
recoverParams
3333
};

translator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let languages, texts = null;
88
loadTexts();
99

1010
let translator = {
11-
translate: function (text, language, defaultLanguage) {
11+
translate(text, language, defaultLanguage) {
1212
if (!languageSupported(language)) {
1313
language = defaultLanguage || 'en_GB';
1414
}

0 commit comments

Comments
 (0)