0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00

Add .jshintrc file so JSHint checks it correctly.

Resolves #25.
This commit is contained in:
Neil Jenkins 2015-01-08 12:21:53 +07:00
parent 8e8874b554
commit dfed911833
6 changed files with 23 additions and 7 deletions

19
.jshintrc Normal file
View file

@ -0,0 +1,19 @@
{
"curly": true,
"eqeqeq": true,
"es3": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": false,
"unused": true,
"undef": true,
"boss": true,
"eqnull": true,
"strict": true,
"browser": true,
"devel": true
}

View file

@ -12,7 +12,7 @@ build: build/squire.js build/document.html
build/squire-raw.js: source/intro.js source/Constants.js source/TreeWalker.js source/Node.js source/Range.js source/Editor.js source/outro.js build/squire-raw.js: source/intro.js source/Constants.js source/TreeWalker.js source/Node.js source/Range.js source/Editor.js source/outro.js
mkdir -p $(@D) mkdir -p $(@D)
cat $^ >$@ cat $^ | grep -v '^\/\*jshint' >$@
build/squire.js: build/squire-raw.js build/squire.js: build/squire-raw.js
./node_modules/uglify-js/bin/uglifyjs $^ -c -m -o $@ ./node_modules/uglify-js/bin/uglifyjs $^ -c -m -o $@

View file

@ -3,7 +3,6 @@
( function ( doc, undefined ) { ( function ( doc, undefined ) {
"use strict"; "use strict";
/*jshint strict:false, undef:false, unused:false */
var DOCUMENT_POSITION_PRECEDING = 2; // Node.DOCUMENT_POSITION_PRECEDING var DOCUMENT_POSITION_PRECEDING = 2; // Node.DOCUMENT_POSITION_PRECEDING
var ELEMENT_NODE = 1; // Node.ELEMENT_NODE; var ELEMENT_NODE = 1; // Node.ELEMENT_NODE;
@ -42,7 +41,6 @@ var canObserveMutations = typeof MutationObserver !== 'undefined';
var notWS = /[^ \t\r\n]/; var notWS = /[^ \t\r\n]/;
var indexOf = Array.prototype.indexOf; var indexOf = Array.prototype.indexOf;
/*jshint strict:false */
/* /*
Native TreeWalker is buggy in IE and Opera: Native TreeWalker is buggy in IE and Opera:
@ -132,7 +130,6 @@ TreeWalker.prototype.previousNode = function () {
current = node; current = node;
} }
}; };
/*jshint strict:false, undef:false, unused:false */
var inlineNodeNames = /^(?:#text|A(?:BBR|CRONYM)?|B(?:R|D[IO])?|C(?:ITE|ODE)|D(?:ATA|FN|EL)|EM|FONT|HR|I(?:NPUT|MG|NS)?|KBD|Q|R(?:P|T|UBY)|S(?:U[BP]|PAN|TR(?:IKE|ONG)|MALL|AMP)?|U|VAR|WBR)$/; var inlineNodeNames = /^(?:#text|A(?:BBR|CRONYM)?|B(?:R|D[IO])?|C(?:ITE|ODE)|D(?:ATA|FN|EL)|EM|FONT|HR|I(?:NPUT|MG|NS)?|KBD|Q|R(?:P|T|UBY)|S(?:U[BP]|PAN|TR(?:IKE|ONG)|MALL|AMP)?|U|VAR|WBR)$/;
@ -586,7 +583,6 @@ function mergeContainers ( node ) {
fixCursor( prev ); fixCursor( prev );
} }
} }
/*jshint strict:false, undef:false, unused:false */
var getNodeBefore = function ( node, offset ) { var getNodeBefore = function ( node, offset ) {
var children = node.childNodes; var children = node.childNodes;
@ -1076,7 +1072,6 @@ var expandRangeToBlockBoundaries = function ( range ) {
range.setEnd( parent, indexOf.call( parent.childNodes, end ) + 1 ); range.setEnd( parent, indexOf.call( parent.childNodes, end ) + 1 );
} }
}; };
/*jshint strict:false, undef:false, unused:false */
var instances = []; var instances = [];

View file

@ -1,4 +1,4 @@
/*jshint strict:false, undef:false, unused:false */ /*jshint strict:false, undef:false, unused:false, latedef:false */
var getNodeBefore = function ( node, offset ) { var getNodeBefore = function ( node, offset ) {
var children = node.childNodes; var children = node.childNodes;

View file

@ -1,4 +1,5 @@
/* Copyright © 2011-2013 by Neil Jenkins. MIT Licensed. */ /* Copyright © 2011-2013 by Neil Jenkins. MIT Licensed. */
/*jshint ignore:start */
( function ( doc, undefined ) { ( function ( doc, undefined ) {

View file

@ -1,3 +1,4 @@
/*jshint ignore:start */
if ( top !== win ) { if ( top !== win ) {
win.editor = new Squire( doc ); win.editor = new Squire( doc );