Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bad option: ';_;' when building Twitter Bootstrap

I just installed and configured the environment to build customized versions of Twitter Bootstrap locally.

This what I did:

  1. Install node
  2. Install npm
  3. Install less
  4. clone Bootstrap locally
  5. run make build to compile Bootstrap

Step 5:

~/devel/parking/bootstrap$ make build
jshint js/*.js --config js/.jshintrc

js/bootstrap-affix.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-alert.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-button.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-carousel.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-collapse.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-dropdown.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-modal.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-popover.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-scrollspy.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-tab.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-tooltip.js: line 24, col 17, Bad option: ';_;'.
js/bootstrap-transition.js: line 23, col 17, Bad option: ';_;'.
js/bootstrap-typeahead.js: line 23, col 17, Bad option: ';_;'.

13 errors
make: *** [test] Error 2

Line 23:

"use strict"; // jshint ;_;

I was able to resolve the issue removing // jshint ;_; from line 23. Though, I'd prefer to leave Bootstrap sources untouched.

How can I get rid of those errors and what does the "Bad option" error mean?


js/.jshintrc:

{
    "validthis": true,
    "laxcomma" : true,
    "laxbreak" : true,
    "browser"  : true,
    "eqnull"   : true,
    "debug"    : true,
    "devel"    : true,
    "boss"     : true,
    "expr"     : true,
    "asi"      : true
}
like image 591
Paolo Avatar asked Feb 24 '13 09:02

Paolo


3 Answers

The issue today is that JSHint's latest version is not compatible with the current Bootstrap Makefile because previous silent warnings now throw errors.

Remove JSHint npm uninstall jshint and then install version 0.9.1 npm install [email protected]. Finally run make and it compiles successfully.

like image 57
Dylan Valade Avatar answered Oct 21 '22 00:10

Dylan Valade


I met the same error just now, after searching the bootstrap issue,

I found the solution, please look at these: https://github.com/twitter/bootstrap/pull/5244 https://github.com/twitter/bootstrap/issues/7043

like image 21
boilingbit Avatar answered Oct 20 '22 23:10

boilingbit


Simply uninstalling JSHint didn't do it for me. Here's what I did following this advice.

cd bootstrap
npm uninstall -g uglify-js jshint recess connect
npm uninstall uglify-js jshint recess connect
npm install 
mkdir bin
cd bin
ln -s ../node_modules/*/bin/* . ; ln -s hint jshint
cd ..
export PATH=$PATH:$PWD/bin

After that cleanup just run:

make

or any other make directive.

like image 3
Octavian A. Damiean Avatar answered Oct 21 '22 00:10

Octavian A. Damiean