aboutsummaryrefslogtreecommitdiffstats
path: root/src/.eslintrc.json
Commit message (Collapse)AuthorAgeFilesLines
* Build: Make the import/no-unused-modules ESLint rule work in WebStormMichał Gołębiowski-Owczarek2020-09-021-1/+10
| | | | | | | | | | | | | | | | When run via WebStorm, the root path against which paths in the config of the `import/no-unused-modules` ESLint rule are resolved is the path where the ESLint config file that defines the rule lies, i.e. `src`. When run via the command line, it's usually the root folder of the jQuery repository. This pattern intends to catch both. Note that we cannot specify two patterns here: ```js [ "src/*.js", "*.js" ] ``` as they're analyzed individually and the rule crashes if a pattern cannot be matched. Closes gh-4777
* Build:Event: Make sure all source modules' exports are used (#4648)Michał Gołębiowski-Owczarek2020-06-021-0/+4
| | | | | | | To achieve that, use `eslint-plugin-import`'s `no-unused-modules` rule. Also, explicitly import `event/trigger.js` from `jquery.js`; so far it was only imported from ajax.js, making it mistakenly skipped in the `custom:slim,-deprecated` build.
* Build: Followups after introducing ES modules compiled via RollupMichał Gołębiowski-Owczarek2020-05-051-1/+1
| | | | | | | | | | This commit cleans up a few comments & configurations that are out of date after the migration to ES modules backed by a Rollup-based compilation. Also, de-indent AMD modules. This will preserve a more similar structure to the one on 3.x-stable where the body of the main `define` wrapper is not indented. Closes gh-4705
* Build: Correct code indentations based on jQuery Style GuideWonseop Kim2020-05-051-2/+15
| | | | | | | | 1. Correct code indentations based on jQuery Style Guide (contribute.jquery.org/style-guide/js/#spacing). 2. Add rules to "src/.eslintrc.json" to enable "enforcing consistent indentation", with minimal changes to the current code. Closes gh-4672
* Build: Require extensions for ES6 imports, prevent import cyclesMichał Gołębiowski-Owczarek2019-11-251-0/+7
| | | | | | | | | | | | | | | | jQuery source is now authored in ECMAScript modules. Native browser support for them requires full file names including extensions. Rollup works even if import paths don't specify extensions, though, so one import slipped through without such an extension, breaking native browser import of src/jquery.js. A new ESLint rule using eslint-plugin-import prevents us from regressing on that front. Also, eslint-plugin-import's no-cycle rule is used to avoid import cycles. Closes gh-4544 Ref gh-4541 Ref 075320149ae30a5c593c06b2fb015bdf033e0acf
* Core: Migrate from AMD to ES modules 🎉Michał Gołębiowski-Owczarek2019-11-181-1/+32
| | | | | | | | | | | | | | | | | | | | | | 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
* Build: Fix unresolved jQuery reference in finalPropNameMichał Gołębiowski-Owczarek2019-04-171-3/+8
| | | | | | | Also, prevent further similar breakages by changing our ESLint configuration to disallow relying on a global jQuery object in AMD modules. Fixes gh-4358 Closes gh-4361
* Build: Remove obsolete globals from ESLint configurationMichał Gołębiowski-Owczarek2019-02-191-1/+5
| | | | | We had quite a few obsolete globals declared in various ESLint config files. We also no longer allow to rely on the `noGlobal` & `jQuery` globals in the built file which is not needed. Closes gh-4301
* Build: ESLint setup improvementsMichał Gołębiowski2016-12-191-16/+3
| | | | | | | 1. Use the short name of the preset in the config. 2. Run ESLint first on non-minified files. 3. Explicitly specify environments in every config file (those settings cascade which means we've been assuming a Node.js environment where we shouldn't have).
* Build: .eslintrc -> .eslintrc.jsonOleg Gaidarenko2016-08-021-0/+18
`.eslintrc` format is deprecated - http://eslint.org/docs/user-guide/configuring#configuration-file-formats Fixes gh-3248 Closes gh-3247