diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 71b3c970b..ce9bdc71a 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -79,7 +79,7 @@ body:
placeholder: |
https://github.com/[your]/[repo]
or
- https://sveltejs.github.io/eslint-plugin-svelte/playground/#[hash]
+ https://eslint-online-playground.netlify.app/#[hash]
validations:
required: true
- type: textarea
diff --git a/README.md b/README.md
index 9a6c25600..610a270d6 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
`eslint-plugin-svelte` is the official [ESLint] plugin for [Svelte].
It provides many unique check rules by using the template AST.
-You can check on the [Online DEMO](https://sveltejs.github.io/eslint-plugin-svelte/playground/).
+You can check on the [Online DEMO](https://eslint-online-playground.netlify.app/#eslint-plugin-svelte%20with%20typescript).
**_We are working on experimental support for Svelte v5, but may break with new versions of Svelte v5._**
diff --git a/docs-svelte-kit/src/lib/components/ESLintPlayground.svelte b/docs-svelte-kit/src/lib/components/ESLintPlayground.svelte
deleted file mode 100644
index ce705f0af..000000000
--- a/docs-svelte-kit/src/lib/components/ESLintPlayground.svelte
+++ /dev/null
@@ -1,278 +0,0 @@
-
-
-
-
-
-
- {time}
-
-
-
-
-
-
-
- {#each messages as msg, i (`${msg.line}:${msg.column}:${msg.ruleId}@${i}`)}
-
- onClickMessage(evt, msg)} class="message-link">
- [{msg.line}:{msg.column}]
- :
- {msg.message}
- ({msg.ruleId})
-
- {/each}
-
-
-
-
-
-
-
diff --git a/docs-svelte-kit/src/lib/eslint/RulesSettings.svelte b/docs-svelte-kit/src/lib/eslint/RulesSettings.svelte
deleted file mode 100644
index 8fdf4ada0..000000000
--- a/docs-svelte-kit/src/lib/eslint/RulesSettings.svelte
+++ /dev/null
@@ -1,268 +0,0 @@
-
-
-
-
-
diff --git a/docs-svelte-kit/src/lib/eslint/scripts/json.js b/docs-svelte-kit/src/lib/eslint/scripts/json.js
deleted file mode 100644
index 43a17bafb..000000000
--- a/docs-svelte-kit/src/lib/eslint/scripts/json.js
+++ /dev/null
@@ -1,68 +0,0 @@
-export function processJsonValue(options, ctx, value) {
- const type = typeof value;
- if (type === 'string' || type === 'number' || type === 'boolean' || value === null) {
- ctx.appendText(JSON.stringify(value));
- return;
- } else if (type !== 'object') {
- ctx.appendText('"?"');
- return;
- }
- if (Array.isArray(value)) {
- ctx.appendText('[\n').indent();
- const arr = [...value];
- while (arr.length) {
- ctx.appendIndent();
- const e = arr.shift();
- processJsonValue(options, ctx, e);
- if (arr.length) {
- ctx.appendText(',');
- }
- ctx.appendText('\n');
- }
- ctx.outdent().appendIndent().appendText(']');
- } else {
- let entries = Object.entries(value);
- const valueIsNode = isNode(value);
- if (valueIsNode) {
- ctx.pushNode(value);
- const typeEntry = entries.find(([key]) => key === 'type');
- const locEntries = options.showLocations
- ? entries.filter(([key]) => key === 'loc' || key === 'range')
- : [];
- entries = entries.filter(
- ([key]) =>
- key !== 'type' &&
- key !== 'loc' &&
- key !== 'range' &&
- key !== 'parent' &&
- !((key === 'start' || key === 'end') && typeof value.start === 'number')
- );
- if (typeEntry) entries.unshift(typeEntry);
- entries.push(...locEntries);
- }
- ctx.appendText('{\n').indent();
- while (entries.length) {
- const [key, val] = entries.shift();
- ctx.appendIndent();
- processJsonValue(options, ctx, key);
- ctx.appendText(': ');
- processJsonValue(options, ctx, val);
- if (entries.length) {
- ctx.appendText(',');
- }
- ctx.appendText('\n');
- }
- ctx.outdent().appendIndent().appendText('}');
-
- if (valueIsNode) {
- ctx.popNode();
- }
- }
-}
-
-/**
- * Check if given value is node
- */
-function isNode(value) {
- return value != null && Array.isArray(value.range) && 'loc' in value && 'type' in value;
-}
diff --git a/docs-svelte-kit/src/lib/eslint/scripts/state/deserialize.js b/docs-svelte-kit/src/lib/eslint/scripts/state/deserialize.js
deleted file mode 100644
index ab8ffdfe3..000000000
--- a/docs-svelte-kit/src/lib/eslint/scripts/state/deserialize.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import pako from 'pako';
-
-/**
- * Deserialize a given serialized string then update this object.
- * @param {string} serializedString A serialized string.
- * @returns {object} The deserialized state.
- */
-export function deserializeState(serializedString) {
- const state = {
- code: undefined,
- rules: undefined
- };
-
- if (serializedString === '') {
- return state;
- }
-
- try {
- const compressedString = window.atob(serializedString);
- const uint8Arr = pako.inflate(Uint8Array.from(compressedString, (c) => c.charCodeAt(0)));
-
- const jsonText = new TextDecoder().decode(uint8Arr);
- const json = JSON.parse(jsonText);
-
- if (typeof json === 'object' && json != null) {
- if (typeof json.code === 'string') {
- state.code = json.code;
- }
- if (json.useEslintPluginSvelte3 === true) {
- state.useEslintPluginSvelte3 = true;
- }
-
- if (typeof json.rules === 'object' && json.rules != null) {
- state.rules = {};
- for (const id of Object.keys(json.rules)) {
- state.rules[id] = json.rules[id] === 2 ? 'error' : 'off';
- }
- }
- }
- } catch (error) {
- // eslint-disable-next-line no-console -- Demo
- console.error(error);
- }
-
- return state;
-}
diff --git a/docs-svelte-kit/src/lib/eslint/scripts/state/index.js b/docs-svelte-kit/src/lib/eslint/scripts/state/index.js
deleted file mode 100644
index e04dbd277..000000000
--- a/docs-svelte-kit/src/lib/eslint/scripts/state/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './deserialize';
-export * from './serialize';
diff --git a/docs-svelte-kit/src/lib/eslint/scripts/state/serialize.js b/docs-svelte-kit/src/lib/eslint/scripts/state/serialize.js
deleted file mode 100644
index 02d0b8d80..000000000
--- a/docs-svelte-kit/src/lib/eslint/scripts/state/serialize.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import pako from 'pako';
-
-/**
- * Get only enabled rules to make the serialized data smaller.
- * @param {object} allRules The rule settings.
- * @returns {object} The rule settings for the enabled rules.
- */
-function getEnabledRules(allRules) {
- return Object.keys(allRules).reduce((map, id) => {
- if (allRules[id] === 'error') {
- map[id] = 2;
- }
- return map;
- }, {});
-}
-
-/**
- * Serialize a given state as a base64 string.
- * @param {State} state The state to serialize.
- * @returns {string} The serialized string.
- */
-export function serializeState(state) {
- const saveData = {
- code: state.code,
- rules: state.rules ? getEnabledRules(state.rules) : undefined,
- useEslintPluginSvelte3: state.useEslintPluginSvelte3
- };
- const jsonString = JSON.stringify(saveData);
-
- const uint8Arr = new TextEncoder().encode(jsonString);
- const compressedString = String.fromCharCode(...pako.deflate(uint8Arr));
- const base64 =
- (typeof window !== 'undefined' && window.btoa(compressedString)) || compressedString;
-
- // eslint-disable-next-line no-console -- Demo
- console.log(
- `The compress rate of serialized string: ${((100 * base64.length) / jsonString.length).toFixed(
- 1
- )}% (${jsonString.length}B → ${base64.length}B)`
- );
-
- return base64;
-}
diff --git a/docs-svelte-kit/src/lib/header/Header.svelte b/docs-svelte-kit/src/lib/header/Header.svelte
index 0fc55b112..39a867218 100644
--- a/docs-svelte-kit/src/lib/header/Header.svelte
+++ b/docs-svelte-kit/src/lib/header/Header.svelte
@@ -53,8 +53,14 @@
Rules
-
- Playground
+
+
+ Playground
+
diff --git a/docs-svelte-kit/src/lib/utils.js b/docs-svelte-kit/src/lib/utils.js
index 69b316716..e8c320bb4 100644
--- a/docs-svelte-kit/src/lib/utils.js
+++ b/docs-svelte-kit/src/lib/utils.js
@@ -50,14 +50,12 @@ const SIDE_MENU = {
title: 'Available Rules',
children: categoryRules
},
- { path: '/playground/', title: 'Playground' },
{ path: '/migration/', title: 'Migration' }
],
'/': [
{ path: '/', title: 'Introduction' },
{ path: '/user-guide/', title: 'User Guide' },
{ path: '/rules/', title: 'Available Rules' },
- { path: '/playground/', title: 'Playground' },
{ path: '/migration/', title: 'Migration' }
]
};
diff --git a/docs/README.md b/docs/README.md
index f93bd38e6..6bfbba28b 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -6,7 +6,7 @@ title: 'eslint-plugin-svelte'
`eslint-plugin-svelte` is the official [ESLint] plugin for [Svelte].
It provides many unique check rules by using the template AST.
-You can check on the [Online DEMO](./playground.md).
+You can check on the [Online DEMO](https://eslint-online-playground.netlify.app/#eslint-plugin-svelte%20with%20typescript).
**_We are working on experimental support for Svelte v5, but may break with new versions of Svelte v5._**
diff --git a/docs/playground.md b/docs/playground.md
deleted file mode 100644
index c54fbb109..000000000
--- a/docs/playground.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-pageClass: 'playground'
-hiddenMenu: true
----
-
-# Playground
-
-
-
-The playground is [here](https://sveltejs.github.io/eslint-plugin-svelte/playground/)!!
-
-