Skip to content

Commit 452ffed

Browse files
authored
feat(no-inline-styles): allowing transitions by default (#911)
Closes #902
1 parent ca37fbb commit 452ffed

File tree

7 files changed

+9
-4
lines changed

7 files changed

+9
-4
lines changed

.changeset/twenty-nails-end.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'eslint-plugin-svelte': minor
3+
---
4+
5+
feat(no-inline-styles): allowing transitions by default

docs/rules/no-inline-styles.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ This rule reports all attributes and directives that would compile to inline sty
5050
"svelte/no-inline-styles": [
5151
"error",
5252
{
53-
"allowTransitions": false
53+
"allowTransitions": true
5454
}
5555
]
5656
}
5757
```
5858

59-
- `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`.
59+
- `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`.
6060

6161
## :books: Further Reading
6262

packages/eslint-plugin-svelte/src/rules/no-inline-styles.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default createRule('no-inline-styles', {
2626
type: 'suggestion'
2727
},
2828
create(context) {
29-
const allowTransitions: boolean = context.options[0]?.allowTransitions ?? false;
29+
const allowTransitions: boolean = context.options[0]?.allowTransitions ?? true;
3030
return {
3131
SvelteElement(node) {
3232
if (node.kind !== 'html') {
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"options": [
33
{
4-
"allowTransitions": true
4+
"allowTransitions": false
55
}
66
]
77
}

0 commit comments

Comments
 (0)