Skip to content

Commit 24ea366

Browse files
authored
Add no-only-tests JS linter rule to detect test.only and suite.only
1 parent fd86832 commit 24ea366

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

.eslintrc.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ module.exports = {
88
node: true
99
},
1010
extends: [require.resolve('./lib/configs/recommended'), 'plugin:eslint-plugin/all'],
11-
plugins: ['eslint-plugin'],
11+
plugins: ['eslint-plugin', 'no-only-tests'],
1212
rules: {
1313
'import/no-commonjs': 'off',
1414
'filenames/match-regex': 'off',
1515
'i18n-text/no-en': 'off',
1616
'eslint-plugin/prefer-placeholders': 'off',
1717
'eslint-plugin/test-case-shorthand-strings': 'off',
18-
'eslint-plugin/require-meta-docs-url': 'off'
18+
'eslint-plugin/require-meta-docs-url': 'off',
19+
'no-only-tests/no-only-tests': [
20+
'error',
21+
{
22+
'block': ['describe', 'it', 'context', 'test', 'tape', 'fixture', 'serial', 'suite']
23+
}
24+
]
1925
}
2026
}

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@github/prettier-config": "0.0.4",
5050
"eslint": "7.23.0",
5151
"eslint-plugin-eslint-plugin": "^2.3.0",
52+
"eslint-plugin-no-only-tests": "^2.6.0",
5253
"eslint-visitor-keys": "^2.0.0",
5354
"globals": "^13.7.0",
5455
"mocha": "^8.3.2"

0 commit comments

Comments
 (0)