Skip to content

Commit

Permalink
fix: remove leftover console.log
Browse files Browse the repository at this point in the history
refactor: add eslint checks for leftover console logs
  • Loading branch information
lightpohl committed Feb 17, 2024
1 parent 4da2a14 commit 3135661
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": ["eslint:recommended", "prettier"]
"extends": ["eslint:recommended", "prettier"],
"rules": {
"no-console": "warn"
}
}
2 changes: 2 additions & 0 deletions bin/logger.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-console */

const ERROR_STATUSES = {
general: 1,
nothingDownloaded: 2,
Expand Down
6 changes: 3 additions & 3 deletions bin/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,12 @@ const logItemsList = ({
});

if (isJson) {
// eslint-disable-next-line no-console
console.log(JSON.stringify(output));
return;
}

// eslint-disable-next-line no-console
console.table(output);
};

Expand Down Expand Up @@ -477,8 +479,6 @@ const getFileFeed = async (filePath, parserConfig) => {
const config = parserConfig ? getJsonFile(parserConfig) : defaultConfig;
const rssString = getFileString(filePath);

console.log(filePath, "rss string", rssString);

if (parserConfig && !config) {
logErrorAndExit(`Unable to load parser config: ${parserConfig}`);
}
Expand All @@ -489,7 +489,7 @@ const getFileFeed = async (filePath, parserConfig) => {
try {
feed = await parser.parseString(rssString);
} catch (err) {
logErrorAndExit("Unable to local RSS file", err);
logErrorAndExit("Unable to parse local RSS file", err);
}

return feed;
Expand Down

0 comments on commit 3135661

Please sign in to comment.