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(no-inline-styles): allowing transitions by default #911

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twenty-nails-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-plugin-svelte': minor
---

feat(no-inline-styles): allowing transitions by default
4 changes: 2 additions & 2 deletions docs/rules/no-inline-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ This rule reports all attributes and directives that would compile to inline sty
"svelte/no-inline-styles": [
"error",
{
"allowTransitions": false
"allowTransitions": true
}
]
}
```

- `allowTransitions` ... Most svelte transitions (including the built-in ones) use inline styles. However, it is theoretically possible to only use transitions that don't (see this [issue](https://github.com/sveltejs/svelte/issues/6662) about removing inline styles from built-in transitions). This option allows transitions to be used in such cases. Default `false`.
- `allowTransitions` ... Some svelte transitions (including the built-in ones in Svelte 4 and older) use inline styles. This option allows transitions to be used. Default `true`.

## :books: Further Reading

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default createRule('no-inline-styles', {
type: 'suggestion'
},
create(context) {
const allowTransitions: boolean = context.options[0]?.allowTransitions ?? false;
const allowTransitions: boolean = context.options[0]?.allowTransitions ?? true;
return {
SvelteElement(node) {
if (node.kind !== 'html') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"options": [
{
"allowTransitions": true
"allowTransitions": false
}
]
}
Loading