Skip to content

Commit b45fa20

Browse files
feat: Require svelte script lang="ts" (#515)
* Require svelte script lang="ts" * Undo changes to .svx file
1 parent d995bec commit b45fa20

23 files changed

+23
-22
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const config = {
3535
rules: {
3636
'@typescript-eslint/array-type': 'off',
3737
'@typescript-eslint/consistent-type-definitions': 'off',
38+
'svelte/block-lang': ['error', { script: ['ts'] }],
3839
'svelte/no-at-html-tags': 'off',
3940
'svelte/valid-compile': 'off'
4041
}

src/lib/Mermaid.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import { onMount } from 'svelte';
33
44
let graph = null;

src/lib/components/ComponentIndex/Card.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import Tag from '../Tag.svelte';
33
import { copyToClipboard } from '$lib/utils/clipboard';
44
import { packageManager as manager } from '$stores/packageManager';

src/lib/components/ComponentIndex/CardList.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
export let title;
33
export let id = `category-${encodeURI(title)}`;
44
</script>

src/lib/components/EventListElement/index.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import Icon from '$lib/components/Icon/index.svelte';
33
export let title,
44
date,

src/lib/components/Icon/index.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
export let name;
33
export let width = '24px';
44
export let height = '24px';

src/lib/components/Select.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import SvelteSelect from 'svelte-select';
33
44
export let value;

src/lib/components/Seo.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script type="ts">
1+
<script lang="ts">
22
import { page } from '$app/stores';
33
44
const brand = 'Svelte Society';

src/lib/components/Societies/index.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import Icon from '$lib/components/Icon/index.svelte';
33
import societies from './societies.json';
44
</script>

src/lib/components/Tag.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
export let title = '';
33
export let variant;
44
export let click = undefined;

src/lib/components/_SocialLinks/Link.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
export let path, image, alt;
33
</script>
44

src/lib/components/layout/Footer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
// get the year for the copyright statement
33
var date = new Date();
44
var year = date.getFullYear();

src/lib/components/recipes/CategoryTree.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import { page } from '$app/stores';
33
44
export let nodes;

src/lib/layouts/EventPage.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import Seo from '$lib/components/Seo.svelte';
33
44
export let title = '';

src/lib/layouts/Recipe.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import CategoryTree from '$lib/components/recipes/CategoryTree.svelte';
33
import Icon from '$lib/components/Icon/index.svelte';
44
import { categories } from '$lib/stores/recipes';

src/lib/layouts/RecipeCategory.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import Icon from '$lib/components/Icon/index.svelte';
33
import { categories } from '$lib/stores/recipes';
44
import { page } from '$app/stores';

src/lib/layouts/SearchLayout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
export let title;
33
</script>
44

src/routes/about/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import Seo from '$lib/components/Seo.svelte';
33
</script>
44

src/routes/components/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import components from './components.json';
33
import SearchableJson from '../searchableJson.svelte';
44
import { injectStars } from '$utils/stars';

src/routes/resources/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
const booksFromPublisher = [
33
{
44
name: 'Svelte 3 Up and Running',

src/routes/searchableJson.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import ComponentCard from '$lib/components/ComponentIndex/Card.svelte';
33
import List from '$lib/components/ComponentIndex/CardList.svelte';
44
import SearchLayout from '$layouts/SearchLayout.svelte';

src/routes/templates/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import templates from './templates.json';
33
import SearchableJson from '../searchableJson.svelte';
44
import { injectStars } from '$utils/stars';

src/routes/tools/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script>
1+
<script lang="ts">
22
import tools from '../tools/tools.json';
33
import SearchableJson from '../searchableJson.svelte';
44
import { injectStars } from '$utils/stars';

0 commit comments

Comments
 (0)