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