Skip to content

Commit d4b52e6

Browse files
committed
chore: minor refactor
1 parent e61bbc3 commit d4b52e6

File tree

7 files changed

+33
-6
lines changed

7 files changed

+33
-6
lines changed

.changeset/tasty-houses-behave.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"eslint-plugin-svelte": minor
33
---
44

5-
Added the experimental-require-strict-events rule
5+
feat: added the `svelte/experimental-require-strict-events` rule

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ These rules extend the rules provided by ESLint itself, or other plugins to work
379379

380380
| Rule ID | Description | |
381381
|:--------|:------------|:---|
382-
| [svelte/experimental-require-strict-events](https://ota-meshi.github.io/eslint-plugin-svelte/rules/experimental-require-strict-events/) | require the strictEvents attribute on <script> tags | |
382+
| [svelte/experimental-require-strict-events](https://ota-meshi.github.io/eslint-plugin-svelte/rules/experimental-require-strict-events/) | require the strictEvents attribute on `<script>` tags | |
383383

384384
## System
385385

docs-svelte-kit/src/lib/eslint/scripts/linter.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export const categories = [
3232
classes: "svelte-category",
3333
rules: [],
3434
},
35+
{
36+
title: "Experimental",
37+
classes: "svelte-category",
38+
rules: [],
39+
},
3540
{
3641
title: "System",
3742
classes: "svelte-category",

docs-svelte-kit/src/lib/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const categories = [
1818
"Best Practices",
1919
"Stylistic Issues",
2020
"Extension Rules",
21+
"Experimental",
2122
"System",
2223
]
2324
svelteRules.forEach((rule) => {

docs/rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ These rules extend the rules provided by ESLint itself, or other plugins to work
9898

9999
| Rule ID | Description | |
100100
|:--------|:------------|:---|
101-
| [svelte/experimental-require-strict-events](./rules/experimental-require-strict-events.md) | require the strictEvents attribute on <script> tags | |
101+
| [svelte/experimental-require-strict-events](./rules/experimental-require-strict-events.md) | require the strictEvents attribute on `<script>` tags | |
102102

103103
## System
104104

docs/rules/experimental-require-strict-events.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
pageClass: "rule-details"
33
sidebarDepth: 0
44
title: "svelte/experimental-require-strict-events"
5-
description: "require the strictEvents attribute on <script> tags"
5+
description: "require the strictEvents attribute on `<script>` tags"
66
---
77

88
# svelte/experimental-require-strict-events
99

10-
> require the strictEvents attribute on <script> tags
10+
> require the strictEvents attribute on `<script>` tags
1111
1212
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> **_This rule has not been released yet._** </badge>
1313

@@ -25,10 +25,31 @@ This rule enforces the presence of the `strictEvents` attribute on the main `<sc
2525
<!-- ✓ GOOD -->
2626
<script lang="ts" strictEvents>
2727
</script>
28+
```
29+
30+
</ESLintCodeBlock>
2831

32+
<ESLintCodeBlock>
33+
34+
<!--eslint-skip-->
35+
36+
```svelte
37+
<!-- eslint svelte/experimental-require-strict-events: "error" -->
38+
39+
<!-- ✓ GOOD -->
2940
<script lang="ts">
3041
interface $$Events {}
3142
</script>
43+
```
44+
45+
</ESLintCodeBlock>
46+
47+
<ESLintCodeBlock>
48+
49+
<!--eslint-skip-->
50+
51+
```svelte
52+
<!-- eslint svelte/experimental-require-strict-events: "error" -->
3253
3354
<!-- ✗ BAD -->
3455
<script lang="ts">

src/rules/experimental-require-strict-events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { findAttribute, getLangValue } from "../utils/ast-utils"
66
export default createRule("experimental-require-strict-events", {
77
meta: {
88
docs: {
9-
description: "require the strictEvents attribute on <script> tags",
9+
description: "require the strictEvents attribute on `<script>` tags",
1010
category: "Experimental",
1111
recommended: false,
1212
},

0 commit comments

Comments
 (0)