{"id":19594,"library":"eslint-config-taro","title":"eslint-config-taro","description":"ESLint configuration for Taro projects, providing linting rules for React/JSX and Vue (optional). Current stable version 4.2.0, released as part of Taro monorepo. Requires ESLint ^8 and supports both Taro 3 and 4. Integrates with eslint-plugin-react, eslint-plugin-react-hooks, and optionally eslint-plugin-vue. Designed for cross-platform app development. Differentiator: official config from Taro team with rules tuned for Taro's component system and JSX transformations. Release cadence follows Taro releases (~monthly).","status":"active","version":"4.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/NervJS/taro","tags":["javascript","taro","react","jsx"],"install":[{"cmd":"npm install eslint-config-taro","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-taro","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-taro","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - core linter","package":"eslint","optional":false},{"reason":"peer dependency - React JSX rules","package":"eslint-plugin-react","optional":false},{"reason":"peer dependency - React hooks rules","package":"eslint-plugin-react-hooks","optional":false},{"reason":"peer dependency - required for Vue projects only","package":"eslint-plugin-vue","optional":true}],"imports":[{"note":"ESM-only since Taro 4. Use .eslintrc.cjs and require() in CommonJS projects, but default import works in both.","wrong":"const taroConfig = require('eslint-config-taro')","symbol":"default export","correct":"import taroConfig from 'eslint-config-taro'"},{"note":"Use the short name 'taro' in extends. The full package name works but is not conventional.","wrong":"\"extends\": [\"eslint-config-taro\"]","symbol":"extends in ESLint config","correct":"\"extends\": [\"taro\"]"},{"note":"Append /vue to use Vue-specific rules. Requires eslint-plugin-vue installed.","wrong":"\"extends\": [\"taro\"] // without /vue will not enable Vue rules","symbol":"extends for Vue support","correct":"\"extends\": [\"taro/vue\"]"}],"quickstart":{"code":"// .eslintrc.cjs\nmodule.exports = {\n  root: true,\n  extends: ['taro'],\n  parserOptions: {\n    ecmaVersion: 'latest',\n    sourceType: 'module',\n    ecmaFeatures: {\n      jsx: true\n    }\n  },\n  settings: {\n    react: {\n      version: 'detect'\n    }\n  },\n  rules: {\n    // custom rules\n  }\n};\n","lang":"javascript","description":"Base ESLint configuration for a Taro React project using eslint-config-taro."},"warnings":[{"fix":"Upgrade ESLint to ^8.0.0.","message":"eslint-config-taro v4 requires ESLint ^8 and drops support for ESLint <8.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Rename .eslintrc to .eslintrc.cjs or use dynamic import.","message":"In v4, the config is ESM-only. CommonJS require() may fail unless using .eslintrc.cjs.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"If using Vue, add eslint-plugin-vue as a devDependency.","message":"eslint-plugin-vue is optional but must be installed explicitly; not automatically included.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Install eslint-plugin-react-hooks as a devDependency.","message":"Using extends: ['taro'] without eslint-plugin-react-hooks installed will cause ESLint to crash.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update eslint-config-taro to ^4.0.0.","message":"Config v3.x is deprecated; upgrade to v4 for future updates.","severity":"deprecated","affected_versions":">=3.0.0 <4.0.0"}],"env_vars":null,"search_vec":"'3':35 '4':37 '4.2.0':21 '8':30 'app':60 'cadenc':80 'compon':74 'config':3,64 'configur':6 'cross':58 'cross-platform':57 'current':18 'design':55 'develop':61 'differenti':62 'eslint':2,5,29,41,45,52 'eslint-config-taro':1 'eslint-plugin-react':40 'eslint-plugin-react-hook':44 'eslint-plugin-vu':51 'follow':81 'hook':48 'integr':38 'javascript':85 'jsx':77,88 'lint':11 'monorepo':27 'month':84 'offici':63 'option':17,50 'part':24 'platform':59 'plugin':42,46,53 'project':9 'provid':10 'react':43,47,87 'react/jsx':14 'releas':22,79,83 'requir':28 'rule':12,69 'stabl':19 'support':32 'system':75 'taro':4,8,26,34,66,72,82,86 'team':67 'transform':78 'tune':70 'version':20 'vue':16,54","created_at":"2026-04-25T11:18:36.968615+00:00","updated_at":"2026-04-25T11:18:36.968615+00:00","problems":[{"fix":"Run: npm install eslint-plugin-react-hooks --save-dev","cause":"Missing peer dependency eslint-plugin-react-hooks.","error":"Cannot find module 'eslint-plugin-react-hooks'"},{"fix":"Run: npm install eslint-config-taro --save-dev","cause":"eslint-config-taro not installed or not in node_modules.","error":"ESLint couldn't find the config 'taro'."},{"fix":"Update eslint-plugin-react to ^7.33.2 or later.","cause":"Outdated eslint-plugin-react version incompatible with Taro config.","error":"Configuration for rule 'react/jsx-uses-react' is invalid"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://taro-docs.jd.com","github":"https://github.com/NervJS/taro","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-config-taro","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}