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 eslintrc configuration for wxt's auto-import to avoid eslint errors #448

Closed
chillcicada opened this issue Feb 15, 2024 · 2 comments · Fixed by #450
Closed

Add eslintrc configuration for wxt's auto-import to avoid eslint errors #448

chillcicada opened this issue Feb 15, 2024 · 2 comments · Fixed by #450
Labels

Comments

@chillcicada
Copy link

Feature Request

In the vite + unplugin-auto-import project, i use the eslintrc parameter for AutoImport to generate the corresponding json file for eslint to import and avoid eslint errors. I hope that wxt can introduce related functionality in the future to avoid reinstalling unplugin-auto-import and reconfiguring vite internally in wxt project.

Is your feature request related to a bug?

N/A

What are the alternatives?

Similar to unplugin-auto-import/vite, add the eslintrc configuration under the imports parameter, following the syntax of unplugin-auto-import/vite. This will generate the json file while generating the types. The config code will seem to look like this:

// wxt.config.ts
export default defineConfig({
  imports: {
    ...
    eslintrc: {
      enabled: true,
      filepath: './.eslintrc-auto-import.json',
      globalsPropValue: true,
    },
  },
  ...
})
@aklinker1
Copy link
Collaborator

@aklinker1
Copy link
Collaborator

Released in v0.16.7. See the PR #450 for usage.

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 a pull request may close this issue.

2 participants