File tree 2 files changed +6
-2
lines changed
src/shared/svelte-compile-warns
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 76
76
"postcss-load-config" : " ^3.1.4" ,
77
77
"postcss-safe-parser" : " ^6.0.0" ,
78
78
"postcss-selector-parser" : " ^6.0.11" ,
79
+ "semver" : " ^7.5.3" ,
79
80
"svelte-eslint-parser" : " ^0.31.0"
80
81
},
81
82
"devDependencies" : {
110
111
"@types/node" : " ^18.11.0" ,
111
112
"@types/postcss-safe-parser" : " ^5.0.1" ,
112
113
"@types/prismjs" : " ^1.26.0" ,
114
+ "@types/semver" : " ^7.5.0" ,
113
115
"@types/stylus" : " ^0.48.38" ,
114
116
"@typescript-eslint/eslint-plugin" : " ^5.59.5" ,
115
117
"@typescript-eslint/parser" : " ^5.59.5" ,
158
160
"prismjs" : " ^1.25.0" ,
159
161
"rimraf" : " ^5.0.0" ,
160
162
"sass" : " ^1.51.0" ,
161
- "semver" : " ^7.3.5" ,
162
163
"simple-git-hooks" : " ^2.8.0" ,
163
164
"source-map-js" : " ^1.0.2" ,
164
165
"stylelint" : " ^15.0.0" ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { extractLeadingComments } from "./extract-leading-comments"
21
21
import { getLangValue } from "../../utils/ast-utils"
22
22
import path from "path"
23
23
import fs from "fs"
24
+ import semver from "semver"
24
25
25
26
type WarningTargetNode =
26
27
| ( AST . SvelteProgram & ASTNodeWithParent )
@@ -446,7 +447,9 @@ function getWarningsFromCode(code: string): {
446
447
try {
447
448
const result = compiler . compile ( code , {
448
449
generate : false ,
449
- customElement : true ,
450
+ ...( semver . satisfies ( compiler . VERSION , ">=4.0.0-0" )
451
+ ? { customElement : true }
452
+ : { } ) ,
450
453
} )
451
454
452
455
return { warnings : result . warnings as Warning [ ] , kind : "warn" }
You can’t perform that action at this time.
0 commit comments