我如何更改eslint解决设置

时间:2018-04-26 11:04:05

标签: javascript reactjs webpack eslint lint

我有项目,我使用webpack,eslint。通过webpack.config我设置解析indexIndex文件。一切正常,除了eslint抛出错误import/no-unresolvedimport/extensions,它不知道,除了index之外,现在它也应该解析Index个文件({{1} } {,import Index from ./components中的文件./components)。我的设置如下。

Index.jsx

1 个答案:

答案 0 :(得分:2)

尝试安装from openpyxl import Workbook, load_workbook from openpyxl.styles import NamedStyle import datetime from contextlib import closing def add_value_dateformat(file_name, cell_cords, value): with closing(load_workbook(filename=file_name)) as wb: ws = wb.active valuec = datetime.datetime.strptime(value, "%m/%d/%Y") cell = ws[cell_cords] cell.value = valuec cell.number_format = 'm/DD/YYYY' wb.save(file_name) 并将其添加到.eslintrc:

eslint-import-resolver-webpack

或添加解析依赖项的源文件夹;像这样的东西:

"settings": {
  "import/resolver": "webpack"
}

解析器文档:https://github.com/benmosher/eslint-plugin-import/blob/master/README.md#resolvers