aboutsummaryrefslogtreecommitdiffstats
path: root/.eslintrc-browser.json
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2016-11-03 00:51:34 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2016-12-19 02:07:03 +0100
commitcbc8638c38bccd4ac7b787ac4d79de4bf2b6a0a0 (patch)
treeec976a0dafcfef8dbadb89621220932f15e93cdc /.eslintrc-browser.json
parent5d79c6466386862e70ce276a094c1897112b7491 (diff)
downloadjquery-cbc8638c38bccd4ac7b787ac4d79de4bf2b6a0a0.tar.gz
jquery-cbc8638c38bccd4ac7b787ac4d79de4bf2b6a0a0.zip
Build: ESLint setup improvements
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).
Diffstat (limited to '.eslintrc-browser.json')
-rw-r--r--.eslintrc-browser.json31
1 files changed, 31 insertions, 0 deletions
diff --git a/.eslintrc-browser.json b/.eslintrc-browser.json
new file mode 100644
index 000000000..c704209ab
--- /dev/null
+++ b/.eslintrc-browser.json
@@ -0,0 +1,31 @@
+{
+ "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"]
+ }
+}