space-in-parens throws false positive inside if condition between closing parens
See original GitHub issueTell us about your environment
- ESLint Version: 5.6.1
- Node Version: 8.11.4
- npm Version: 5.6.0
What parser (default, Babel-ESLint, etc.) are you using? Default
Please show your full configuration:
{
"plugins": [
"cypress",
"chai-friendly"
],
"env": {
"cypress/globals": true
},
"extends": [
"eslint:recommended",
"standard"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"globals": {
"App": true
},
"rules": {
"max-len": [
"error", {
"code": 80,
"tabWidth": 2
}
],
"space-in-parens": ["error", "never", {
"exceptions": ["()"]
}],
"no-unused-expressions": 0,
"chai-friendly/no-unused-expressions": 2
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Code which exhibits the bug:
const theTrueFunc = () => true
// this will complain that there is no space after the function call and the closing if bracket
if (theTrueFunc()) {
console.log('True dat')
}
What did you expect to happen? Should not have to insert space after function
What actually happened? Please include the actual, raw output from ESLint.
/home/grayedfox/github/comgy/mh-tests/cypress/support/helpers.js
8:32 error There must be a space inside this paren space-in-parens
✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
space-in-parens - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Reduce smelling code and detect JavaScript issues with ESLint
Problem statement: Smelling Code Have you ever had to fix an error in someone else's code - but you had to reformat the...
Read more >Diff - 402e1b6e55e9041dfd1a93580e45e5c5dba1db55^!
+ + "License" shall mean the terms and conditions for use, ... 61dfe68 Fix: `no-useless-rename` false positive in babel-eslint (fixes #6266) ...
Read more >Different Results With Parentheses and Variable Placement in ...
I was under the impression that the placement of the variable in this conditional if statement didn't matter if I was using the...
Read more >eslint-config-dbk - npm
shareable eslint config. Latest version: 3.3.4, last published: 4 years ago. Start using eslint-config-dbk in your project by running `npm i ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @GrayedFox, thanks for the issue.
I’ve just read the docs, and I think the key point is that any tokens listed in the rule’s
exceptions
option must completely surround the expression.Some examples:
If you think the documentation could be improved, we would welcome a pull request!
Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.
Thanks for contributing to ESLint and we appreciate your understanding.