Skip to content

Commit 4f66e48

Browse files
committed
chore: remove eslint-plugin-svelte3 from demo site
1 parent b38f1b7 commit 4f66e48

File tree

10 files changed

+3
-86
lines changed

10 files changed

+3
-86
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
/explorer-v2/build
1111
/explorer-v2/build-system/shim/svelte-eslint-parser.*
1212
/explorer-v2/build-system/shim/eslint-scope.*
13-
/explorer-v2/build-system/shim/eslint-plugin-svelte3.*
1413
/explorer-v2/build-system/shim/eslint.*
1514
/explorer-v2/build-system/shim/svelte/*
1615
!/.vscode

explorer-v2/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ node_modules
55
/functions
66
/build-system/shim/svelte-eslint-parser.*
77
/build-system/shim/eslint-scope.*
8-
/build-system/shim/eslint-plugin-svelte3.*
98
/build-system/shim/eslint.*
109
/build-system/shim/svelte/*

explorer-v2/.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ build/**
44
node_modules/**
55
/build-system/shim/svelte-eslint-parser.*
66
/build-system/shim/eslint-scope.*
7-
/build-system/shim/eslint-plugin-svelte3.*
87
/build-system/shim/eslint.*

explorer-v2/build-system/pre-build/eslint-plugin-svelte3.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

explorer-v2/build-system/pre-build/webpack.config.js

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -85,56 +85,6 @@ export default [
8585
})
8686
]
8787
},
88-
{
89-
...base,
90-
entry: {
91-
'eslint-plugin-svelte3': resolve('./eslint-plugin-svelte3.js')
92-
},
93-
module: {
94-
rules: [
95-
{
96-
test: /node_modules\/eslint-plugin-svelte3\/index\.js$/u,
97-
loader: 'string-replace-loader',
98-
options: {
99-
search: 'Object\\.keys\\(__require\\.cache\\)',
100-
replace: (original) => `[] /* ${original} */`,
101-
flags: ''
102-
}
103-
},
104-
{
105-
test: /node_modules\/eslint-plugin-svelte3\/index\.js$/u,
106-
loader: 'string-replace-loader',
107-
options: {
108-
search: 'require\\(linter_path\\)',
109-
replace: (original) => `require('eslint'); // ${original}`,
110-
flags: ''
111-
}
112-
},
113-
{
114-
test: /node_modules\/eslint-plugin-svelte3\/index\.js$/u,
115-
loader: 'string-replace-loader',
116-
options: {
117-
search: "throw new Error\\('Could not find ESLint Linter in require cache'\\);",
118-
replace: (original) => ` // ${original}`,
119-
flags: ''
120-
}
121-
}
122-
]
123-
},
124-
externals: {
125-
'svelte/compiler': '$$inject_svelte_compiler$$',
126-
eslint: '$$inject_eslint$$'
127-
},
128-
plugins: [
129-
new WrapperPlugin({
130-
test: /eslint-plugin-svelte3\.js/,
131-
header: `
132-
import * as $$inject_svelte_compiler$$ from 'svelte/compiler';
133-
import * as $$inject_eslint$$ from 'eslint';
134-
`
135-
})
136-
]
137-
},
13888
{
13989
...base,
14090
entry: {

explorer-v2/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"@fontsource/fira-mono": "^5.0.0",
1616
"@typescript-eslint/parser": "^6.0.0",
1717
"eslint": "^8.0.0",
18-
"eslint-plugin-svelte3": "^4.0.0",
1918
"eslint-scope": "^7.0.0",
2019
"esquery": "^1.5.0",
2120
"pako": "^2.0.3",

explorer-v2/src/lib/ESLintPlayground.svelte

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
let code = state.code || DEFAULT_CODE;
3131
let rules = state.rules || Object.assign({}, DEFAULT_RULES_CONFIG);
3232
let messages = [];
33-
let useEslintPluginSvelte3 = Boolean(state.useEslintPluginSvelte3);
3433
let time = '';
35-
let options = {};
3634
3735
$: hasLangTs = /lang\s*=\s*(?:"ts"|ts|'ts'|"typescript"|typescript|'typescript')/u.test(code);
3836
let tsParser = undefined;
@@ -51,25 +49,14 @@
5149
});
5250
}
5351
}
54-
$: {
55-
options = useEslintPluginSvelte3 ? getEslintPluginSvelte3Options() : {};
56-
}
57-
async function getEslintPluginSvelte3Options() {
58-
const pluginSvelte3 = await import('eslint-plugin-svelte3');
59-
return {
60-
preprocess: pluginSvelte3.processors.svelte3.preprocess,
61-
postprocess: pluginSvelte3.processors.svelte3.postprocess
62-
};
63-
}
6452
6553
// eslint-disable-next-line no-use-before-define -- false positive
6654
$: serializedString = (() => {
6755
const serializeCode = DEFAULT_CODE === code ? undefined : code;
6856
const serializeRules = equalsRules(DEFAULT_RULES_CONFIG, rules) ? undefined : rules;
6957
return serializeState({
7058
code: serializeCode,
71-
rules: serializeRules,
72-
useEslintPluginSvelte3: useEslintPluginSvelte3 ? true : undefined
59+
rules: serializeRules
7360
});
7461
})();
7562
$: {
@@ -98,7 +85,6 @@
9885
const state = deserializeState(newSerializedString);
9986
code = state.code || DEFAULT_CODE;
10087
rules = state.rules || Object.assign({}, DEFAULT_RULES_CONFIG);
101-
useEslintPluginSvelte3 = Boolean(state.useEslintPluginSvelte3);
10288
}
10389
}
10490
@@ -121,14 +107,6 @@
121107

122108
<div class="playground-root">
123109
<div class="playground-tools">
124-
<label>
125-
<input bind:checked={useEslintPluginSvelte3} type="checkbox" />
126-
See result of
127-
<a href="https://github.com/sveltejs/eslint-plugin-svelte3">eslint-plugin-svelte3</a>.
128-
</label>
129-
{#if useEslintPluginSvelte3}
130-
<span style="color: red">svelte-eslint-parser is not used.</span>
131-
{/if}
132110
<span style="margin-left: 16px">{time}</span>
133111
</div>
134112
<div class="playground-content">
@@ -138,7 +116,7 @@
138116
{linter}
139117
bind:code
140118
config={{
141-
parser: useEslintPluginSvelte3 ? undefined : 'svelte-eslint-parser',
119+
parser: 'svelte-eslint-parser',
142120
parserOptions: {
143121
ecmaVersion: 2020,
144122
sourceType: 'module',
@@ -150,7 +128,6 @@
150128
es2021: true
151129
}
152130
}}
153-
{options}
154131
class="eslint-playground"
155132
on:result={onLintedResult}
156133
/>

explorer-v2/src/lib/scripts/state/deserialize.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ export function deserializeState(serializedString) {
2626
if (typeof json.code === 'string') {
2727
state.code = json.code;
2828
}
29-
if (json.useEslintPluginSvelte3 === true) {
30-
state.useEslintPluginSvelte3 = true;
31-
}
3229

3330
if (typeof json.rules === 'object' && json.rules != null) {
3431
state.rules = {};

explorer-v2/src/lib/scripts/state/serialize.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ function getEnabledRules(allRules) {
2222
export function serializeState(state) {
2323
const saveData = {
2424
code: state.code,
25-
rules: state.rules ? getEnabledRules(state.rules) : undefined,
26-
useEslintPluginSvelte3: state.useEslintPluginSvelte3
25+
rules: state.rules ? getEnabledRules(state.rules) : undefined
2726
};
2827
const jsonString = JSON.stringify(saveData);
2928
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- ignore

explorer-v2/vite.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const config = {
1818
tslib: resolve('./node_modules/tslib/tslib.es6.js'),
1919
eslint: resolve('./build-system/shim/eslint.js'),
2020
'svelte-eslint-parser': resolve('./build-system/shim/svelte-eslint-parser.js'),
21-
'eslint-plugin-svelte3': resolve('./build-system/shim/eslint-plugin-svelte3.js'),
2221
'svelte/compiler': resolve('./build-system/shim/svelte/compiler.js')
2322
}
2423
}

0 commit comments

Comments
 (0)