2021-07-07 Eslint 报错问题 ,已解决!
程序员文章站
2024-03-12 11:48:02
...
Eslint 报错问题 ,已解决!
最近在用vue 框架,经常会出现eslint 报错问题,以此记录问题解决。
eslintrc.Js文件修改
//**添加 'space-before-function-paren': 0,'indent': 'off',**
rules: {
'space-before-function-paren': 0,
'indent': 'off',
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
build 文件下的webpack.base.conf.js修改
// An highlighted block
const createLintingRule = () => ({
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// enforce: 'pre',
// include: [resolve('src'), resolve('test')],
// options: {
// formatter: require('eslint-friendly-formatter'),
// emitWarning: !config.dev.showEslintErrorsInOverlay
// }
})
module: {
rules: [
// ...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
推荐阅读
-
2021-07-07 Eslint 报错问题 ,已解决!
-
Spring 报错:元素 "context:component-scan" 的前缀 "context" 未绑定的问题解决
-
pod install 报错(git: error: unable to read SDK settings)问题解决
-
tomcat报错:Wrapper cannot find servlet class ...问题解决
-
Spring 报错:元素 "context:component-scan" 的前缀 "context" 未绑定的问题解决
-
【问题解决】文件系统报错:Try to bring eth0 interface up......grep: /etc/mtab: No such file or directory
-
解决MyEclipse10.7部署报错抛空指针异常问题的方法
-
解决MyEclipse10.7部署报错抛空指针异常问题的方法
-
解决MyEclipse中Maven设置jdk版本jdk1.8报错问题
-
ASP.NET在IE10中无法判断用户已登入及Session丢失问题解决方法