Eslint: "no-empty-label" error warning when not in config file

Created on 14 Apr 2016  路  3Comments  路  Source: eslint/eslint

What version of ESLint are you using?
2.7.0 (package.json), various others in submodules

What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint

Please show your full configuration:

{
  "extends": "eslint:recommended",
  "parser": "babel-eslint",
  "env": {
    "browser": true,
    "es6": true,
    "jasmine": true,
    "jquery": true,
    "node": true
  },
  "plugins": [
    "babel"
  ],
  "globals": {},
  "settings": {
    "ecamscript": 6
  },
  "parserOptions": {
    "ecmaVersion": 6,
    "ecmaFeatures": {
      "arrowFunctions": true,
      "binaryLiterals": true,
      "blockBindings": true,
      "classes": true,
      "defaultParams": true,
      "destructuring": true,
      "forOf": true,
      "generators": true,
      "modules": true,
      "objectLiteralComputedProperties": true,
      "objectLiteralDuplicateProperties": true,
      "objectLiteralShorthandMethods": true,
      "objectLiteralShorthandProperties": true,
      "octalLiterals": true,
      "regexUFlag": true,
      "regexYFlag": true,
      "restParams": true,
      "spread": true,
      "superInFunctions": true,
      "templateStrings": true,
      "unicodeCodePointEscapes": true,
      # "globalReturn": true,
      "jsx": true
      # "experimentalObjectRestSpread": true
    },
    "sourceType": "module"
  },
  "rules": {
    # Possible Errors
    "comma-dangle": [2, "never"],
    "no-console": 0,
    "no-extra-parens": [2, "functions"],
    "no-inner-declarations": [2, "functions"],

    # Best Practices
    "accessor-pairs": 2,
    "block-scoped-var": 2,
    "complexity": [1, 11],
    "consistent-return": 1,
    "curly": [2, "all"],
    "default-case": 2,
    "dot-notation": [2, {
      "allowKeywords": true,
      "allowPattern": "^[a-z]+(_[a-z]+)+$"
    }],
    "eqeqeq": [2, "smart"],
    "guard-for-in": 1,
    "no-alert": 2,
    "no-caller": 2,
    "no-div-regex": 2,
    "no-else-return": 2,
    "no-eq-null": 2,
    "no-eval": 2,
    "no-extend-native": 2,
    "no-extra-bind": 2,
    "no-floating-decimal": 2,
    "no-implied-eval": 2,
    "no-implicit-coercion": 2,
    "no-iterator": 2,
    "no-labels": 2,
    "no-lone-blocks": 2,
    "no-loop-func": 2,
    "no-multi-spaces": 2,
    "no-multi-str": 2,
    "no-native-reassign": 2,
    "no-new-func": 1,
    "no-new-wrappers": 2,
    "no-new": 2,
    "no-octal-escape": 2,
    "no-param-reassign": 2,
    "no-proto": 2,
    "no-return-assign": 1,
    "no-script-url": 2,
    "no-self-compare": 2,
    "no-sequences": 2,
    "no-throw-literal": 2,
    "no-unused-expressions": 2,
    "no-useless-call": 1,
    "no-void": 2,
    "no-warning-comments": [2, {
      "terms": ["todo", "fixme", "xxx"],
      "location": "start"
    }],
    "no-with": 2,
    "radix": 1,
    "wrap-iife": [2, "inside"],
    "yoda": [2, "never"],

    # Strict Mode
    "strict": [2, "global"],

    # Variables
    "no-undefined": 1,
    "no-unused-vars": [1, {
      "vars": "all",
      "args": "after-used",
      "varsIgnorePattern": "^React$"
    }],

    # Node.js and CommonJS
    "global-require": 1,
    "handle-callback-err": 2,
    "no-mixed-requires": [0, false],
    "no-new-require": 1,

    # Stylistic Issues
    "array-bracket-spacing": [0, "never"],
    "brace-style": [0, "1tbs"],
    "computed-property-spacing": [0, "never"],
    "consistent-this": [0, "that"],
    "func-style": [0, "declaration"],
    "indent": [2, 2, {
      "SwitchCase": 1
    }],
    "jsx-quotes": [2, "prefer-single"],
    "key-spacing": [0, {
      "beforeColon": false,
      "afterColon": true
    }],
    "linebreak-style": [0, "unix"],
    "max-depth": [0, 4],
    "max-len": [0, 80, 4],
    "max-nested-callbacks": [0, 2],
    "max-params": [0, 3],
    "max-statements": [0, 10],
    "new-cap": 2,
    "no-mixed-spaces-and-tabs": [2, false],
    "no-multiple-empty-lines": [0, {
      "max": 2
    }],
    "object-curly-spacing": [0, "never"],
    "one-var": [0, "always"],
    "operator-assignment": [0, "always"],
    "quotes": [2, "single"],
    "semi-spacing": [0, {
      "before": false,
      "after": true
    }],
    "semi": [2, "always"],
    "space-in-parens": [0, "never"],
    "space-unary-ops": [0, {
      "words": true,
      "nonwords": false
    }],

    # ECMAScript 6
    "no-const-assign": 2,
    "no-var": 2,
    "object-shorthand": 0, # See Babel
    "prefer-arrow-callback": 2,
    "prefer-const": 2,
    "prefer-reflect": 2,
    "prefer-spread": 2,
    "prefer-template": 2,

    # Babel
    "babel/generator-star-spacing": 1,
    "babel/new-cap": 1,
    "babel/array-bracket-spacing": 1,
    "babel/object-curly-spacing": [1, "always"],
    "babel/object-shorthand": [1, "always"],
    "babel/arrow-parens": 1,
    "babel/no-await-in-loop": 1
  }
}

What did you do? Please include the actual source code causing the issue.
Any file I create gives the "no-empty-label" error at the top of the file, no matter what is there.

Code Example:

const chai = require('chai');
chai.should();

// the following 3 lines are REQUIRED for all test files
const Lab = require('lab');
const lab = exports.lab = Lab.script();
const serverPromise = require('../../../server');

let SERVER = {};

lab.experiment('system experiments:', () => {
  lab.before((done) => {
    serverPromise
      .then((server) => {
        SERVER = server;
        done();
      });
  });
  lab.test('status route responds with data and 200 status', (done) => {
    const options = {
      method: 'GET',
      url: '/api/status'
    };
    SERVER.inject(options, (response) => {
      const result = response.result;
      console.log(Object.keys(result));
      done();
    });
  });
});

What did you expect to happen?
No linting errors.

What actually happened? Please include the actual, raw output from ESLint.
image

Output on CLI (sample of error on one file). I have 7 total and it's each file at the top:

eslint --ext .js --quiet ./lib/ ./tests/ index.js

/Users/Icehunter/GitHub/project/tests/specs/controllers/system-controller.js
  1:1  error  Rule 'no-empty-label' was removed and replaced by: no-labels  no-empty-label

I'm using atom with eslint plugin as well.

archived due to age question

Most helpful comment

If you want ESLint to stop at the first file it finds, you can add root: true to that file, and it will stop the cascading. Closing, as it looks like the issue is resolved.

All 3 comments

Could you try running eslint filename --print-config? That should print out the whole configuration used to lint this file. If no-empty-label shows up in that list, you could try running eslint filename --debug to see which config files are being loaded. ESLint cascades configuration files, so no-empty-label might be coming from some directory above your current configuration.

...

It seems I had another eslintrc in the parent folder GitHub for some reason. I had incorrectly assumed it would walk the tree until it found one and stopped ^^;

Thanks! Removing that file fixed it all.

If you want ESLint to stop at the first file it finds, you can add root: true to that file, and it will stop the cascading. Closing, as it looks like the issue is resolved.

Was this page helpful?
0 / 5 - 0 ratings