{"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,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","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,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}