Skip to content

Commit 58df543

Browse files
committed
Update package
1 parent acfa8a3 commit 58df543

File tree

3 files changed

+15
-26
lines changed

3 files changed

+15
-26
lines changed

packages/validator/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@
5050
},
5151
"dependencies": {
5252
"@master/css": "workspace:^",
53-
"css-tree": "^3.0.1"
53+
"css-tree": "^3.1.0"
5454
},
5555
"devDependencies": {
56-
"@types/css-tree": "^2.3.9",
5756
"shared": "workspace:^",
58-
"ts-jest": "^29.2.5"
57+
"ts-jest": "^29.2.6"
5958
}
6059
}

packages/validator/src/validate-css.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
// @ts-expect-error
31
import { lexer, parse, walk, property as propertyName } from 'css-tree'
42
import { type SyntaxError } from './types/syntax-error'
53

@@ -34,7 +32,7 @@ export default function validateCSS(text: string, parseOptions = {
3432
}
3533

3634

37-
function isTargetError(error: SyntaxError) {
35+
function isTargetError(error: SyntaxError | null) {
3836
if (!error) {
3937
return null
4038
}
@@ -53,7 +51,7 @@ export function validateAtrule(node: { name: any; prelude: any; block: { childre
5351
const errors = []
5452
let error
5553

56-
if (error = isTargetError(lexer.checkAtruleName(atrule))) {
54+
if (error = isTargetError((lexer as any).checkAtruleName(atrule))) {
5755
errors.push(Object.assign(error, {
5856
atrule
5957
}))
@@ -85,7 +83,7 @@ export function validateAtrulePrelude(atrule: string, prelude: any) {
8583
const errors = []
8684
let error: SyntaxError | null
8785

88-
if (error = isTargetError(lexer.checkAtrulePrelude(atrule, prelude))) {
86+
if (error = isTargetError((lexer as any).checkAtrulePrelude(atrule, prelude))) {
8987
errors.push(Object.assign(error, {
9088
atrule
9189
}))
@@ -104,7 +102,7 @@ export function validateAtruleDescriptor(atrule: any, descriptor: string, value:
104102
const errors = []
105103
let error
106104

107-
if (error = isTargetError(lexer.checkAtruleDescriptorName(atrule, descriptor))) {
105+
if (error = isTargetError((lexer as any).checkAtruleDescriptorName(atrule, descriptor))) {
108106
errors.push(Object.assign(error, {
109107
atrule,
110108
descriptor
@@ -131,7 +129,7 @@ export function validateDeclaration(property: string, value: any) {
131129
return errors
132130
}
133131

134-
if (error = isTargetError(lexer.checkPropertyName(property))) {
132+
if (error = isTargetError((lexer as any).checkPropertyName(property))) {
135133
errors.push(Object.assign(error, {
136134
property
137135
}))

pnpm-lock.yaml

+8-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)