This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Move JSHint config to jshintrc files

Follows-up 3f1f88b.

Also:
* Moved jquery.cookie.js to src/ directory to allow using a separate
  configuration for it (also complements /build, and other jQuery plugin
  repositories).
* Simplified Grunt configuration.
  • Loading branch information...
Krinkle committed Jul 14, 2014
1 parent be47cde commit b106a0e23640281321cf7ced832f6dc8fb88a085
Showing with 49 additions and 57 deletions.
  1. +2 −0 .jshintignore
  2. +12 −0 .jshintrc
  3. +9 −52 Gruntfile.js
  4. +1 −1 bower.json
  5. +2 −2 component.json
  6. +12 −0 src/.jshintrc
  7. 0 { → src}/jquery.cookie.js
  8. +9 −0 test/.jshintrc
  9. +1 −1 test/index.html
  10. +1 −1 test/malformed_cookie.html
View
@@ -0,0 +1,2 @@
build
node_modules
View
@@ -0,0 +1,12 @@
{
"curly": true,
"eqeqeq": true,
"expr": true,
// "maxlen": 130,
"newcap": true,
"noarg": true,
"nonbsp": true,
"trailing": true,
"undef": true,
"unused": true
}
View
@@ -1,85 +1,42 @@
/*jshint node:true, quotmark:single */
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
qunit: {
all: ['test/index.html']
all: 'test/index.html'
},
jshint: {
options: {
curly: true,
eqeqeq: true,
expr: true,
// maxlen: 130,
newcap: true,
noarg: true,
nonbsp: true,
trailing: true,
undef: true,
unused: true
jshintrc: true
},
grunt: {
options: {
node: true,
quotmark: 'single'
},
files: {
src: ['Gruntfile.js']
}
},
source: {
options: {
browser: true,
camelcase: true,
jquery: true,
quotmark: 'single',
globals: {
define: true,
require: true
},
},
files: {
src: ['jquery.cookie.js']
}
},
tests: {
options: {
browser: true,
jquery: true,
qunit: true,
'-W053': true
},
files: {
src: ['test/**/*.js']
}
}
grunt: 'Gruntfile.js',
source: 'src/**/*.js',
tests: 'test/**/*.js'
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %> | <%= pkg.license %> */\n'
},
build: {
files: {
'build/jquery.cookie-<%= pkg.version %>.min.js': 'jquery.cookie.js'
'build/jquery.cookie-<%= pkg.version %>.min.js': 'src/jquery.cookie.js'
}
}
},
watch: {
options: {
livereload: true
},
files: [
'jquery.cookie.js',
'test/**/*.js'
],
files: '{src,test}/**/*.js',
tasks: 'default'
},
compare_size: {
files: [
'build/jquery.cookie-<%= pkg.version %>.min.js',
'jquery.cookie.js'
'src/jquery.cookie.js'
],
options: {
compress: {
View
@@ -2,7 +2,7 @@
"name": "jquery.cookie",
"version": "1.4.1",
"main": [
"./jquery.cookie.js"
"src/jquery.cookie.js"

This comment has been minimized.

@carhartl

carhartl Jul 16, 2014

Owner

Are you sure we don't need the "./" part for bower?

This comment has been minimized.

@Krinkle

Krinkle Jul 16, 2014

Contributor

Yeah, it wasn't needed for the root file either. People tend to do it for root files to emphasise that it is a path and not a bare filename.

],
"dependencies": {
"jquery": ">=1.2"
View
@@ -7,8 +7,8 @@
"dependencies": {},
"development": {},
"license": "MIT",
"main": "jquery.cookie.js",
"main": "src/jquery.cookie.js",
"scripts": [
"jquery.cookie.js"
"src/jquery.cookie.js"
]
}
View
@@ -0,0 +1,12 @@
{
"browser": true,
"camelcase": true,
"jquery": true,
"quotmark": "single",
"globals": {
"define": true,
"require": true
},
"extends": "../.jshintrc"
}
File renamed without changes.
View
@@ -0,0 +1,9 @@
{
"browser": true,
"jquery": true,
"qunit": true,
"-W053": true,
"extends": "../.jshintrc"
}
View
@@ -6,7 +6,7 @@
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.14.0.css">
<script src="http://code.jquery.com/qunit/qunit-1.14.0.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="../jquery.cookie.js"></script>
<script src="../src/jquery.cookie.js"></script>
<script src="tests.js"></script>
</head>
<body>
@@ -3,7 +3,7 @@
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="../jquery.cookie.js"></script>
<script src="../src/jquery.cookie.js"></script>
<script>
try {
Object.defineProperty(document, "cookie", { get: function() { return "first=one; ; second=two"; } });

0 comments on commit b106a0e

Please sign in to comment.