我的.eslintrc文件如下所示:
"extends": [
"prettier",
"prettier/flowtype",
"prettier/react",
"plugin:jsx-a11y/recommended"
],
"plugins": [
"prettier"
],
当我启动我的应用程序时,我收到这样的错误:
./src/index.js
Line 1: Definition for rule 'jsx-a11y/media-has-caption' was not found jsx-a11y/media-has-caption
Line 1: Definition for rule 'jsx-a11y/accessible-emoji' was not found jsx-a11y/accessible-emoji
Line 1: Definition for rule 'jsx-a11y/anchor-has-content' was not found jsx-a11y/anchor-has-content
Line 1: Definition for rule 'jsx-a11y/aria-activedescendant-has-tabindex'
was not found jsx-a11y/aria-activedescendant-has-tabindex
etc. etc.
他们都指向src/index.js
的第1行,如下所示:
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
第1行是import React from 'react'
我完全不知道这些掉毛错误来自哪里。
答案 0 :(得分:0)
eslint-loader
正在尝试lint的第一个文件(在您的情况下是条目文件src/index.js
)
由于您的node_modules