From 3609c88fed4641f00f572365d64edb7042772735 Mon Sep 17 00:00:00 2001 From: Chris Brody Date: Tue, 18 Aug 2020 17:52:19 -0400 Subject: [PATCH] use eslint-plugin-es5 to enforce ES5 (#107) should guard against newer ES6 syntax that could lead to issues with some ES5 environments such as: - Jint - https://github.com/sebastienros/jint - Duktape - IE11 - Android pre-5.0 WebView (already past EOL) as discussed in PR #91 - https://github.com/xmldom/xmldom/pull/91 --- .eslintrc.yml | 2 ++ lib/.eslintrc.yml | 2 ++ package-lock.json | 6 ++++++ package.json | 1 + 4 files changed, 11 insertions(+) create mode 100644 lib/.eslintrc.yml diff --git a/.eslintrc.yml b/.eslintrc.yml index 95b06b9af..d10676da2 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -3,6 +3,8 @@ env: commonjs: true es2020: true node: true +plugins: + - es5 # FUTURE TBD: # extends: 'eslint:recommended' parserOptions: diff --git a/lib/.eslintrc.yml b/lib/.eslintrc.yml new file mode 100644 index 000000000..3eb98abcf --- /dev/null +++ b/lib/.eslintrc.yml @@ -0,0 +1,2 @@ +extends: + - 'plugin:es5/no-es2015' diff --git a/package-lock.json b/package-lock.json index 518f79ef3..febe9c8ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1008,6 +1008,12 @@ } } }, + "eslint-plugin-es5": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es5/-/eslint-plugin-es5-1.5.0.tgz", + "integrity": "sha512-Qxmfo7v2B7SGAEURJo0dpBweFf+JU15kSyALfiB2rXWcBuJ96r6X9kFHXFnhdopPHCaHjoQs1xQPUJVbGMb1AA==", + "dev": true + }, "eslint-scope": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", diff --git a/package.json b/package.json index c1a0e6067..0342bc774 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "@stryker-mutator/javascript-mutator": "^3.3.1", "dom-js": "0.0.9", "eslint": "^7.7.0", + "eslint-plugin-es5": "^1.5.0", "nodemon": "^2.0.4", "npm-run-all": "^4.1.5", "vows": "^0.8.3"