NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.65k stars 4.8k forks source link

taro4.0+ 使用 webpack 编译为什么要依赖 eslint? #16891

Open tclxshunquan-wang opened 5 days ago

tclxshunquan-wang commented 5 days ago

相关平台

微信小程序

小程序基础库: 3.6.5 使用框架: React

代码仓库

https://github.com/Agile-Missile/taro-react-starter/tree/main

复现步骤

eslint 版本 "eslint": "9.15.0", "eslint-config-taro": "4.0.7", "eslint-plugin-import": "^2.12.0", "eslint-plugin-react": "^7.8.2", "eslint-plugin-react-hooks": "^4.2.0",

执行dev:weapp,生成的node_modules_taro_weapp_prebundle_tarojs_taro_js.js中,@tarojs_taro.core.js的 path 是有问题的, image

期望结果

正常编译

实际结果

编译错误

环境信息

👽 Taro v4.0.7

  Taro CLI 4.0.7 environment info:
    System:
      OS: macOS 15.0.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.13.1 - /usr/local/node-v20.13.1/bin/node
      Yarn: 4.3.1 - /opt/homebrew/bin/yarn
      npm: 10.5.2 - /usr/local/node-v20.13.1/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.7 => 4.0.7 
      @tarojs/components: 4.0.7 => 4.0.7 
      @tarojs/helper: 4.0.7 => 4.0.7 
      @tarojs/plugin-framework-react: 4.0.7 => 4.0.7 
      @tarojs/plugin-platform-alipay: 4.0.7 => 4.0.7 
      @tarojs/plugin-platform-h5: 4.0.7 => 4.0.7 
      @tarojs/plugin-platform-jd: 4.0.7 => 4.0.7 
      @tarojs/plugin-platform-qq: 4.0.7 => 4.0.7 
      @tarojs/plugin-platform-swan: 4.0.7 => 4.0.7 
      @tarojs/plugin-platform-tt: 4.0.7 => 4.0.7 
      @tarojs/plugin-platform-weapp: 4.0.7 => 4.0.7 
      @tarojs/react: 4.0.7 => 4.0.7 
      @tarojs/runtime: 4.0.7 => 4.0.7 
      @tarojs/shared: 4.0.7 => 4.0.7 
      @tarojs/taro: 4.0.7 => 4.0.7 
      @tarojs/taro-loader: 4.0.7 => 4.0.7 
      @tarojs/webpack5-runner: 4.0.7 => 4.0.7 
      babel-preset-taro: 4.0.7 => 4.0.7 
      eslint-config-taro: 4.0.7 => 4.0.7 
      react: ^18.0.0 => 18.3.1 
    npmGlobalPackages:
      typescript: 5.6.3