我正在使用webPack热重装和装箱装载器,当我在某些环境下编辑文件时(我无法隔离),它会在文件的开头添加无限的空白行,然后抱怨空白行。< / p>
JS加载部分是:
{
const cacheDir = (process.env.CACHE_DIRECTORY ? process.env.CACHE_DIRECTORY : 'true')
return {
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loaders: [
`babel?cacheDirectory=${cacheDir}`, // presets on .babelrc
'eslint-loader?fix'
],
include: paths
}
]
}
}
}
HRE加载部分是:
import webpack from 'webpack'
const devServer = (options) => {
return {
devServer: {
hot: true,
inline: true,
stats: 'errors-only',
host: options.host,
port: options.port,
historyApiFallback: true
},
plugins: [
new webpack.HotModuleReplacementPlugin({
multiStep: true
})
]
}
}
export default devServer
export {devServer}
最后.eslintrc是:
module.exports = {
"extends": ["standard", "standard-jsx"],
"plugins": [
"flowtype",
],
rules: {
"flowtype/define-flow-type": 2,
"flowtype/use-flow-type": 2
}
}
哪个标准是this plugin,而标准-jx是this one。
是否有人知道什么可能导致文件开头的空行插入?
感谢。