Skip to content

eslint: add rules for no space inside parentheses#2341

Open
NovemLinguae wants to merge 2 commits intomasterfrom
space-inside-parentheses
Open

eslint: add rules for no space inside parentheses#2341
NovemLinguae wants to merge 2 commits intomasterfrom
space-inside-parentheses

Conversation

@NovemLinguae
Copy link
Copy Markdown
Member

I disagree with not putting space inside parentheses. I'd prefer to do space inside parentheses (MediaWiki style) because that is what my muscle memory is now after years of working on MediaWiki. But I was overruled in #1827

So let's be consistent and enforce no space inside parentheses. This provides efficiency in code review since CI will catch it instead of requiring reviewer bandwidth.

I imagine we used to have a rule that did this, but it was probably lost in the conversion to eslint-config-wikimedia.

  • change eslint rules to:
		"array-bracket-spacing": ["error", "never"],
		"computed-property-spacing": ["error", "never"],
		"space-before-function-paren": ["error", "never"],
		"space-in-parens": ["error", "never"],
		"template-curly-spacing": ["error", "never"],
  • autofix (npm run lint:fix)

I disagree with not putting space inside parentheses. I'd prefer to do space inside parentheses (MediaWiki style) because that is what my muscle memory is now. But I was overruled in #1827

So let's be consistent and enforce no space inside parentheses. This provides efficiency in code review since CI will catch it instead of requiring reviewer bandwidth.

I imagine we used to have a rule that did this, but it was probably lost in the conversion to eslint-config-wikimedia.

- change eslint rules to:
```
		"array-bracket-spacing": ["error", "never"],
		"computed-property-spacing": ["error", "never"],
		"space-before-function-paren": ["error", "never"],
		"space-in-parens": ["error", "never"],
		"template-curly-spacing": ["error", "never"],
```
- autofix (`npm run lint:fix`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant