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

Add ESLint typescript resolver to fix exports issue #2133

Merged
merged 3 commits into from
Dec 4, 2024
Merged

Conversation

contolini
Copy link
Member

ESLint's import plugin doesn't support package.json exports definitions
out of the box. There's a longstanding issue to fix it but the recommendation
is to use the ESLint typescript resolver that solves the problem. This repo
doesn't use typescript but adding the resolver with zero configuration
fixes things and adds minimal bloat.

Testing

  1. yarn lint should now pass without errors

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the CFPB development guidelines
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 👇)
  • Project documentation has been updated
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist

Browsers

  • Chrome on desktop
  • Firefox
  • Safari on macOS
  • Edge
  • Safari on iOS
  • Chrome on Android

Accessibility

  • Keyboard friendly
  • Screen reader friendly

Other

  • Is useable without CSS
  • Is useable without JS
  • Flexible from small to large screens
  • No linting errors or warnings
  • JavaScript tests are passing

ESLint's import plugin doesn't support package.json `exports` definitions
out of the box. There's a longstanding issue to fix it but the recommendation
is to use the eslint typescript resolver that solves the problem. This repo
doesn't use typescript but adding the resolver with zero configuration
fixes things and adds minimal bloat.

See import-js/eslint-plugin-import#1810
See https://github.com/import-js/eslint-import-resolver-typescript
Copy link

netlify bot commented Dec 4, 2024

Thanks for the improvements! Browse a preview of your changes using the link below.

Name Link
🔨 Latest commit e6a31bb
🔍 Latest deploy log https://app.netlify.com/sites/cfpb-design-system/deploys/6750db52f8488c0008790253
😎 Deploy Preview https://deploy-preview-2133--cfpb-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@contolini contolini merged commit 9d949a6 into main Dec 4, 2024
7 of 8 checks passed
@contolini contolini deleted the lint-exports branch December 4, 2024 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants