Skip to content

frontend: add multi-line assignment lint for better formatting#4171

Open
thisconnect wants to merge 2 commits into
BitBoxSwiss:masterfrom
thisconnect:frontend-lint-multiline-assignment-parens
Open

frontend: add multi-line assignment lint for better formatting#4171
thisconnect wants to merge 2 commits into
BitBoxSwiss:masterfrom
thisconnect:frontend-lint-multiline-assignment-parens

Conversation

@thisconnect

Copy link
Copy Markdown
Collaborator

It visually communicates:

  • this assignment spans multiple lines
  • the entire expression is grouped
  • operator hierarchy matters here

without needing mental parsing.

And according to GPT: this soft-bracket style is surprisingly AI-friendly because it creates very obvious expression boundaries.

@thisconnect thisconnect left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 questions

  • do you like the style change?
  • should we add the plugin locally in the same repo?

cc @shonsirsha @bznein @Beerosagos wdyt?

import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import stylistic from '@stylistic/eslint-plugin';
import { softBrackets } from './node_vendor/eslint-plugin-soft-brackets/lib/index.js';

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add such a custom lint plugin locally in the same repo? (currently using node_vendor but it could be anywhere)

@thisconnect thisconnect marked this pull request as ready for review May 28, 2026 07:05
@thisconnect thisconnect requested a review from a team as a code owner May 28, 2026 07:05
@bznein

bznein commented May 28, 2026

Copy link
Copy Markdown
Collaborator

2 questions

  • do you like the style change?

I do! It reads more clearly imho!

  • should we add the plugin locally in the same repo?

I don't really have an opinion here to be honest, either is fine for me

@thisconnect thisconnect force-pushed the frontend-lint-multiline-assignment-parens branch from 6ecc3d0 to b381217 Compare May 28, 2026 14:13
@thisconnect

Copy link
Copy Markdown
Collaborator Author

rebased

@thisconnect thisconnect force-pushed the frontend-lint-multiline-assignment-parens branch from b381217 to f423519 Compare June 2, 2026 07:33
@thisconnect

Copy link
Copy Markdown
Collaborator Author

rebased

@Beerosagos Beerosagos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't look into implementation details, but cACK

@thisconnect thisconnect force-pushed the frontend-lint-multiline-assignment-parens branch from f423519 to 7ab64dc Compare June 4, 2026 09:57
@thisconnect thisconnect deleted the frontend-lint-multiline-assignment-parens branch June 24, 2026 15:06
@thisconnect thisconnect restored the frontend-lint-multiline-assignment-parens branch June 24, 2026 15:09
@thisconnect thisconnect reopened this Jun 24, 2026
It visually communicates:

- this assignment spans multiple lines
- the entire expression is grouped
- operator hierarchy matters here

without needing mental parsing.

And according to GPT: this soft-bracket style is surprisingly
AI-friendly because it creates very obvious expression boundaries.
@thisconnect thisconnect force-pushed the frontend-lint-multiline-assignment-parens branch from 7ab64dc to 971656f Compare June 24, 2026 15:10
@thisconnect

Copy link
Copy Markdown
Collaborator Author

rebased

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants