diff --git a/.editorconfig b/.editorconfig index c7e232aa..2740db33 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,6 +10,6 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.{yml}] +[*.yml] indent_style = space indent_size = 2 diff --git a/src/disablePatches.js b/src/disablePatches.js index 07238a3c..89679b67 100644 --- a/src/disablePatches.js +++ b/src/disablePatches.js @@ -3,7 +3,7 @@ var disabledPatches = Object.create( null ); // Don't apply patches for specified codes. Helpful for code bases -// where some Migrate warnings have been addressed and it's desirable +// where some Migrate warnings have been addressed, and it's desirable // to avoid needless patches or false positives. jQuery.migrateDisablePatches = function() { var i; diff --git a/src/jquery/attributes.js b/src/jquery/attributes.js index 69e5b259..ae6d0ce5 100644 --- a/src/jquery/attributes.js +++ b/src/jquery/attributes.js @@ -110,7 +110,7 @@ migratePatchFunc( jQuery.fn, "toggleClass", function( state ) { // If the element has a class name or if we're passed `false`, // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), + // Otherwise, bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. if ( this.setAttribute ) { this.setAttribute( "class", diff --git a/test/data/test-utils.js b/test/data/test-utils.js index 54f42e22..f9390443 100644 --- a/test/data/test-utils.js +++ b/test/data/test-utils.js @@ -17,15 +17,18 @@ window.expectMessage = function expectMessage( assert, name, expected, fn ) { if ( expected === 0 ) { assert.deepEqual( jQuery.migrateMessages, [], name + ": did not message" ); - // Simple numeric equality assertion for messages matching an explicit count + // Simple numeric equality assertion for messages matching an explicit + // count } else if ( expected && jQuery.migrateMessages.length === expected ) { assert.equal( jQuery.migrateMessages.length, expected, name + ": messaged" ); - // Simple ok assertion when we saw at least one message and weren't looking for an explict count + // Simple ok assertion when we saw at least one message and weren't + // looking for an explicit count } else if ( !expected && jQuery.migrateMessages.length ) { assert.ok( true, name + ": messaged" ); - // Failure; use deepEqual to show the messages that *were* generated and the expectation + // Failure; use deepEqual to show the messages that *were* generated + // and the expectation } else { assert.deepEqual( jQuery.migrateMessages, "", name + ": messaged" diff --git a/test/unit/jquery/css.js b/test/unit/jquery/css.js index d9069da2..20f00e78 100644 --- a/test/unit/jquery/css.js +++ b/test/unit/jquery/css.js @@ -120,7 +120,7 @@ QUnit[ } ); // z-index is tested explicitly as raw jQuery 4.0 will not have `jQuery.cssNumber` - // so iterating over it won't find anything and we'd like to ensure number values + // so iterating over it won't find anything, and we'd like to ensure number values // are not warned against for safe CSS props like z-index (gh-438). expectNoMessage( assert, "z-index", function() { jQuery( "
" ).css( "z-index", 1 ); diff --git a/warnings.md b/warnings.md index f788ce23..8f9edfe7 100644 --- a/warnings.md +++ b/warnings.md @@ -47,7 +47,7 @@ This is _not_ a warning, but a console log message the plugin shows when it firs ### \[fx-interval\] JQMIGRATE: jQuery.fx.interval is removed -**Cause**: As of jQuery 4.0, the `jQuery.fx.interval` property is no longer consulted and it's no longer possible to change the animation interval on browsers that do not support the `window.requestAnimationFrame()` method. +**Cause**: As of jQuery 4.0, the `jQuery.fx.interval` property is no longer consulted, and it's no longer possible to change the animation interval on browsers that do not support the `window.requestAnimationFrame()` method. **Solution**: Find and remove code that changes or uses `jQuery.fx.interval`. If the value is being used by code in your page or a plugin, the code may be making assumptions that are no longer valid. The default value of `jQuery.fx.interval` is `13` (milliseconds), which could be used instead of accessing this property. @@ -98,7 +98,7 @@ This is _not_ a warning, but a console log message the plugin shows when it firs ### \[toggleClass-bool\] JQMIGRATE: `jQuery.fn.toggleClass( \[ boolean \] ) is removed` -**Cause:** Calling `.toggleClass()` with no arguments, or with a single Boolean `true` or `false` argument, has been deprecated. Its behavior was poorly documented, but essentially the method saved away the current `class` value in a data item when the class was removed and restored the saved value when it was toggled back. If you do not believe you are specificially trying to use this form of the method, it is possible you are accidentally doing so via an inadvertent undefined value, as `.toggleClass( undefined )` toggles all classes. +**Cause:** Calling `.toggleClass()` with no arguments, or with a single Boolean `true` or `false` argument, has been deprecated. Its behavior was poorly documented, but essentially the method saved away the current `class` value in a data item when the class was removed and restored the saved value when it was toggled back. If you do not believe you are specifically trying to use this form of the method, it is possible you are accidentally doing so via an inadvertent undefined value, as `.toggleClass( undefined )` toggles all classes. **Solution:** If this functionality is still needed, save the current full `.attr( "class" )` value in a data item and restore it when required.