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

build(eslint): disabling wildcard imports with eslint #31761

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Jan 9, 2025

SUMMARY

@justinpark adeptly spotted a wildcard input on a PR here. I figured this might be happening elsewhere, so I added a lint rule, and cleaned up the fallout. This should lead to a smaller bundle size, with any luck, or at least better hygiene.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Fix Detected
Functionality Unsafe Date Parsing ▹ view
Readability and Maintainability Avoid ignoring ESLint rule 'no-restricted-syntax'. ▹ view
Functionality Invalid ESLint Disable Comment ▹ view

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Feedback and Support

Comment on lines 22 to 23
/* eslint-ignore-next-line no-restricted-syntax*/
import * as d3array from 'd3-array';

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed

@@ -50,7 +50,7 @@ const getJSONSchema = () => {
jsonSchema.properties[key] = {
...value,
default: value.default
? chrono.parseDate(value.default)?.toISOString()
? parseDate(value.default)?.toISOString()

This comment was marked as resolved.

@rusackas rusackas changed the title build(eslint) disabling wildcard imports with eslint build(eslint): disabling wildcard imports with eslint Jan 9, 2025
@rusackas
Copy link
Member Author

rusackas commented Jan 9, 2025

@jpchev do you mean to see what the rules are? There are various eslint.config.js files in the codebase you can look at.

If you mean you want to run the script to test it, you can check the package.json file for all the npm scripts, but the one you probably want is npm run lint-fix

@rusackas rusackas force-pushed the disable-namespace-imports branch from 23dfabe to 0cc8360 Compare January 9, 2025 20:10
@jpchev
Copy link
Contributor

jpchev commented Jan 9, 2025

@jpchev do you mean to see what the rules are? There are various eslint.config.js files in the codebase you can look at.

If you mean you want to run the script to test it, you can check the package.json file for all the npm scripts, but the one you probably want is npm run lint-fix

yes thank you, anyway
I've seen there is a page about ruff https://superset.apache.org/docs/contributing/howtos#linting

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

3 participants