Skip to content
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

Suppress eslint warnings #4953

Merged
merged 3 commits into from
Oct 3, 2022
Merged

Suppress eslint warnings #4953

merged 3 commits into from
Oct 3, 2022

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Oct 3, 2022

Changes

Suppress console.log usage warnings from eslint in integration packages

Testing

N/A. GitHub shouldn't annotate them in the UI anymore.

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Oct 3, 2022

🦋 Changeset detected

Latest commit: 2fb854a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

.eslintrc.cjs Outdated
{
files: ['packages/integrations/**/*.ts'],
rules: {
'no-console': 'off',
Copy link
Member

Choose a reason for hiding this comment

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

Thoughts on making this something like

'no-console': ['error', { allow: ['warn', 'error', 'info'] }],

That way we still catch random console.log or console.table while still allowing deliberate warn, error and info?

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds good. Looks like we're using console.log and console.debug at:

export const info = log('info', console.info);
export const debug = log('debug', console.debug);
export const warn = log('warn', console.warn);
export const error = log('error', console.error);

console.log(
blue(`[MDX] Now inheriting remark and rehype plugins from "markdown" config.`)
);
console.log(
`If you applied a plugin to both your Markdown and MDX configs, we suggest ${bold(
'removing the duplicate MDX entry.'
)}`
);
console.log(`See "extendPlugins" option to configure this behavior.`);

I guess we can have console.debug allowed, and use line comments to suppress the second code as that's a temporary log only until mdx 1.0 (per the comment above the code)

Copy link
Member

@Princesseuh Princesseuh Oct 3, 2022

Choose a reason for hiding this comment

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

In my opinion, even considering that it's going away soon, those MDX console.log should probably all be changed to console.info, but either is fine really!

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll make it console.info then 👍 would be great to get rid of the eslint comments

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Oct 3, 2022
Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

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

Great work 😄

@bluwy bluwy merged commit a597319 into main Oct 3, 2022
@bluwy bluwy deleted the eslint-warnings branch October 3, 2022 15:37
@astrobot-houston astrobot-houston mentioned this pull request Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants