Registry / testing / eslint-config-taro

eslint-config-taro

JSON →
library4.2.0jsnpmunverified

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).

npm install eslint-config-taro
INSTALL
IMPORT
SIG · ESLINT-CONFIG-TARO
E
eslint-config-taro
testingjavascriptv4.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export
import taroConfig from 'eslint-config-taro'
const taroConfig = require('eslint-config-taro')
ESM-only since Taro 4. Use .eslintrc.cjs and require() in CommonJS projects, but default import works in both.
extends in ESLint config
"extends": ["taro"]
"extends": ["eslint-config-taro"]
Use the short name 'taro' in extends. The full package name works but is not conventional.
extends for Vue support
"extends": ["taro/vue"]
"extends": ["taro"] // without /vue will not enable Vue rules
Append /vue to use Vue-specific rules. Requires eslint-plugin-vue installed.

Base ESLint configuration for a Taro React project using eslint-config-taro.

// .eslintrc.cjs module.exports = { root: true, extends: ['taro'], parserOptions: { ecmaVersion: 'latest', sourceType: 'module', ecmaFeatures: { jsx: true } }, settings: { react: { version: 'detect' } }, rules: { // custom rules } };
Debug
Known issues
breakingeslint-config-taro v4 requires ESLint ^8 and drops support for ESLint <8.
fix
Upgrade ESLint to ^8.0.0.
affects: >=4.0.0
breakingIn v4, the config is ESM-only. CommonJS require() may fail unless using .eslintrc.cjs.
fix
Rename .eslintrc to .eslintrc.cjs or use dynamic import.
affects: >=4.0.0
deprecatedeslint-plugin-vue is optional but must be installed explicitly; not automatically included.
fix
If using Vue, add eslint-plugin-vue as a devDependency.
affects: >=3.0.0
gotchaUsing extends: ['taro'] without eslint-plugin-react-hooks installed will cause ESLint to crash.
fix
Install eslint-plugin-react-hooks as a devDependency.
affects: >=1.0.0
deprecatedConfig v3.x is deprecated; upgrade to v4 for future updates.
fix
Update eslint-config-taro to ^4.0.0.
affects: >=3.0.0 <4.0.0
Errors
Common errors & fixes
Cannot find module 'eslint-plugin-react-hooks'
Missing peer dependency eslint-plugin-react-hooks.
fix
Run: npm install eslint-plugin-react-hooks --save-dev
ESLint couldn't find the config 'taro'.
eslint-config-taro not installed or not in node_modules.
fix
Run: npm install eslint-config-taro --save-dev
Configuration for rule 'react/jsx-uses-react' is invalid
Outdated eslint-plugin-react version incompatible with Taro config.
fix
Update eslint-plugin-react to ^7.33.2 or later.
Upgrade
Version history
4.2.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency - core linter
eslint-plugin-reactrequiredpeer dependency - React JSX rules
eslint-plugin-react-hooksrequiredpeer dependency - React hooks rules
eslint-plugin-vueoptionalpeer dependency - required for Vue projects only
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-config-taro — npm install eslint-config-taro · libregistry