jquery/test/.eslintrc.json
Michał Gołębiowski-Owczarek d0ce00cdfa
Core: Migrate from AMD to ES modules 🎉
Migrate all source AMD modules to ECMAScript modules. The final bundle
is compiled by a custom build process that uses Rollup under the hood.

Test files themselves are still loaded via RequireJS as that has to work in
IE 11.

Tests can now be run in "Load as modules" mode which replaces the previous
"Load with AMD" option. That option of running tests doesn't work in IE
and Edge as it requires support for dynamic imports.

Some of the changes required by the migration:
* check `typeof` of `noGlobal` instead of using the variable directly
  as it's not available when modules are used
* change the nonce module to be an object as ECMASscript module exports
  are immutable
* remove some unused exports
* import `./core/parseHTML.js` directly in `jquery.js` so that it's not
  being cut out when the `ajax` module is excluded in a custom compilation

Closes gh-4541
2019-11-18 21:15:03 +01:00

79 lines
1.4 KiB
JSON

{
"root": true,
"extends": "../.eslintrc-browser.json",
"env": {
// In source the browser env is not enabled but unit tests rely on them
// too much and we don't run them in non-browser environments anyway.
"browser": true
},
"globals": {
"require": false,
"Promise": false,
"Symbol": false,
"QUnit": false,
"ajaxTest": false,
"testIframe": false,
"createDashboardXML": false,
"createWithFriesXML": false,
"createXMLFragment": false,
"moduleTeardown": false,
"url": false,
"q": false,
"jQuery": true,
"sinon": true,
"amdDefined": true,
"fireNative": true,
"Globals": true,
"hasPHP": true,
"isLocal": true,
"supportjQuery": true,
"originaljQuery": true,
"$": true,
"original$": true,
"baseURL": true,
"externalHost": true
},
"rules": {
// See https://github.com/eslint/eslint/issues/2342
"no-unused-vars": "off",
// Too many errors
"max-len": "off",
"brace-style": "off",
"key-spacing": "off",
"camelcase": "off",
"strict": "off",
// Not really too many - waiting for autofix features for these rules
"lines-around-comment": "off",
"dot-notation": "off"
},
"overrides": [
{
"files": [
"data/core/jquery-iterability-transpiled-es6.js",
"data/testinit-jsdom.js"
],
"parserOptions": {
"ecmaVersion": 2015
}
},
{
"files": [
"jquery.js",
"data/testinit.js"
],
"parserOptions": {
"ecmaVersion": 2020
}
}
]
}