@@ -40,7 +40,7 @@ const tableCellElement = new Set(['td', 'th'])
40
40
export function element ( node , state ) {
41
41
const parentSchema = state . schema
42
42
let schema = parentSchema
43
- const props = node . properties || { }
43
+ const properties = node . properties || { }
44
44
45
45
if ( parentSchema . space === 'html' && node . tagName . toLowerCase ( ) === 'svg' ) {
46
46
schema = svg
@@ -52,16 +52,16 @@ export function element(node, state) {
52
52
/** @type {Array<JsxAttribute | JsxSpreadAttribute> } */
53
53
const attributes = [ ]
54
54
/** @type {string } */
55
- let prop
55
+ let property
56
56
/** @type {string | undefined } */
57
57
let alignValue
58
58
/** @type {Array<Property> | undefined } */
59
59
let styleProperties
60
60
61
- for ( prop in props ) {
62
- if ( own . call ( props , prop ) ) {
63
- let value = props [ prop ]
64
- const info = find ( schema , prop )
61
+ for ( property in properties ) {
62
+ if ( own . call ( properties , property ) ) {
63
+ let value = properties [ property ]
64
+ const info = find ( schema , property )
65
65
/** @type {JsxAttribute['value'] } */
66
66
let attributeValue
67
67
@@ -77,18 +77,18 @@ export function element(node, state) {
77
77
continue
78
78
}
79
79
80
- prop =
80
+ property =
81
81
state . elementAttributeNameCase === 'react' && info . space
82
82
? hastToReact [ info . property ] || info . property
83
83
: info . attribute
84
84
85
85
if ( Array . isArray ( value ) ) {
86
86
// Accept `array`.
87
- // Most props are space-separated.
87
+ // Most properties are space-separated.
88
88
value = info . commaSeparated ? commas ( value ) : spaces ( value )
89
89
}
90
90
91
- if ( prop === 'style' ) {
91
+ if ( property === 'style' ) {
92
92
let styleObject =
93
93
typeof value === 'object'
94
94
? value
@@ -101,20 +101,20 @@ export function element(node, state) {
101
101
/** @type {Array<Property> } */
102
102
const cssProperties = [ ]
103
103
/** @type {string } */
104
- let cssProp
104
+ let cssProperty
105
105
106
- for ( cssProp in styleObject ) {
106
+ for ( cssProperty in styleObject ) {
107
107
// eslint-disable-next-line max-depth
108
- if ( own . call ( styleObject , cssProp ) ) {
108
+ if ( own . call ( styleObject , cssProperty ) ) {
109
109
cssProperties . push ( {
110
110
type : 'Property' ,
111
111
method : false ,
112
112
shorthand : false ,
113
113
computed : false ,
114
- key : identifierName ( cssProp )
115
- ? { type : 'Identifier' , name : cssProp }
116
- : { type : 'Literal' , value : cssProp } ,
117
- value : { type : 'Literal' , value : String ( styleObject [ cssProp ] ) } ,
114
+ key : identifierName ( cssProperty )
115
+ ? { type : 'Identifier' , name : cssProperty }
116
+ : { type : 'Literal' , value : cssProperty } ,
117
+ value : { type : 'Literal' , value : String ( styleObject [ cssProperty ] ) } ,
118
118
kind : 'init'
119
119
} )
120
120
}
@@ -130,18 +130,18 @@ export function element(node, state) {
130
130
} else if (
131
131
state . tableCellAlignToStyle &&
132
132
tableCellElement . has ( node . tagName ) &&
133
- prop === 'align'
133
+ property === 'align'
134
134
) {
135
135
alignValue = String ( value )
136
136
continue
137
137
} else {
138
138
attributeValue = { type : 'Literal' , value : String ( value ) }
139
139
}
140
140
141
- if ( identifierName ( prop , { jsx : true } ) ) {
141
+ if ( identifierName ( property , { jsx : true } ) ) {
142
142
attributes . push ( {
143
143
type : 'JSXAttribute' ,
144
- name : { type : 'JSXIdentifier' , name : prop } ,
144
+ name : { type : 'JSXIdentifier' , name : property } ,
145
145
value : attributeValue
146
146
} )
147
147
} else {
@@ -155,7 +155,7 @@ export function element(node, state) {
155
155
method : false ,
156
156
shorthand : false ,
157
157
computed : false ,
158
- key : { type : 'Literal' , value : String ( prop ) } ,
158
+ key : { type : 'Literal' , value : String ( property ) } ,
159
159
// @ts -expect-error No need to worry about `style` (which has a
160
160
// `JSXExpressionContainer` value) because that’s a valid identifier.
161
161
value : attributeValue || { type : 'Literal' , value : true } ,
@@ -181,7 +181,7 @@ export function element(node, state) {
181
181
} )
182
182
}
183
183
184
- const cssProp =
184
+ const cssProperty =
185
185
state . stylePropertyNameCase === 'css'
186
186
? transformStyleToCssCasing ( 'textAlign' )
187
187
: 'textAlign'
@@ -191,9 +191,9 @@ export function element(node, state) {
191
191
method : false ,
192
192
shorthand : false ,
193
193
computed : false ,
194
- key : identifierName ( cssProp )
195
- ? { type : 'Identifier' , name : cssProp }
196
- : { type : 'Literal' , value : cssProp } ,
194
+ key : identifierName ( cssProperty )
195
+ ? { type : 'Identifier' , name : cssProperty }
196
+ : { type : 'Literal' , value : cssProperty } ,
197
197
value : { type : 'Literal' , value : alignValue } ,
198
198
kind : 'init'
199
199
} )
@@ -232,13 +232,14 @@ export function element(node, state) {
232
232
* @param {string } tagName
233
233
* Element name.
234
234
* @returns {Style }
235
- * Props .
235
+ * Properties .
236
236
*/
237
237
function parseStyle ( value , tagName ) {
238
238
/** @type {Style } */
239
239
const result = { }
240
240
241
241
try {
242
+ // @ts -expect-error: types are wrong.
242
243
styleToObject ( value , iterator )
243
244
} catch ( error ) {
244
245
const cause = /** @type {Error } */ ( error )
@@ -252,7 +253,7 @@ function parseStyle(value, tagName) {
252
253
return result
253
254
254
255
/**
255
- * Add `name`, as a CSS prop , to `result`.
256
+ * Add `name`, as a CSS property , to `result`.
256
257
*
257
258
* @param {string } name
258
259
* Key.
@@ -296,7 +297,7 @@ function transformStylesToCssCasing(domCasing) {
296
297
}
297
298
298
299
/**
299
- * Transform a DOM casing style prop to a CSS casing style prop .
300
+ * Transform a DOM casing style property to a CSS casing style property .
300
301
*
301
302
* @param {string } from
302
303
* @returns {string }
0 commit comments