Skip to content

Commit 60399df

Browse files
authored
Merge pull request #566 from topcoder-platform/feature/lint-fixes
refactor: re-enable lint rules and apply fixes
2 parents 266ff0e + d8c6102 commit 60399df

File tree

245 files changed

+8519
-8493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+8519
-8493
lines changed

.eslintrc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@
1010
"rules": {
1111
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js", "src/tests/*.js"]}],
1212
"max-len": ["error", { "ignoreComments": true, "code": 120 }],
13+
"valid-jsdoc": ["error", {
14+
"requireReturn": true,
15+
"requireReturnType": true,
16+
"requireParamDescription": true,
17+
"requireReturnDescription": true
18+
}],
1319
"require-jsdoc": ["error", {
1420
"require": {
1521
"FunctionDeclaration": true,
1622
"MethodDefinition": true,
1723
"ClassDeclaration": true
1824
}
19-
}],
20-
"indent": 0,
21-
"no-multi-spaces": 0,
22-
"valid-jsdoc": 0
25+
}]
2326
}
2427
}

scripts/data/export/index.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,26 @@ logger.info('Script will export data to file:', filePath);
3131
// check if file exists
3232
if (fs.existsSync(filePath)) {
3333
// We delay question for overwrite file, because the question overlaps with a warning message from sequelize module
34-
Promise.delay(1).then(() => {
35-
const rl = readline.createInterface({
36-
input: process.stdin,
37-
output: process.stdout,
34+
Promise.delay(1).then(() => {
35+
const rl = readline.createInterface({
36+
input: process.stdin,
37+
output: process.stdout,
38+
});
39+
// confirm overwritting to file
40+
rl.question(
41+
'File already exists, Are you sure to overwrite it? [Y] to overwrite: ',
42+
(answer) => {
43+
rl.close();
44+
if (answer.toLowerCase() === 'y') {
45+
logger.info('File will be overwritten.');
46+
runExportData(filePath, logger);
47+
} else {
48+
logger.info('Exit without exporting any data');
49+
process.exit(0);
50+
}
51+
},
52+
); // question()
3853
});
39-
// confirm overwritting to file
40-
rl.question(
41-
'File already exists, Are you sure to overwrite it? [Y] to overwrite: ',
42-
(answer) => {
43-
rl.close();
44-
if (answer.toLowerCase() === 'y') {
45-
logger.info('File will be overwritten.');
46-
runExportData(filePath, logger);
47-
} else {
48-
logger.info('Exit without exporting any data');
49-
process.exit(0);
50-
}
51-
},
52-
); // question()
53-
});
5454
} else {
5555
// get base directory of the file
5656
const baseDir = path.resolve(filePath, '..');

scripts/es-db-compare/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async function getProductTimelinesFromES() {
147147
};
148148
return es.search(searchCriteria)
149149
.then((docs) => {
150-
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
150+
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
151151
return rows;
152152
});
153153
}
@@ -161,7 +161,7 @@ async function getProjectsFromES() {
161161
const searchCriteria = getESSearchCriteriaForProject();
162162
const projects = await es.search(searchCriteria)
163163
.then((docs) => {
164-
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
164+
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
165165
return rows;
166166
});
167167
const timelines = await getProductTimelinesFromES();
@@ -188,7 +188,7 @@ async function getMetadataFromES() {
188188
};
189189
return es.search(searchCriteria)
190190
.then((docs) => {
191-
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
191+
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
192192
if (!rows.length) {
193193
return lodash.reduce(
194194
Object.keys(scriptConstants.associations.metadata),

src/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export const CONNECT_NOTIFICATION_EVENT = {
243243
MILESTONE_TRANSITION_ACTIVE: 'connect.notification.project.timeline.milestone.transition.active',
244244
// When milestone is marked as completed
245245
MILESTONE_TRANSITION_COMPLETED: 'connect.notification.project.timeline.milestone.transition.completed',
246-
// When milestone is marked as paused
246+
// When milestone is marked as paused
247247
MILESTONE_TRANSITION_PAUSED: 'connect.notification.project.timeline.milestone.transition.paused',
248248
// When milestone is waiting for customers's input
249249
MILESTONE_WAITING_CUSTOMER: 'connect.notification.project.timeline.milestone.waiting.customer',

0 commit comments

Comments
 (0)