From 44e6abcba50309df4fae56a9c7ef79145b64a356 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 21 Feb 2019 15:55:16 +0200 Subject: Switch to eslint-config-xo and eslint-plugin-unicorn. --- js/tests/unit/.eslintrc.json | 48 +++++++++++++++++++++++++++----------------- js/tests/unit/tab.js | 2 +- 2 files changed, 31 insertions(+), 19 deletions(-) (limited to 'js') diff --git a/js/tests/unit/.eslintrc.json b/js/tests/unit/.eslintrc.json index 19ab5d998..cafe9c04e 100644 --- a/js/tests/unit/.eslintrc.json +++ b/js/tests/unit/.eslintrc.json @@ -1,6 +1,6 @@ { + "root": true, "env": { - "es6": false, "jquery": true, "qunit": true }, @@ -23,23 +23,35 @@ "ecmaVersion": 5, "sourceType": "script" }, - "extends": "../../../.eslintrc.json", + "extends": [ + "plugin:unicorn/recommended", + "xo", + "xo/browser" + ], "rules": { - "no-console": "error", - // Best Practices - "consistent-return": "off", - "no-magic-numbers": "off", - "vars-on-top": "off", - - // Stylistic Issues - "func-style": "off", - "spaced-comment": "off", - - // ECMAScript 6 - "no-var": "off", - "object-shorthand": "off", - "prefer-arrow-callback": "off", - "prefer-template": "off", - "prefer-rest-params": "off" + "capitalized-comments": "off", + "indent": [ + "error", + 2, + { + "MemberExpression": "off", + "SwitchCase": 1 + } + ], + "multiline-ternary": [ + "error", + "always-multiline" + ], + "object-curly-spacing": [ + "error", + "always" + ], + "semi": [ + "error", + "never" + ], + "strict": "error", + "unicorn/filename-case": "off", + "unicorn/no-unused-properties": "error" } } diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 114e97610..0675126f8 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -1,7 +1,7 @@ $(function () { 'use strict' - var Tab = typeof window.bootstrap !== 'undefined' ? window.bootstrap.Tab : window.Tab + var Tab = typeof window.bootstrap === 'undefined' ? window.Tab : window.bootstrap.Tab QUnit.module('tabs plugin') -- cgit v1.2.3