【问题标题】:JSLintNet.MSBuild doesn't allow define constant fieldJSLintNet.MSBuild 不允许定义常量字段
【发布时间】:2019-05-14 09:28:48
【问题描述】:

我尝试在 js 文件中定义常量字段,例如 const someName= "some Value",项目类型是我安装了 JSLintNet.MSBuild NuGet 的 asp.net Web 应用程序,现在出现错误:

.

/*global Hammer, YTDateRange, YTGridLabel, YTGridMilestone */
const scrollRatio = -120;

var YTGridPanel = new Class({
    Implements: [Events], Binds: ["update", "updatePanelGeometry", "pan",
            "redrawCanvas",
            "suspendZooming", "resumeZooming",
            "handleWindowResize", "onScroll",
            "onDblClick", "onMouseDown", "onMouseMove", "onMouseUp", "onPageScroll"],
...
)}

JSLint:意外的“常量”。

【问题讨论】:

标签: javascript c# .net


【解决方案1】:

您需要在 JSHint 选项(.json 文件)中添加 "esversion": 6 并将 NuGet packeg 版本更新为最新版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-29
    相关资源
    最近更新 更多