Skip to content

refactor: re-enable lint rules and apply fixes #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
"rules": {
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js", "src/tests/*.js"]}],
"max-len": ["error", { "ignoreComments": true, "code": 120 }],
"valid-jsdoc": ["error", {
"requireReturn": true,
"requireReturnType": true,
"requireParamDescription": true,
"requireReturnDescription": true
}],
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true
}
}],
"indent": 0,
"no-multi-spaces": 0,
"valid-jsdoc": 0
}]
}
}
38 changes: 19 additions & 19 deletions scripts/data/export/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ logger.info('Script will export data to file:', filePath);
// check if file exists
if (fs.existsSync(filePath)) {
// We delay question for overwrite file, because the question overlaps with a warning message from sequelize module
Promise.delay(1).then(() => {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
Promise.delay(1).then(() => {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
// confirm overwritting to file
rl.question(
'File already exists, Are you sure to overwrite it? [Y] to overwrite: ',
(answer) => {
rl.close();
if (answer.toLowerCase() === 'y') {
logger.info('File will be overwritten.');
runExportData(filePath, logger);
} else {
logger.info('Exit without exporting any data');
process.exit(0);
}
},
); // question()
});
// confirm overwritting to file
rl.question(
'File already exists, Are you sure to overwrite it? [Y] to overwrite: ',
(answer) => {
rl.close();
if (answer.toLowerCase() === 'y') {
logger.info('File will be overwritten.');
runExportData(filePath, logger);
} else {
logger.info('Exit without exporting any data');
process.exit(0);
}
},
); // question()
});
} else {
// get base directory of the file
const baseDir = path.resolve(filePath, '..');
Expand Down
6 changes: 3 additions & 3 deletions scripts/es-db-compare/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async function getProductTimelinesFromES() {
};
return es.search(searchCriteria)
.then((docs) => {
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
return rows;
});
}
Expand All @@ -161,7 +161,7 @@ async function getProjectsFromES() {
const searchCriteria = getESSearchCriteriaForProject();
const projects = await es.search(searchCriteria)
.then((docs) => {
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
return rows;
});
const timelines = await getProductTimelinesFromES();
Expand All @@ -188,7 +188,7 @@ async function getMetadataFromES() {
};
return es.search(searchCriteria)
.then((docs) => {
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
const rows = lodash.map(docs.hits.hits, single => single._source); // eslint-disable-line no-underscore-dangle
if (!rows.length) {
return lodash.reduce(
Object.keys(scriptConstants.associations.metadata),
Expand Down
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export const CONNECT_NOTIFICATION_EVENT = {
MILESTONE_TRANSITION_ACTIVE: 'connect.notification.project.timeline.milestone.transition.active',
// When milestone is marked as completed
MILESTONE_TRANSITION_COMPLETED: 'connect.notification.project.timeline.milestone.transition.completed',
// When milestone is marked as paused
// When milestone is marked as paused
MILESTONE_TRANSITION_PAUSED: 'connect.notification.project.timeline.milestone.transition.paused',
// When milestone is waiting for customers's input
MILESTONE_WAITING_CUSTOMER: 'connect.notification.project.timeline.milestone.waiting.customer',
Expand Down
Loading