Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
chore(eslint-config): disallow .only to be used in tests (#185)
Browse files Browse the repository at this point in the history
#### What this PR does / why we need it:

As per title.
  • Loading branch information
fuxingloh committed Jun 19, 2023
1 parent a652172 commit 52c338a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
plugins: ['simple-import-sort', 'check-file', 'unused-imports'],
plugins: ['simple-import-sort', 'check-file', 'unused-imports', 'no-only-tests'],
extends: ['airbnb-base', 'airbnb-typescript/base', 'prettier', 'plugin:anti-trojan-source/recommended'],
ignorePatterns: ['dist'],
rules: {
Expand Down Expand Up @@ -70,6 +70,11 @@ module.exports = {
'Do not use ambiguous identifiers like `id`, use context identifiers like `userId` or `postId` instead.',
},
],

/**
* disallow .only to be used in tests
*/
'no-only-tests/no-only-tests': 'error',
},
env: {
node: true,
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"eslint-plugin-anti-trojan-source": "^1.1.1",
"eslint-plugin-check-file": "^2.4.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0"
}
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 52c338a

Please sign in to comment.