[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f7cwfY1EO_N-FDyhuZbAdxlG-YX62692VoYQqeLVISnU":3},{"code":4,"message":5,"data":6},200,"成功",{"id":7,"createdAt":8,"title":9,"content":10,"summary":11,"image":12,"uid":13,"user":14,"categoryId":21,"category":22,"subCategoryId":24,"subCategory":25,"comments":27,"status":17,"reason":33,"notice":33,"visitCount":38,"commentCount":17,"keywords":39},171,"2025-10-31T09:05:04.806Z","taro react eslint的issue记录：Unexpected usage of doublequote. eslint(jsx-quotes)","在使用taro框架的react来编写小程序时，遇到一个小的代码eslint问题，在这里记录一下。\n\n问题截图：\n![taro eslint](https://image.xinwei.ltd/image1761900766038.png)\n\n问题描述：\n> Unexpected usage of doublequote. eslint(jsx-quotes)\n\n从上面的问题截图中可以看出，自从使用`taro init`出的项目，自带了`eslint`的配置，在我编写的一小段代码中，classname右侧使用了双引号，但是eslint提示，不希望使用双引号的写法。\n\n那么只要使用单引号包裹classname，那么这个提示就会消失的，但是我的visual studio code中已经对我其他的项目都配置是使用单引号的写法，所以我要单独配置当前的小程序eslint规则（taro工程中有一个.eslintrc文件）。\n\n![taro工程结构](https://image.xinwei.ltd/image1761901319205.png)\n\n\n我们看一下taro react小程序工程中的eslint规则：\n```.eslintrc\n{\n  \"extends\": [\"taro/react\"],\n  \"rules\": {\n    \"react/jsx-uses-react\": \"off\",\n    \"react/react-in-jsx-scope\": \"off\"\n  }\n}\n```\n\n那么我想要eslint的双引号的提示消失，就需要在这个文件中进行配置，只需要增加一个`jsx-quotes`的配置，如下：\n```.eslintrc\n{\n  \"extends\": [\"taro/react\"],\n  \"rules\": {\n    \"react/jsx-uses-react\": \"off\",\n    \"react/react-in-jsx-scope\": \"off\",\n    \"jsx-quotes\": \"off\"\n  }\n}\n```\n\n再来看看刚刚的代码eslint提示：\n![eslint修改后的代码提示](https://image.xinwei.ltd/image1761901466330.png)\n\n至此记录。\n\n","记录一下在taro react小程序中遇到一些小问题和解决方式，仅做记录。","https://image.xinwei.ltd/image1761900766038.png",499668042977349,{"phone":15,"userId":13,"nickName":16,"vipType":17,"avatar":18,"sign":19,"createdAt":20},"13121171998","全栈老韩",1,"https://image.xinwei.ltd/images/IMG_5430.JPG","全栈工程师，擅长iOS App开发、前端（vue、react、nuxt、小程序&Taro）开发、Flutter、React Native、后端（midwayjs、golang、express、koa）开发、docker容器、seo优化等。","2024-01-01T16:14:30.305Z",2,{"id":21,"name":23},"IT技术",13,{"id":24,"name":26,"parentId":21},"小程序",[28],{"id":29,"createAt":30,"content":31,"articleId":7,"userId":13,"user":32,"replyToUid":34,"replyToUser":35,"status":17,"statusDes":33,"replies":37},18,"2025-10-31T09:13:19.502Z","ESLint rule中jsx-quotes的值可选为：\n\"off\" - turns the rule off\n\"warn\" - turn the rule on as a warning (doesn't affect exit code)\n\"error\" - turn the rule on as an error (exit code is 1 when triggered)",{"phone":15,"userId":13,"nickName":16,"vipType":17,"avatar":18,"sign":33,"createdAt":20},"",0,{"phone":33,"userId":34,"nickName":33,"vipType":34,"avatar":33,"sign":33,"createdAt":36},"0001-01-01T00:00:00Z",null,23,"taro eslint, taro react, react eslint, taro, eslint, jsx-quote"]