module.exports = { root: true, parser: '@typescript-eslint/parser', extends: [ 'plugin:react/recommended', 'plugin:taro/all', 'plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. 'prettier/react', 'plugin:react-hooks/recommended', ], plugins: ['@typescript-eslint', 'react', 'taro', 'prettier'], env: { browser: true, node: true, }, parserOptions: { //指定ESLint可以解析JSX语法 ecmaVersion: 2019, sourceType: 'module', ecmaFeatures: { jsx: true, }, }, rules: { 'react/prop-types': 'off', '@typescript-eslint/explicit-function-return-type': 'off', 'taro/no-stateless-component': 'off', 'react/react-in-jsx-scope': 'off', 'react/no-find-dom-node': 'off', // 'no-unused-vars': [ // 'error', // { // varsIgnorePattern: 'Nerv', // }, // ], 'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks 'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies }, };