bahmutov / eslint-rules

My custom eslint rules in addition to the ones provided at http://eslint.org/
97 stars 16 forks source link

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

Open wattry opened 5 years ago

wattry commented 5 years ago

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.

jarrietas commented 4 years ago

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