好像我在这里遗漏了一些东西,它应该可以正常工作,但eslint不断抛出以下内容:
无法解析模块“反应”的路径。(导入/未解决)
“react”(导入/扩展)缺少文件扩展名
当试图import React from 'react'
这是一些调试信息:
包.json
{
"dependencies": {},
"devDependencies": {
"react": "16.3.2",
"react-dom": "16.3.2",
"@storybook/addon-actions": "^3.4.2",
"@storybook/addon-links": "^3.4.2",
"@storybook/addons": "^3.4.2",
"@storybook/react": "^3.4.2",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-runtime": "^6.26.0",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0"
}
}
.eslintrc
{
"parser": "babel-eslint",
"extends": ["airbnb", "prettier"],
"env": {
"browser": true,
"node": true,
"es6": true
}
}
.babelrc
{
"presets": ["env", "react"]
}
编辑器:原子 v1.26.1
谢谢。