关闭vue-cli的黄色警告

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/samll_cat/article/details/84982730

前言
使用脚手架创建项目的时候 不小心安装了eslint,运行时报了一堆警告!报错必须处理,警告也忍不了!!!
可是一个个去掉警告又有点烦,就找了个偷懒的办法在bulid -webpack.base.config.js 里找到

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
    }*/
})

注释掉createLintingRule里面的内容,然后重启项目,你会发现世界原来那么清爽!

展开阅读全文

关闭套接字出警告

12-01

大家好!rn我在代码(线程)里通过 socket 与另一端通信(先收,然后发,然后再接收,最后关闭)。rn但是我发现每次关闭时都会提示这个警告:rn[img=http://img.my.csdn.net/uploads/201212/01/1354333183_8731.jpg][/img]rn跟踪发现是最后的 close 那句执行后出的警告。(为了必要,把这个函数都上传了)rn[code=java] public HTTPResponse post(String host, int port, boolean isKeepAlive)rn rn HTTPResponse httpRes = new HTTPResponse();rnrn setHost(host);rn rn setConnection((isKeepAlive == true) ? HTTP.KEEP_ALIVE : HTTP.CLOSE);rn rn boolean isHeaderRequest = isHeadRequest();rn rn OutputStream out = null;rn InputStream in = null;rn rn try rn if (postSocket == null)rn // Thanks for Hao Hu rn postSocket = new Socket();rn postSocket.connect(new InetSocketAddress(host, port), HTTPServer.DEFAULT_TIMEOUT);rn rnrn out = postSocket.getOutputStream();rn PrintStream pout = new PrintStream(out);rn pout.print(getHeader());rn pout.print(HTTP.CRLF);rn rn boolean isChunkedRequest = isChunked();rn rn String content = getContentString();rn int contentLength = 0;rn if (content != null)rn contentLength = content.length();rn rn if (0 < contentLength) rn if (isChunkedRequest == true) rn // Thanks for Lee Peik Feng (07/07/05)rn String chunSizeBuf = Long.toHexString(contentLength);rn pout.print(chunSizeBuf);rn pout.print(HTTP.CRLF);rn rn pout.print(content);rn if (isChunkedRequest == true)rn pout.print(HTTP.CRLF);rn rnrn if (isChunkedRequest == true) rn pout.print("0");rn pout.print(HTTP.CRLF);rn rn rn pout.flush();rnrn in = postSocket.getInputStream();rn httpRes.set(in, isHeaderRequest); rn catch (SocketException e) rn httpRes.setStatusCode(HTTPStatus.INTERNAL_SERVER_ERROR);rn Debug.warning(e);rn catch (IOException e) rn //Socket create but without connectionrn //TODO Blacklistening the devicern httpRes.setStatusCode(HTTPStatus.INTERNAL_SERVER_ERROR);rn Debug.warning(e);rn finally rn if (isKeepAlive == false) rn try rn in.close();rn catch (Exception e) ;rn if (in != null)rn try rn out.close(); rn catch (Exception e) ;rn if (out != null)rn try rn postSocket.close(); // 警告在这里rn catch (Exception e) ;rn postSocket = null;rn rn rnrn return httpRes;rn [/code]rnrn虽然这个警告不影响使用,但是调试的时候看以这么多东西,总是希望能去掉。请大家帮我看看,是什么原因,怎么改正它? 论坛

没有更多推荐了,返回首页