Enable the no-var ESLint rule in the /web folder

https://eslint.org/docs/rules/no-var

Please note that two files were excluded:
 1. `web/debugger.js`, since there's code in other files that currently depend on the global availability of code in `web/debugger.js`. Furthermore, since that file isn't used in production, doing a ES6 conversion probably isn't a priority.

 2. `web/grab_to_pan.js`, since that file could be considered to be "external" code. We have made smaller changes to that file over the years, however doing a full ES6 `class` conversion might be a step too far!?
This commit is contained in:
Jonas Jenwald 2017-11-04 13:50:58 +01:00
parent ad0c1fb2c0
commit d70263ced8
4 changed files with 13 additions and 0 deletions

View File

@ -166,6 +166,7 @@
"no-useless-computed-key": "error", "no-useless-computed-key": "error",
"no-useless-constructor": "error", "no-useless-constructor": "error",
"no-useless-rename": "error", "no-useless-rename": "error",
"no-var": "off",
"object-shorthand": ["error", "always", { "object-shorthand": ["error", "always", {
"avoidQuotes": true, "avoidQuotes": true,
}], }],

10
web/.eslintrc Normal file
View File

@ -0,0 +1,10 @@
{
"extends": [
../.eslintrc
],
"rules": {
// ECMAScript 6
"no-var": "error",
},
}

View File

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable no-var */
'use strict'; 'use strict';

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable no-var */
/** /**
* Construct a GrabToPan instance for a given HTML element. * Construct a GrabToPan instance for a given HTML element.