diff --git a/js/tests/unit/.eslintrc.json b/js/tests/unit/.eslintrc.json index e7f8d5d2a..806dcf8a0 100644 --- a/js/tests/unit/.eslintrc.json +++ b/js/tests/unit/.eslintrc.json @@ -1,16 +1,37 @@ { "root": true, - "extends": [ - "../../../.eslintrc.json" + "env": { + "jasmine": true + }, + "plugins": [ + "jasmine" ], - "overrides": [ - { - "files": [ - "**/*.spec.js" - ], - "env": { - "jasmine": true - } - } - ] + "extends": [ + "../../../.eslintrc.json", + "plugin:jasmine/recommended" + ], + "rules": { + "jasmine/expect-matcher": "error", + "jasmine/expect-single-argument": "off", + "jasmine/missing-expect": [ + "error", + "expect()", + "testElementIsActiveAfterScroll()" + ], + "jasmine/named-spy": "off", + "jasmine/new-line-before-expect": "off", + "jasmine/new-line-between-declarations": "error", + "jasmine/no-disabled-tests": "error", + "jasmine/no-expect-in-setup-teardown": "error", + "jasmine/no-focused-tests": "error", + "jasmine/no-global-setup": "error", + "jasmine/no-pending-tests": "error", + "jasmine/no-promise-without-done-fail": "error", + "jasmine/no-spec-dupes": "off", + "jasmine/no-suite-callback-args": "error", + "jasmine/no-suite-dupes": "error", + "jasmine/no-unsafe-spy": "error", + "jasmine/prefer-jasmine-matcher": "error", + "jasmine/prefer-toHaveBeenCalledWith": "off" + } } diff --git a/package-lock.json b/package-lock.json index caa899ea1..31ee9bd01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4048,6 +4048,12 @@ } } }, + "eslint-plugin-jasmine": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jasmine/-/eslint-plugin-jasmine-4.1.1.tgz", + "integrity": "sha512-uS7kvt7RPUB/gLDwhJ/Ax0APrmkj7In8VJWkiZLYHafz2Ix74mMRJx82YZZ3zHRa/YOuTL+ig6dW/aKwdNzUuw==", + "dev": true + }, "eslint-plugin-unicorn": { "version": "23.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-23.0.0.tgz", diff --git a/package.json b/package.json index b4545406c..f0d37dc64 100644 --- a/package.json +++ b/package.json @@ -106,6 +106,7 @@ "eslint": "^7.14.0", "eslint-config-xo": "^0.33.1", "eslint-plugin-import": "^2.22.1", + "eslint-plugin-jasmine": "^4.1.1", "eslint-plugin-unicorn": "^23.0.0", "find-unused-sass-variables": "^3.0.0", "glob": "^7.1.6",