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

feat: Generate ESLint globals file for auto-imports #450

Merged
merged 5 commits into from
Feb 15, 2024

Conversation

aklinker1
Copy link
Collaborator

@aklinker1 aklinker1 commented Feb 15, 2024

This closes #448. A new file, .wxt/eslintrc-auto-import.json is generated when the .wxt/ directory is generated (prepare, dev, build, zip, etc).

If you have ESLint installed already, the JSON file will be generated automatically. You just need to extend it in your ESLint config:

// .eslintrc.js
module.exports = {
  extends: [
    './.wxt/eslintrc-auto-import.json',
  ],
}

If the file isn't being generated (eslint isn't a direct dependency, or you're in a monorepo and it's not a dependency of the package at all), you can enable this file manually:

// wxt.config.ts
export default defineConfig({
  imports: {
    eslintrc: {
      enabled: true
    },
  },
})

@aklinker1 aklinker1 self-assigned this Feb 15, 2024
Copy link

netlify bot commented Feb 15, 2024

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit c3c79de
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/65ce374fb290100008f495a3
😎 Deploy Preview https://deploy-preview-450--creative-fairy-df92c4.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.

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f02aae2) 85.56% compared to head (c3c79de) 85.65%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #450      +/-   ##
==========================================
+ Coverage   85.56%   85.65%   +0.08%     
==========================================
  Files         107      106       -1     
  Lines        7940     8031      +91     
  Branches      767      779      +12     
==========================================
+ Hits         6794     6879      +85     
- Misses       1133     1139       +6     
  Partials       13       13              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aklinker1 aklinker1 changed the title feat: Generate eslint globals file for auto-imports feat: Generate ESLint globals file for auto-imports Feb 15, 2024
@aklinker1 aklinker1 marked this pull request as ready for review February 15, 2024 16:14
@aklinker1 aklinker1 merged commit c681747 into main Feb 15, 2024
17 checks passed
@aklinker1 aklinker1 deleted the generate-eslint-config branch February 15, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add eslintrc configuration for wxt's auto-import to avoid eslint errors
1 participant