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

eslint最新版本8.57.0中配置eslint.config.js,无法处理json的导入 #487

Closed
3 tasks done
yi-boide opened this issue Apr 26, 2024 · 0 comments
Closed
3 tasks done
Labels
enhancement New feature or request

Comments

@yi-boide
Copy link
Contributor

Clear and concise description of the problem

eslint最新版本8.57.0中配置eslint.config.js,无法处理json的导入,需要更改生成的eslintrc的导出,使其支持导出为js,并且将生成的内容进行默认导出

eslintrc: {
          enabled: true, // Default `false`
          filepath: './.eslintrc-auto-import.json',
          globalsPropValue: true 
        }

Suggested solution

eslintrc: {
          enabled: true, // Default `false`
          filepath: './.eslintrc-auto-import.js',
          globalsPropValue: true
        }

自动判断若是filepath是js结尾的,那么就给他生成默认导出,如下:

export default {
  "globals": {
    "Component": true,
    "ComponentPublicInstance": true,
    }
}

Alternative

No response

Additional context

No response

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants