diff --git a/index.js b/index.js index 411a483..da64fab 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ module.exports = { }, extends: 'eslint:recommended', plugins: [ - 'no-only-tests' + 'jest' ], rules: { // Possible Errors (http://eslint.org/docs/rules/#possible-errors) @@ -181,6 +181,14 @@ module.exports = { 'space-infix-ops': ['error', {int32Hint: true}], 'space-unary-ops': 'error', - 'no-only-tests/no-only-tests': 'error' + // Jest plugin (https://github.com/jest-community/eslint-plugin-jest) + 'jest/no-disabled-tests': 'warn', + 'jest/no-focused-tests': 'error', + 'jest/no-identical-title': 'error', + 'jest/no-large-snapshots': 'off', + 'jest/prefer-to-have-length': 'error', + 'jest/prefer-to-be-null': 'error', + 'jest/prefer-to-be-undefined': 'error', + 'jest/valid-expect': 'error' } }; diff --git a/package-lock.json b/package-lock.json index fe9d58b..b786f0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -362,10 +362,10 @@ "text-table": "0.2.0" } }, - "eslint-plugin-no-only-tests": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.0.0.tgz", - "integrity": "sha512-1huEDo1+Yu2thtdxxzkB0lfPlD1ltNqxyFAO4HfFjB5AVh7FCsAENtJtCjMXmUjyCKgeF1bTnDFJqpIWMkdZtA==", + "eslint-plugin-jest": { + "version": "21.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.5.0.tgz", + "integrity": "sha512-4fxfe2RcqzU+IVNQL5n4pqibLcUhKKxihYsA510+6kC/FTdGInszDDHgO4ntBzPWu8mcHAvKJLs8o3AQw6eHTg==", "dev": true }, "eslint-scope": { diff --git a/package.json b/package.json index 47110ce..2a0922b 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,10 @@ "homepage": "https://github.com/cheminfo/eslint-config#readme", "peerDependencies": { "eslint": ">=4.2.0", - "eslint-plugin-no-only-tests": ">=1.1.0" + "eslint-plugin-jest": ">=21.5.0" }, "devDependencies": { "eslint": "^4.12.1", - "eslint-plugin-no-only-tests": "^2.0.0" + "eslint-plugin-jest": "^21.5.0" } } diff --git a/test/test.js b/test/test.js index fc49963..d8c5807 100644 --- a/test/test.js +++ b/test/test.js @@ -7,8 +7,11 @@ const util = require('util'); const linter = require('eslint').linter; const config = require('../index'); -delete config.plugins; -delete config.rules['no-only-tests/no-only-tests']; +for (const rule of Object.keys(config.rules)) { + if (rule.startsWith('jest/')) { + delete config.rules[rule]; + } +} const ok = fs.readFileSync(__dirname + '/ok.js', 'utf8'); const notOk = fs.readFileSync(__dirname + '/not-ok.js', 'utf8');