Skip to content

Commit

Permalink
feat(eslint): forbid to use it.only and describe.only
Browse files Browse the repository at this point in the history
  • Loading branch information
Heymdall committed May 6, 2021
1 parent 8e8da8e commit dd83d79
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ module.exports = {
// code smell detection
complexity: ['warn', 20],
'max-nested-callbacks': 'warn',
'no-restricted-properties': [
'error',
{
object: 'it',
property: 'only',
message: "Don't you forget to remove 'only' from this test?",
},
{
object: 'describe',
property: 'only',
message: "Don't you forget to remove 'only' from this test?",
},
],

// React
'react/jsx-indent': ['warn', 4],
Expand Down
5 changes: 5 additions & 0 deletions test/js-input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ function definedAfterUsage() {
}

export const element = <div style={ { color: 'black' } } />;

const it = () => {};

// eslint-disable-next-line no-restricted-properties
it.only('this is a test');

0 comments on commit dd83d79

Please sign in to comment.