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

feat: indent/indentScript option #180

Merged
merged 2 commits into from
Jul 7, 2022

Conversation

tivac
Copy link
Collaborator

@tivac tivac commented Jul 6, 2022

Allows for configuring whether the contents of <script> blocks should be indented a single tabstop or not. Defaults to true for back-compat.

Fixes #155

Allows to configure whether the contents of <script> blocks should be
indented a single tabstop or not. Defaults to true for back-compat.
src/rules/indent-helpers/svelte.ts Outdated Show resolved Hide resolved
@ota-meshi
Copy link
Member

Thank you for this PR! I made one comment.

Copy link
Collaborator

@JounQin JounQin left a comment

Choose a reason for hiding this comment

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

A new config for prettier with this rule disabledd should be added IMO. @ota-meshi

@ota-meshi
Copy link
Member

ota-meshi commented Jul 7, 2022

Normally, the fixture should be formatted. However, stylistic rule invalid tests and option tests may ignore the format.
If we want to ignore settings completely, we need to set it for each rule, valid and invalid directory. Also, we may want to ignore the format only partly.
I think it easier to use the ignore comment than use ignore settings.

@ota-meshi
Copy link
Member

Did I misunderstand what you were saying? Are you talking about the shareable configuration provided by this plugin?

@JounQin
Copy link
Collaborator

JounQin commented Jul 7, 2022

@ota-meshi I mean add a new config in this plugin: extends: ['plugin:svlete/prettier'] like jsonc plugin?

@JounQin
Copy link
Collaborator

JounQin commented Jul 7, 2022

Did I misunderstand what you were saying? Are you talking about the shareable configuration provided by this plugin?

Exactly.

@ota-meshi
Copy link
Member

Yeah. I think we need a new shareable configuration, as you say. We can work on it with another PR.

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@ota-meshi ota-meshi requested a review from JounQin July 7, 2022 00:46
@ota-meshi ota-meshi merged commit 8e63c1b into sveltejs:main Jul 7, 2022
@tivac tivac deleted the indent-script-option branch July 28, 2022 17:39
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.

indent rule requires that <script> elements be indented
3 participants