webstrom升级taro报ESLint: TypeError: this.libOptions.parse is not a function
Author:zhoulujun Date:
taro升级到3.6.11,webstrom里面报 ESLint: TypeError: this.libOptions.parse is not a function
taro 3.5.7 还是好的,不知道3.6.11 为什么不行。taro info 信息如下:
Taro CLI 3.6.11 environment info:
System:
OS: macOS 13.3.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.17.0/bin/yarn
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm
npmPackages:
@tarojs/cli: 3.6.11 => 3.6.11
@tarojs/components: 3.6.11 => 3.6.11
@tarojs/helper: 3.6.11 => 3.6.11
@tarojs/plugin-framework-react: 3.6.11 => 3.6.11
@tarojs/plugin-platform-alipay: 3.6.11 => 3.6.11
@tarojs/plugin-platform-h5: 3.6.11 => 3.6.11
@tarojs/plugin-platform-jd: 3.6.11 => 3.6.11
@tarojs/plugin-platform-qq: 3.6.11 => 3.6.11
@tarojs/plugin-platform-swan: 3.6.11 => 3.6.11
@tarojs/plugin-platform-tt: 3.6.11 => 3.6.11
@tarojs/plugin-platform-weapp: 3.6.11 => 3.6.11
@tarojs/react: 3.6.11 => 3.6.11
@tarojs/runtime: 3.6.11 => 3.6.11
@tarojs/shared: 3.6.11 => 3.6.11
@tarojs/taro: 3.6.11 => 3.6.11
@tarojs/taro-loader: 3.6.11 => 3.6.11
@tarojs/webpack5-runner: 3.6.11 => 3.6.11
babel-preset-taro: 3.6.11 => 3.6.11
eslint-config-taro: 3.6.11 => 3.6.11
react: ^18.0.0 => 18.2.0
taro-ui: ^2.3.4 => 2.3.4
网上搜到了,说是eslint 版本问题。发现用npm 重新安装eslint 8.22 无效,哪怕是删除node_modules 也还是不行。但是删除后用yarn安装就是好的。神器了
package.json 内容如下:
{ "name": "tulu-app", "version": "1.0.0", "private": true, "description": "", "templateInfo": { "name": "taro-hooks@2x", "typescript": true, "css": "sass" }, "scripts": { "build:weapp": "taro build --type weapp", "build:swan": "taro build --type swan", "build:alipay": "taro build --type alipay", "build:tt": "taro build --type tt", "build:h5": "taro build --type h5", "build:rn": "taro build --type rn", "build:qq": "taro build --type qq", "build:jd": "taro build --type jd", "build:quickapp": "taro build --type quickapp", "dev:weapp": "npm run build:weapp -- --watch", "dev:swan": "npm run build:swan -- --watch", "dev:alipay": "npm run build:alipay -- --watch", "dev:tt": "npm run build:tt -- --watch", "dev:h5": "npm run build:h5 -- --watch", "dev:rn": "npm run build:rn -- --watch", "dev:qq": "npm run build:qq -- --watch", "dev:jd": "npm run build:jd -- --watch", "dev:quickapp": "npm run build:quickapp -- --watch" }, "browserslist": [ "last 3 versions", "Android >= 4.1", "ios >= 8" ], "author": "", "dependencies": { "@babel/runtime": "^7.7.7", "@taro-hooks/plugin-react": "2", "@taro-hooks/shared": "2", "@tarojs/components": "3.6.11", "@tarojs/helper": "3.6.11", "@tarojs/plugin-framework-react": "3.6.11", "@tarojs/plugin-platform-alipay": "3.6.11", "@tarojs/plugin-platform-h5": "3.6.11", "@tarojs/plugin-platform-jd": "3.6.11", "@tarojs/plugin-platform-qq": "3.6.11", "@tarojs/plugin-platform-swan": "3.6.11", "@tarojs/plugin-platform-tt": "3.6.11", "@tarojs/plugin-platform-weapp": "3.6.11", "@tarojs/react": "3.6.11", "@tarojs/runtime": "3.6.11", "@tarojs/shared": "3.6.11", "@tarojs/taro": "3.6.11", "react": "^18.0.0", "react-dom": "^18.0.0", "taro-hooks": "2", "taro-ui": "^2.3.4" }, "devDependencies": { "@babel/core": "^7.8.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", "@tarojs/cli": "3.6.11", "@tarojs/taro-loader": "3.6.11", "@tarojs/webpack5-runner": "3.6.11", "@types/node": "^18.15.11", "@types/react": "^18.0.0", "@types/webpack-env": "^1.13.6", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", "babel-plugin-import": "^1.13.3", "babel-preset-taro": "3.6.11", "eslint": "8.22.0", "eslint-config-taro": "3.6.11", "eslint-plugin-import": "^2.12.0", "eslint-plugin-react": "^7.8.2", "eslint-plugin-react-hooks": "^4.2.0", "postcss": "^8.4.18", "react-refresh": "^0.11.0", "stylelint": "9.3.0", "ts-node": "^10.9.1", "typescript": "^4.1.0", "webpack": "^5.78.0" }, "engines": { "node": ">=12.0.0" } }
转载本站文章《webstrom升级taro报ESLint: TypeError: this.libOptions.parse is not a function》,
请注明出处:https://www.zhoulujun.cn/html/Operation/codeGuide/8962.html
延伸阅读:
- ESLint: Parsing error: Adjacent JSX elements must be wrapped in an enclosing tag
- eslint fix:eslint命令行修复代码
- Eslint 定制化开发rule与plugin:如何手动创建eslint rule与plugin
- align-items:start value has mixed support, consider using flex-start instead
- parserOptions.project has been set for @typescript-eslint/parse
- CSS代码检查工具stylelint配置使用详解