From 99a53f43d090f958a337e2a0e51f230f0c20097a Mon Sep 17 00:00:00 2001 From: Anatoli Huseu Date: Wed, 13 Nov 2019 14:35:39 +0300 Subject: [PATCH] feat: add jest support --- eslint/typescript.js | 13 +++++++++++++ package-lock.json | 15 ++++++++++----- package.json | 1 + 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/eslint/typescript.js b/eslint/typescript.js index 59927cf..7e13b17 100644 --- a/eslint/typescript.js +++ b/eslint/typescript.js @@ -43,4 +43,17 @@ module.exports = { version: 'detect', }, }, + overrides: [ + { + files: ['**/*.{test,spec}.{js,ts,tsx}'], + env: { + jest: true, + }, + plugins: ['testing-library'], + extends: ['plugin:testing-library/react'], + rules: { + '@typescript-eslint/ban-ts-ignore': 0, + }, + }, + ], } diff --git a/package-lock.json b/package-lock.json index 4f3ea2e..7b87e05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -752,6 +752,11 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.2.0.tgz", "integrity": "sha512-jSlnBjV2cmyIeL555H/FbvuSbQ1AtpHjLMHuPrQnt1eVA6lX8yufdygh7AArI2m8ct7ChHGx2uOaCuxq2MUn6g==" }, + "eslint-plugin-testing-library": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-testing-library/-/eslint-plugin-testing-library-1.3.2.tgz", + "integrity": "sha512-ZrJGex7YbaymUvSxgMJp1MmqqJo0OvElcd3XImtIHBbzPPnBhvExl+s+//yYlP8QO+jZCvyHGx/4rGGsKU2UTw==" + }, "eslint-scope": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", @@ -1670,12 +1675,12 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -1832,7 +1837,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, "p-finally": { @@ -1893,7 +1898,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { @@ -2291,7 +2296,7 @@ }, "through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "tmp": { diff --git a/package.json b/package.json index 7461d2d..ab79973 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "eslint-plugin-prettier": "^3.1.1", "eslint-plugin-react": "^7.16.0", "eslint-plugin-react-hooks": "^2.2.0", + "eslint-plugin-testing-library": "^1.3.2", "husky": "^3.0.9", "lint-staged": "^9.4.2", "prettier": "1.19.1"