eslint-rules icon indicating copy to clipboard operation
eslint-rules copied to clipboard

no-commented-out-code is not detecting errors in jest tests

Open wattry opened this issue 5 years ago • 1 comments

I am trying to ensure commented out code is not submit in any of our projects.

I have the following .eslintrc and I am using a jest plugin so that errors are not thrown for functions that don't exist.

{
 {
  "env": {
    "es6": true,
    "browser": false,
    "node": true
  },
  "extends": [
    "eslint:recommended",
    "airbnb",
    "plugin:prettier/recommended",
    "plugin:jest/recommended"
  ],
  "plugins": ["extra-rules",
    "jest"
  ],
  "parserOptions": {
    "ecmaVersion": 2018
  },
  "rules": {
    "prettier/prettier": "error",
    "no-console": "off",
    "extra-rules/no-commented-out-code": "error",
    "no-use-before-define": ["error", {
      "functions": false
    }]
  }
}

When I comment out code in my rootdir/app*.js it detects the issues. However, if I comment out code in my tests located at rootdir/test/*.js no issues are output.

I expect the issues to be submit on all js files.

wattry avatar Apr 02 '19 16:04 wattry

Happening also when using a mocha like structure: describe ... it ...

jarrietas avatar Sep 26 '19 15:09 jarrietas