Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non reporting errors for redundant space between "typeof" and "(" - related to "space-unary-ops" rule. #9907

Closed
chiptoe opened this issue Jan 28, 2018 · 4 comments · Fixed by Urigo/tortilla#62, mono-js/mono-notifications#5, mono-js/mono-push#5 or terrajs/lib-starter#5 · May be fixed by ali8889/emerald-wallet#4
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@chiptoe
Copy link

chiptoe commented Jan 28, 2018

Tell us about your environment

  • ESLint Version: v4.16.0
  • Node Version: v6.10.2
  • npm Version: v5.6.0

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

Please show your full configuration:

Configuration
{
    "extends": "airbnb-base",
    "rules": {
        "prefer-arrow-callback": "off",
        "func-names": ["error", "never"],
        "space-before-function-paren": ["error", "never"],
        "indent": ["error", 4],
        "no-var": "off",
        "object-shorthand": ["error", "never"],
        "prefer-destructuring": "off",
        "import/no-unresolved": [2, {"commonjs": true}],
        "import/no-dynamic-require": "warn",
        "global-require": "warn",
        "vars-on-top": "off",
        "no-param-reassign": "off",
        "eqeqeq": "off",
        "no-use-before-define": ["error", {"functions": false}],
        "prefer-template": "off",
        "no-shadow": "off",
        "max-len": "off",
        "comma-dangle": ["error", "never"],
        "no-restricted-syntax": ["error", "BinaryExpression[operator='in']"],
        "no-continue": "off",
        "no-plusplus": "off",
        "brace-style": ["error", "stroustrup", {"allowSingleLine": false}],
        "space-unary-ops": [2, {
            "overrides": {
                "typeof": false
            }
        }]
    }
}

Last config is critical

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

var obj = null;
if (typeof (obj) === 'object') {
    console.log("THIS SHOULD REPORT ERROR BETWEEN 'typeof' AND '('. BUT IT DOESN'T");
}
if (typeof(obj) === 'object') {
    console.log('THIS IS OK AS IT DOES NOT REPORT ERROR.');
}
./node_modules/.bin/eslint issue.js

What did you expect to happen?
First case with typeof (obj) === 'object' should report error.

What actually happened? Please include the actual, raw output from ESLint.
No error was reported in first case. Actually there is nothing to show from console.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jan 28, 2018
@chiptoe
Copy link
Author

chiptoe commented Jan 28, 2018

Closing in respect to #9906.

@chiptoe chiptoe closed this as completed Jan 28, 2018
@platinumazure platinumazure added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Jan 29, 2018
@platinumazure
Copy link
Member

Reopening so I can tie this to my pull request.

@bladedancer
Copy link

bladedancer commented Feb 5, 2018

This fix breaks: yield [1, 2, 3]
Is that the expected behaviour?

Hmm ignore that - I see from 9906 it is the "expected" behaviour.

@platinumazure
Copy link
Member

platinumazure commented Feb 5, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.