简体   繁体   English

当将jshint用作hello world脚本时,出现“第0行,第0行,错误的选项:'script'。”

[英]When use jshint for a hello world script, I got “line 0, col 0, Bad option: 'script'.”

This is my simple hello world programme. 这是我简单的hello world程序。

function sayHello() {
    return 'Hello world';
}

And my jshint configuration: 而我的jshint配置:

{
  "browser": true,
  "browserify": true,
  "devel": true,
  "script": {
    "lint": "jshint src"
  }
}

and package.json package.json

{
  "name": "myangular",
  "version": "1.0.0",
  "devDependencies": {
    "jshint": "^2.9.5"
  }
}

When I run jshint , get the following error: 当我运行jshint ,出现以下错误:

$./node_modules/jshint/bin/jshint src

src/hello.js: line 0, col 0, Bad option: 'script'.

1 error

I found the reason. 我找到了原因。 I put script in a wrong place. 我将脚本放在错误的位置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 jsHint - webpack警告错误选项:'强制'。 @ line 0 char 0 - jsHint - webpack warning Bad option: 'force'. @ line 0 char 0 我收到错误消息:无法注册ServiceWorker:获取脚本时收到错误的HTTP响应代码(404) - I got the error : Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script 运行gulp linter任务后,为什么会收到此错误`line 0 col 0 Bad option:'0'.`? - Why am I getting this error `line 0 col 0 Bad option: '0'.` after running gulp linter task? 如何在PhoneGap中编写基本的“ Hello World” Java脚本插件? - How do I write basic “Hello World” java script plugin in PhoneGap? amp-script 脚本哈希未找到。 amp-script[script="hello-world"] - amp-script Script hash not found. amp-script[script="hello-world"] 找到了 React 脚本,但它不会呈现简单的 hello world 元素 - React script is found but it won't render the simple hello world element `npm run jshint`导致`缺少脚本:jshint` - `npm run jshint` results in `missing script: jshint` JSHint错误:“E001 - 错误选项” - JSHint error: “E001 - Bad option” jshint错误:“ EOL错误转义。 如果需要,请使用选项multistr。”但是multistr为true - jshint error: “Bad escaping of EOL. Use option multistr if needed.” but multistr is true 如何在Angular中使用此js脚本:我必须创建一个服务吗? - How to use this js script in Angular: have I got to create a service?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM