Skip to content

Commit

Permalink
Merge branch 'sds3-cleaned' of https://github.com/fairdataihub/SODA-f…
Browse files Browse the repository at this point in the history
…or-SPARC into sds3-cleaned
  • Loading branch information
aaronm-2112 committed Jan 30, 2025
2 parents cfe186d + a5684a9 commit fb02059
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/renderer/src/scripts/cleanupScripts/linesToRemove.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs');
const fs = require("fs");

// Read the ESLint output file
const eslintOutput = JSON.parse(fs.readFileSync('../formatted-eslint-output.json', 'utf8'));
const eslintOutput = JSON.parse(fs.readFileSync("../formatted-eslint-output.json", "utf8"));

const messages = ["'event' is not defined.", "'path' is not defined.", "'event' is defined but never used.", "'path' is defined but never used.", "Empty block statement."];

Expand All @@ -13,16 +13,16 @@ const unusedEventMessages = eslintOutput.filter(result =>
);

// Extract the lines and columns to remove
const targetLine = unusedEventMessages.flatMap(result =>
const targetLine = unusedEventMessages.flatMap((result) =>
result.messages
.filter(message => message.message === "Empty block statement.")
.map(message => ({
filePath: result.filePath,
line: message.line,
column: message.column,
source: result.source
source: result.source,
}))
);

// Write the lines to remove to a file
fs.writeFileSync('lines-to-remove.json', JSON.stringify(targetLine, null, 2));
fs.writeFileSync("lines-to-remove.json", JSON.stringify(targetLine, null, 2));
7 changes: 3 additions & 4 deletions src/renderer/src/scripts/cleanupScripts/removeUnused.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs');
const linesToRemove = JSON.parse(fs.readFileSync('lines-to-remove.json', 'utf8'));
const fs = require("fs");
const linesToRemove = JSON.parse(fs.readFileSync("lines-to-remove.json", "utf8"));

// Sort linesToRemove in reverse order based on line and column
linesToRemove.sort((a, b) => {
Expand Down Expand Up @@ -27,7 +27,6 @@ module.exports = function(fileInfo, api) {
// Debugging: Log the file path, line, and column being checked
// console.log(`Checking: ${filePath} at line ${line}, column ${column}`);


// remove identifiers matching the line and column from the esLint list of items to remove
// root.find(j.Identifier, { name: 'event' })
// .filter(path => {
Expand Down Expand Up @@ -64,4 +63,4 @@ module.exports = function(fileInfo, api) {

console.log(`Total hits for path: ${hits}`);
return root.toSource();
};
};
12 changes: 0 additions & 12 deletions src/renderer/src/scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -2679,18 +2679,6 @@ const enableProgressButton = () => {
$("#guided-next-button").prop("disabled", false);
};













const hideEleShowEle = (elementIdToHide, elementIdToShow) => {
let elementToHide = document.getElementById(elementIdToHide);
let elementToShow = document.getElementById(elementIdToShow);
Expand Down

0 comments on commit fb02059

Please sign in to comment.