Skip to content

Commit e2c27dc

Browse files
authored
Update jsdoc (Modernizr#2346)
* Clean up some doc tags * Replace memberOf with memberof, undo any other changes in html5shiv/printshiv to get back to pristine state * Small cleanups * Add custom tags to jsdoc config * Cleanup jsdoc tags * Cleanup jsdoc tags * Add inch config file to exclude html5shivs * Update inch yml * Use inch.json instead * Dont inch the lib folder * Cleanup jsdoc tags * More jsdoc cleanups * Move inch config into one file * Add comma-dangle rule to eslint * Cleanup grunt file tasks a little * Remove some leftover async:false * Review fixes * Fix seplling error * More DOC cleanups * Fix compile error * Whitelines/spaces cleanup * Add eslint rule against multiple whitelines, fix those occurences * Remove unused (and disabled) eslint entries, sort alphabetically * Ignored file is not with".min" * Add task for generating and reporting the coverage from istanbul * Update eslint dependency * Small JSdoc cleanups * Remove unused eslint hint * Add optional tag back to parameter * Rname memberof -> memberOf, makes html5shivs original again
1 parent c2906e9 commit e2c27dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+5031
-338
lines changed

.eslintrc

+16-26
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,35 @@
1818
"jsdoc"
1919
],
2020
"rules": {
21-
"indent": [
22-
2,
23-
2,
24-
{
25-
"SwitchCase": 1
26-
}
27-
],
28-
"quotes": [
29-
"error",
30-
"single"
31-
],
21+
"comma-dangle": "error",
22+
"comma-style": ["error", "last"],
3223
"curly": "error",
33-
"wrap-iife": "off",
24+
"indent": ["error", 2, { "SwitchCase": 1 }],
3425
"no-caller": "error",
35-
"no-cond-assign": [
36-
"error",
37-
"except-parens"
38-
],
39-
"eqeqeq": "off",
26+
"no-cond-assign": ["error", "except-parens"],
4027
"no-eq-null": "error",
41-
"new-cap": "off",
28+
"no-eval": "error",
29+
"no-global-getComputedStyle": "error",
30+
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1 }],
4231
"no-undef": "error",
43-
"no-unused-vars": "error",
4432
"no-unused-expressions": "error",
45-
"no-eval": "error",
46-
"comma-style": [
47-
"error",
48-
"last"
49-
],
50-
"dot-notation": "off",
33+
"no-unused-vars": "error",
34+
"quotes": ["error", "single"],
5135
"semi": "error",
5236
"valid-jsdoc": "error",
53-
"no-global-getComputedStyle": "error",
5437
"jsdoc/check-tag-names": 1,
5538
"jsdoc/check-types": 1,
5639
"jsdoc/newline-after-description": 1,
5740
"jsdoc/require-hyphen-before-param-description": 1,
5841
"jsdoc/require-param": 1,
5942
"jsdoc/require-param-type": 1,
6043
"jsdoc/require-returns-type": 1
44+
},
45+
"settings": {
46+
"jsdoc": {
47+
"additionalTagNames": {
48+
"customTags": ["memberOf", "optionName", "optionProp"]
49+
}
50+
}
6151
}
6252
}

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ node_modules
22
test/coverage
33
test/*.html
44
gh-pages
5-
modernizr.min.js
5+
modernizr.js
66
modernizr-test.js
77
metadata.json
88
build

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ gh-pages
55
appveyor.yml
66
Gruntfile.js
77
metadata.json
8-
modernizr.min.js
8+
modernizr.js
99
.*

Gruntfile.js

+24-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/*global module */
2-
31
var browsers = require('./test/browser/sauce-browsers.json');
42
var serveStatic = require('serve-static');
53

@@ -16,20 +14,27 @@ module.exports = function(grunt) {
1614
'!test/browser/integration/*.js'
1715
]);
1816

17+
var integrationTests = grunt.file.expand([
18+
'test/browser/integration/*.js'
19+
]);
20+
21+
var nodeTests = grunt.file.expand([
22+
'test/universal/**/*.js',
23+
'test/node/**/*.js'
24+
]);
25+
1926
grunt.initConfig({
2027
env: {
21-
nodeTests: [
22-
'test/universal/**/*.js',
23-
'test/node/**/*.js'
24-
],
2528
browserTests: browserTests,
2629
coverage: {
2730
APP_DIR_FOR_CODE_COVERAGE: 'test/coverage/instrument',
2831
urls: [
2932
'http://localhost:9999/test/unit.html',
3033
'http://localhost:9999/test/index.html'
3134
]
32-
}
35+
},
36+
integrationTests: integrationTests,
37+
nodeTests: nodeTests
3338
},
3439
generate: {
3540
dest: './dist/modernizr-build.js'
@@ -52,10 +57,10 @@ module.exports = function(grunt) {
5257
},
5358
eslint: {
5459
target: [
55-
'<%= env.nodeTests%>',
60+
'<%= env.nodeTests %>',
5661
'<%= env.browserTests %>',
62+
'<%= env.integrationTests %>',
5763
'test/browser/setup.js',
58-
'test/browser/integration/*.js',
5964
'Gruntfile.js',
6065
'src/*.js',
6166
'lib/*.js',
@@ -83,7 +88,7 @@ module.exports = function(grunt) {
8388
options: {
8489
data: {
8590
unitTests: browserTests,
86-
integrationTests: grunt.file.expand(['test/browser/integration/*.js'])
91+
integrationTests: integrationTests
8792
}
8893
},
8994
files: {
@@ -164,7 +169,7 @@ module.exports = function(grunt) {
164169
reporter: 'dot',
165170
timeout: 5000
166171
},
167-
src: ['<%= env.nodeTests%>']
172+
src: ['<%= env.nodeTests %>']
168173
}
169174
},
170175
instrument: {
@@ -219,6 +224,14 @@ module.exports = function(grunt) {
219224

220225
grunt.registerTask('build', ['clean', 'generate']);
221226

227+
/**
228+
* Performs the code coverage tasks provided by Istanbul
229+
*/
230+
grunt.registerTask('coverage', ['env:coverage', 'instrument', 'mochaTest', 'storeCoverage', 'makeReport']);
231+
232+
/**
233+
* Default task for creating a modernizr build using lib/config-all.json
234+
*/
222235
grunt.registerTask('default', ['eslint', 'build']);
223236

224237
var tests = ['clean', 'eslint', 'pug', 'instrument', 'env:coverage', 'nodeTests'];

feature-detects/audio/autoplay.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"property": "audioautoplay",
55
"authors": ["Jordy van Dortmont"],
66
"tags": ["audio"],
7-
"async" : true,
8-
"warnings": [],
9-
"knownBugs": []
7+
"async": true
108
}
119
!*/
1210
/* DOC

feature-detects/canvas/blending.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"name": "canvas blending support",
44
"property": "canvasblending",
55
"tags": ["canvas"],
6-
"async" : false,
76
"notes": [{
87
"name": "HTML5 Spec",
98
"href": "https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending"

feature-detects/canvas/todataurl.js

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"property": ["todataurljpeg", "todataurlpng", "todataurlwebp"],
55
"tags": ["canvas"],
66
"builderAliases": ["canvas_todataurl_type"],
7-
"async" : false,
87
"notes": [{
98
"name": "MDN article",
109
"href": "https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement.toDataURL"

feature-detects/canvas/winding.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"name": "canvas winding support",
44
"property": "canvaswinding",
55
"tags": ["canvas"],
6-
"async" : false,
76
"notes": [{
87
"name": "Article",
98
"href": "https://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/"

feature-detects/crypto.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"name": "W3C Editor's Draft",
1010
"href": "https://www.w3.org/TR/WebCryptoAPI/"
1111
}],
12-
"polyfills": [
13-
"polycrypt"
14-
]
12+
"polyfills": ["polycrypt"]
1513
}
1614
!*/
1715
/* DOC

feature-detects/crypto/getrandomvalues.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"name": "W3C Editor’s Draft",
1010
"href": "https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#RandomSource-method-getRandomValues"
1111
}],
12-
"polyfills": [
13-
"polycrypt"
14-
]
12+
"polyfills": ["polycrypt"]
1513
}
1614
!*/
1715
/* DOC

feature-detects/css/ellipsis.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"name": "CSS text-overflow ellipsis",
44
"property": "ellipsis",
55
"caniuse": "text-overflow",
6-
"polyfills": [
7-
"text-overflow"
8-
],
6+
"polyfills": ["text-overflow"],
97
"tags": ["css"]
108
}
119
!*/

feature-detects/css/hyphens.js

-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ define(['Modernizr', 'prefixes', 'createElement', 'testAllProps', 'addTest'], fu
9999
div.appendChild(span);
100100
document.body.insertBefore(div, firstChild);
101101

102-
103102
/* get height of unwrapped text */
104103
span.innerHTML = 'mm';
105104
spanSize = span.offsetHeight;
@@ -152,7 +151,6 @@ define(['Modernizr', 'prefixes', 'createElement', 'testAllProps', 'addTest'], fu
152151
document.body.insertBefore(div, firstChild);
153152
document.body.insertBefore(dummy, div);
154153

155-
156154
/* reset the selection to the dummy input element, i.e. BEFORE the div container
157155
* stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area */
158156
if (dummy.setSelectionRange) {

feature-detects/css/positionsticky.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "Chrome bug report",
99
"href":"https://code.google.com/p/chromium/issues/detail?id=322972"
1010
}],
11-
"warnings": [ "using position:sticky on anything but top aligned elements is buggy in Chrome < 37 and iOS <=7+" ]
11+
"warnings": ["using position:sticky on anything but top aligned elements is buggy in Chrome < 37 and iOS <=7+"]
1212
}
1313
!*/
1414
define(['Modernizr', 'createElement', 'prefixes'], function(Modernizr, createElement, prefixes) {

feature-detects/css/regions.js

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ define(['Modernizr', 'createElement', 'docElement', 'isSVG', 'prefixed'], functi
6262
var flowedRect, delta;
6363
var plainRect = content.getBoundingClientRect();
6464

65-
6665
content.style[flowIntoProperty] = flowName;
6766
flowedRect = content.getBoundingClientRect();
6867

feature-detects/custom-protocol-handler.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
},{
1111
"name": "MDN documentation",
1212
"href": "https://developer.mozilla.org/en-US/docs/Web/API/navigator.registerProtocolHandler"
13-
}],
14-
"warnings": [],
15-
"polyfills": []
13+
}]
1614
}
1715
!*/
1816
/* DOC

feature-detects/gamepad.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
},{
1111
"name": "HTML5 Rocks tutorial",
1212
"href": "https://www.html5rocks.com/en/tutorials/doodles/gamepad/#toc-featuredetect"
13-
}],
14-
"warnings": [],
15-
"polyfills": []
13+
}]
1614
}
1715
!*/
1816
/* DOC

feature-detects/iframe/sandbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "WhatWG Spec",
1010
"href": "https://html.spec.whatwg.org/multipage/embedded-content.html#attr-iframe-sandbox"
1111
}],
12-
"knownBugs": [ "False-positive on Firefox < 29" ]
12+
"knownBugs": ["False-positive on Firefox < 29"]
1313
}
1414
!*/
1515
/* DOC

feature-detects/input/formaction.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
"name": "Wufoo demo",
1111
"href": "https://www.wufoo.com/html5/attributes/13-formaction.html"
1212
}],
13-
"polyfills": [
14-
"webshims"
15-
]
13+
"polyfills": ["webshims"]
1614
}
1715
!*/
1816
/* DOC

feature-detects/input/formenctype.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
"name": "Wufoo demo",
1111
"href": "https://www.wufoo.com/html5/attributes/16-formenctype.html"
1212
}],
13-
"polyfills": [
14-
"html5formshim"
15-
]
13+
"polyfills": ["html5formshim"]
1614
}
1715
!*/
1816
/* DOC

feature-detects/input/formmethod.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"name": "Wufoo demo",
1010
"href": "https://www.wufoo.com/html5/attributes/14-formmethod.html"
1111
}],
12-
"polyfills": [
13-
"webshims"
14-
]
12+
"polyfills": ["webshims"]
1513
}
1614
!*/
1715
/* DOC

feature-detects/input/formnovalidate.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
"name": "Wufoo demo",
1111
"href": "https://www.wufoo.com/html5/attributes/12-formnovalidate.html"
1212
}],
13-
"polyfills": [
14-
"html5formshim"
15-
]
13+
"polyfills": ["html5formshim"]
1614
}
1715
!*/
1816
/* DOC

feature-detects/input/formtarget.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
"name": "Wufoo demo",
1111
"href": "https://www.wufoo.com/html5/attributes/15-formtarget.html"
1212
}],
13-
"polyfills": [
14-
"html5formshim"
15-
]
13+
"polyfills": ["html5formshim"]
1614
}
1715
!*/
1816
/* DOC

feature-detects/mediaquery/hovermq.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/*!
22
{
33
"name": "Hover Media Query",
4-
"property": "hovermq",
5-
"notes": [{
6-
"name": "//Name of reference document",
7-
"href": "//URL of reference document"
8-
}]
4+
"property": "hovermq"
95
}
106
!*/
117
/* DOC

feature-detects/mediaquery/pointermq.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/*!
22
{
33
"name": "Pointer Media Query",
4-
"property": "pointermq",
5-
"notes": [{
6-
"name": "//Name of reference document",
7-
"href": "//URL of reference document"
8-
}]
4+
"property": "pointermq"
95
}
106
!*/
117
/* DOC

feature-detects/notification.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
"name": "Changes in Chrome to Notifications API due to Service Worker Push Notifications",
1515
"href": "https://developers.google.com/web/updates/2015/05/Notifying-you-of-notificiation-changes"
1616
}],
17-
"knownBugs": [
18-
"Possibility of false-positive on Chrome for Android if permissions we're granted for a website prior to Chrome 44."
19-
],
17+
"knownBugs": ["Possibility of false-positive on Chrome for Android if permissions we're granted for a website prior to Chrome 44."],
2018
"polyfills": ["desktop-notify", "html5-notifications"]
2119
}
2220
!*/

feature-detects/storage/localstorage.js

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
"property": "localstorage",
55
"caniuse": "namevalue-storage",
66
"tags": ["storage"],
7-
"knownBugs": [],
8-
"notes": [],
9-
"warnings": [],
107
"polyfills": [
118
"joshuabell-polyfill",
129
"cupcake",

0 commit comments

Comments
 (0)