【发布时间】:2023-04-02 01:20:01
【问题描述】:
尽管有globals 设置,JSHint 仍报告未定义的变量。这是一个最小的例子:
文件.js:
// jshint esversion: 6, node: true
// globals Intl
'use strict';
let percent = new Intl.NumberFormat("en-US", { style: "percent" }).format;
运行jshint file.js
index2.js: line 5, col 19, 'Intl' is not defined.
1 error
知道我的配置有什么问题吗?注意这里没有.jshintrc,JSHint的唯一配置就是file.js开头的cmets。
【问题讨论】:
标签: javascript jshint