diff --git a/.editorconfig b/.editorconfig index b5bd7f60ec..0fe2cbbba5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,7 +10,6 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[package.json] +[*.{json,yml}] indent_style = space indent_size = 2 - diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 4154933516..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,14 +0,0 @@ -external -node_modules -*.min.js -dist/** -!dist/jquery.js -test/data/jquery-1.9.1.js -test/data/badcall.js -test/data/badjson.js -test/data/json_obj.js -test/data/readywaitasset.js -test/data/readywaitloader.js -test/data/support/csp.js -test/data/support/getComputedSupport.js -test/node_smoke_tests/lib/ensure_iterability.js diff --git a/.eslintrc-browser.json b/.eslintrc-browser.json deleted file mode 100644 index c704209ab3..0000000000 --- a/.eslintrc-browser.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "root": true, - - "extends": "jquery", - - // Support: IE <=9 only, Android <=4.0 only - // The above browsers are failing a lot of tests in the ES5 - // test suite at http://test262.ecmascript.org. - "parserOptions": { - "ecmaVersion": 3 - }, - - // The browser env is not enabled on purpose so that code takes - // all browser-only globals from window instead of assuming - // they're available as globals. This makes it possible to use - // jQuery with tools like jsdom which provide a custom window - // implementation. - "env": {}, - - "globals": { - "window": true, - "jQuery": true, - "define": true, - "module": true, - "noGlobal": true - }, - - "rules": { - "strict": ["error", "function"] - } -} diff --git a/.eslintrc-node.json b/.eslintrc-node.json deleted file mode 100644 index 904e7ba94d..0000000000 --- a/.eslintrc-node.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "root": true, - - "extends": "jquery", - - "parserOptions": { - "ecmaVersion": 5 - }, - - "env": { - "node": true - } -} diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index d2c977ca85..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "root": true, - - "extends": "./.eslintrc-node.json" -} diff --git a/.gitattributes b/.gitattributes index b7ca95b5b7..5832a0194d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,7 @@ * text=auto # JS files must always use LF for tools to work +# JS files may have mjs or cjs extensions now as well *.js eol=lf +*.cjs eol=lf +*.mjs eol=lf diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 1a95200900..bd4bae5ef8 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -11,10 +11,10 @@ Bug Reports: * Which browsers are affected? Provide a *minimal* test case, see https://webkit.org/test-case-reduction/ Use the latest shipping version of jQuery in your test case! - We prefer test cases on https://jsbin.com or https://jsfiddle.net + We prefer test cases on JS Bin (https://jsbin.com/qawicop/edit?html,css,js,output) or CodePen (https://codepen.io/mgol/pen/wNWJbZ) Frequently Reported Issues: - * Selectors with '#' break: See https://github.com/jquery/jquery/issues/2824 + * Self-closing tags broken in jQuery 3.5.0 or newer: please read the [jQuery 3.5.0 blog post](https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/) & the [upgrade guide](https://jquery.com/upgrade-guide/3.5/); see also issue #4681. --> ### Description ### diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 98d2331b7f..ec0910b10e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,9 +10,7 @@ should start with an issue. Mention the issue number here. Mark an `[x]` for completed items, if you're not sure leave them unchecked and we can assist. --> -* [ ] All authors have signed the CLA at https://cla.js.foundation/jquery/jquery * [ ] New tests have been added to show the fix or feature works -* [ ] Grunt build and unit tests pass locally with these changes * [ ] If needed, a docs issue/PR was created at https://github.com/jquery/api.jquery.com diff --git a/test/data/core/.babelrc.json b/test/data/core/.babelrc.json new file mode 100644 index 0000000000..4328ab218f --- /dev/null +++ b/test/data/core/.babelrc.json @@ -0,0 +1,5 @@ +{ + "plugins": ["@babel/transform-for-of"], + "retainLines": true, + "sourceMaps": "inline" +} diff --git a/test/data/core/aliased.html b/test/data/core/aliased.html index 87b5871f46..519fccfb10 100644 --- a/test/data/core/aliased.html +++ b/test/data/core/aliased.html @@ -2,7 +2,7 @@
-jQuery objects transpiled iterability test page
+ + diff --git a/test/data/core/onready.html b/test/data/core/onready.html index 88ba94a077..1898ea7e75 100644 --- a/test/data/core/onready.html +++ b/test/data/core/onready.html @@ -2,7 +2,7 @@ -CSP Test Page
+ + diff --git a/test/data/csp-ajax-script.js b/test/data/csp-ajax-script.js new file mode 100644 index 0000000000..c6821a24e5 --- /dev/null +++ b/test/data/csp-ajax-script.js @@ -0,0 +1,25 @@ +/* global startIframeTest */ + +var timeoutId, type; + +function finalize() { + startIframeTest( type, window.downloadedScriptCalled ); +} + +timeoutId = setTimeout( function() { + finalize(); +}, 1000 ); + +jQuery + .ajax( { + url: "csp-ajax-script-downloaded.js", + dataType: "script", + method: "POST", + beforeSend: function( _jqXhr, settings ) { + type = settings.type; + } + } ) + .then( function() { + clearTimeout( timeoutId ); + finalize(); + } ); diff --git a/test/data/csp-nonce-external.html b/test/data/csp-nonce-external.html new file mode 100644 index 0000000000..8baa85c751 --- /dev/null +++ b/test/data/csp-nonce-external.html @@ -0,0 +1,13 @@ + + + + +CSP nonce for external script Test Page
+ + diff --git a/test/data/csp-nonce-external.js b/test/data/csp-nonce-external.js new file mode 100644 index 0000000000..27132b3fbe --- /dev/null +++ b/test/data/csp-nonce-external.js @@ -0,0 +1,3 @@ +jQuery( function() { + $( "body" ).append( "" ); +} ); diff --git a/test/data/csp-nonce-globaleval.html b/test/data/csp-nonce-globaleval.html new file mode 100644 index 0000000000..aa620c566e --- /dev/null +++ b/test/data/csp-nonce-globaleval.html @@ -0,0 +1,13 @@ + + + + +CSP nonce via jQuery.globalEval Test Page
+ + diff --git a/test/data/csp-nonce-globaleval.js b/test/data/csp-nonce-globaleval.js new file mode 100644 index 0000000000..8c6cb6346f --- /dev/null +++ b/test/data/csp-nonce-globaleval.js @@ -0,0 +1,3 @@ +jQuery( function() { + $.globalEval( "startIframeTest()", { nonce: "jquery+hardcoded+nonce" } ); +} ); diff --git a/test/data/csp-nonce.html b/test/data/csp-nonce.html new file mode 100644 index 0000000000..d35c33fc48 --- /dev/null +++ b/test/data/csp-nonce.html @@ -0,0 +1,13 @@ + + + + +CSP nonce Test Page
+ + diff --git a/test/data/csp-nonce.js b/test/data/csp-nonce.js new file mode 100644 index 0000000000..547891df51 --- /dev/null +++ b/test/data/csp-nonce.js @@ -0,0 +1,6 @@ +jQuery( function() { + var script = document.createElement( "script" ); + script.setAttribute( "nonce", "jquery+hardcoded+nonce" ); + script.innerHTML = "startIframeTest()"; + $( document.head ).append( script ); +} ); diff --git a/test/data/csp.include.html b/test/data/csp.include.html index 17e2ef0d85..59b87f212a 100644 --- a/test/data/csp.include.html +++ b/test/data/csp.include.html @@ -3,7 +3,7 @@