Skip to content

chore : cat no console es lint rule added to pkgs with minimal/no changes#3054

Open
samika98 wants to merge 3 commits into
developfrom
feature/cat-2856-add-lint-rule-to-disallow-direct-access-to-the-console
Open

chore : cat no console es lint rule added to pkgs with minimal/no changes#3054
samika98 wants to merge 3 commits into
developfrom
feature/cat-2856-add-lint-rule-to-disallow-direct-access-to-the-console

Conversation

@samika98

@samika98 samika98 commented Dec 4, 2023

Copy link
Copy Markdown
Contributor

Description

es-lint rule for no direct access to console added. This will deny direct access to console from the code.
This PR includes packages in js-ceramic codebase that required minimal changes.
PRs for this are broken down into 3 PRS :

  1. PR with minimal code changes - packages where direct console access was minimal. (This PR)
  2. PR for CLI - wip
  3. PR for common, strem-tests, blockchain-utils-linking, logging, indexing - wip

How Has This Been Tested?

Ran npm run lint on the packages where this rule has been added and corrected code that was not following the standard.

PR checklist

Before submitting this PR, please make sure:

  • [ Yes ] I have tagged the relevant reviewers and interested parties
  • [ Not required] I have updated the READMEs of affected packages
  • [ Not required] I have made corresponding changes to the documentation

References:

https://eslint.org/docs/latest/rules/no-console -- es lint rule for denying direct access to console

@linear

linear Bot commented Dec 4, 2023

Copy link
Copy Markdown

@samika98 samika98 changed the title no console es lint rule added to pkgs with minimal/no changes chore : cat no console es lint rule added to pkgs with minimal/no changes Dec 4, 2023
import { DispatchError } from '@polkadot/types/interfaces'
import { ITuple } from '@polkadot/types/types'
import { SubmittableExtrinsic } from '@polkadot/api/promise/types'
import { LoggerProvider } from '@ceramicnetwork/common'

@samika98 samika98 Dec 7, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Change here, in this file

#!/usr/bin/env node

import { IpfsDaemon } from '../ipfs-daemon.js'
import { LoggerProvider } from '@ceramicnetwork/common'

@samika98 samika98 Dec 7, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change here, in this file. Let me know if we want to keep console.log in the http-client library, or changing it with the logger is better

@samika98

samika98 commented Dec 7, 2023

Copy link
Copy Markdown
Contributor Author

Changes are mostly in the eslint file. There are 2 code changes in the PR, they are marked with comments for easier reviewing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant