Skip to content

Commit

Permalink
Merge pull request #1948 from jplag/report-viewer/logging-rules
Browse files Browse the repository at this point in the history
Adjust report viewer logging rules
  • Loading branch information
tsaglam authored Aug 29, 2024
2 parents d808ecd + 25a1d71 commit 9b3094d
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion report-viewer/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
},
plugins: ['@typescript-eslint', 'vue'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
'no-restricted-exports': ['error', { restrictDefaultExports: { direct: true } }],
'vue/no-setup-props-reactivity-loss': 'error'
},
Expand Down
2 changes: 1 addition & 1 deletion report-viewer/src/components/ClusterGraph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const hoverableEdges = computed(() => {
const firstIndex = keys.value.indexOf(key)
const secondIndex = keys.value.indexOf(match.matchedWith)
if (firstIndex == -1 || secondIndex == -1) {
console.log(`Could not find index for ${key} or ${match.matchedWith}`)
console.warn(`Could not find index for ${key} or ${match.matchedWith}`)
}
if (firstIndex < secondIndex) {
edges.push({
Expand Down
1 change: 0 additions & 1 deletion report-viewer/src/components/fileDisplaying/CodePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ function collapse() {
}
function expand() {
console.log('expand')
collapsed.value = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,9 @@ const tokenCount = computed(() => {
function scrollTo(file: string, line: number) {
const fileIndex = Array.from(props.files).findIndex((f) => f.fileName === file)
if (fileIndex !== -1) {
console.log(fileIndex)
codePanels.value[fileIndex].expand()
nextTick(() => {
if (!scrollContainer.value) {
console.log('null')
return
}
const childToScrollTo = codePanels.value[fileIndex].getLineRect(line) as DOMRect
Expand Down
2 changes: 1 addition & 1 deletion report-viewer/src/model/factories/ComparisonFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class ComparisonFactory extends BaseFactory {
})
}
} catch (e) {
console.log(e)
console.error(e)
}
}

Expand Down
2 changes: 1 addition & 1 deletion report-viewer/src/model/fileHandling/ZipFileHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FileHandler } from './FileHandler'
*/
export class ZipFileHandler extends FileHandler {
public async handleFile(file: Blob) {
console.log('Start handling zip file and storing necessary data...')
console.info('Start handling zip file and storing necessary data...')
return jszip.loadAsync(file).then(async (zip) => {
for (const originalFileName of Object.keys(zip.files)) {
const unixFileName = slash(originalFileName)
Expand Down
2 changes: 1 addition & 1 deletion report-viewer/src/viewWrapper/InformationViewWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ OverviewFactory.getOverview()
OptionsFactory.getCliOptions()
.then((o) => (cliOptions.value = o))
.catch((error) => console.log('Could not load full options.', error))
.catch((error) => console.error('Could not load full options.', error))
</script>

0 comments on commit 9b3094d

Please sign in to comment.