Skip to content

Commit

Permalink
fix: avoid parse as script if filePath is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Nov 20, 2023
1 parent 0d34b44 commit 18abf37
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
32 changes: 16 additions & 16 deletions explorer-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@
"preview": "vite preview"
},
"dependencies": {
"@fontsource/fira-mono": "^5.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.0.0",
"eslint-scope": "^7.0.0",
"@fontsource/fira-mono": "^5.0.8",
"@typescript-eslint/parser": "^6.11.0",
"eslint": "^8.54.0",
"eslint-scope": "^7.2.2",
"esquery": "^1.5.0",
"pako": "^2.0.3",
"svelte": "^5.0.0-next.2",
"pako": "^2.1.0",
"svelte": "^5.0.0-next.8",
"svelte-eslint-parser": "link:..",
"tslib": "^2.5.0"
"tslib": "^2.6.2"
},
"devDependencies": {
"@sveltejs/adapter-static": "^2.0.0",
"@sveltejs/kit": "^1.0.0-next.456",
"prettier": "^3.0.0",
"prettier-plugin-svelte": "^3.0.0",
"string-replace-loader": "^3.0.1",
"typescript": "^5.0.4",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.27.6",
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.0",
"string-replace-loader": "^3.1.0",
"typescript": "^5.2.2",
"vite": "^5.0.0",
"webpack": "^5.82.1",
"webpack-cli": "^5.0.0",
"wrapper-webpack-plugin": "^2.1.0"
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"wrapper-webpack-plugin": "^2.2.2"
}
}
2 changes: 1 addition & 1 deletion explorer-v2/src/app.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
1 change: 1 addition & 0 deletions explorer-v2/src/lib/MonacoEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
renderValidationDecorations: 'on',
renderWhitespace: 'boundary',
scrollBeyondLastLine: false,
useInlineViewWhenSpaceIsLimited: false,
...editorOptions
};
Expand Down
4 changes: 3 additions & 1 deletion src/parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ export function parseForESLint(code: string, options?: any): ParseResult {
if (
svelteVersion.hasRunes &&
parserOptions.filePath &&
!parserOptions.filePath.endsWith(".svelte")
!parserOptions.filePath.endsWith(".svelte") &&
// If no `filePath` is set in ESLint, "<input>" will be specified.
parserOptions.filePath !== "<input>"
) {
const trimmed = code.trim();
if (!trimmed.startsWith("<") && !trimmed.endsWith(">")) {
Expand Down

0 comments on commit 18abf37

Please sign in to comment.