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
tomassentkeresty opened this issue Jan 28, 2018 · 4 comments · May be fixed by ali8889/emerald-wallet#4, Dizzydaizys/yarn#9 or DmytroSkrypnyk/test_bootstrap#6

Comments

@tomassentkeresty
Copy link

@tomassentkeresty tomassentkeresty 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 eslint bot added the triage label Jan 28, 2018
@tomassentkeresty

This comment has been minimized.

Copy link
Author

@tomassentkeresty tomassentkeresty commented Jan 28, 2018

Closing in respect to #9906.

@platinumazure

This comment has been minimized.

Copy link
Member

@platinumazure platinumazure commented Jan 29, 2018

Reopening so I can tie this to my pull request.

@platinumazure platinumazure reopened this Jan 29, 2018
platinumazure added a commit that referenced this issue Jan 29, 2018
)
@bladedancer

This comment has been minimized.

Copy link

@bladedancer 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

This comment has been minimized.

Copy link
Member

@platinumazure platinumazure commented Feb 5, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.