Skip to content

Commit e6e0184

Browse files
committed
🔨 rename unsupported to raw
1 parent 00d8ec1 commit e6e0184

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

.changeset/wise-bulldogs-repeat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
---
66

77
Added a safe bail-out for when extract-react-types encounters an unsupported keyword or syntax.
8-
In that case, the type will be output as a raw string and summary type will be `unsupported`.
8+
In that case, the type will be output as a raw string and summary type will be `raw`.

packages/extract-react-types/__snapshots__/converters-typescript.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Object {
187187
],
188188
"optional": false,
189189
"value": Object {
190-
"kind": "unsupported",
190+
"kind": "raw",
191191
"name": "keyof Bar",
192192
},
193193
},
@@ -223,7 +223,7 @@ Object {
223223
],
224224
"optional": false,
225225
"value": Object {
226-
"kind": "unsupported",
226+
"kind": "raw",
227227
"name": "keyof Bar",
228228
},
229229
},

packages/extract-react-types/src/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import * as K from './kinds';
1616

1717
export type * from './kinds';
1818

19-
const IGNORE_STATEMENT = '@ert-ignore';
2019
const converters = {};
2120

2221
function convertObject(path, context) {
@@ -1245,9 +1244,7 @@ function attachComments(source, dest) {
12451244
function parseComment(commentProperty) {
12461245
return commentProperty.map(comment => ({
12471246
type: comment.type === 'CommentLine' ? 'commentLine' : 'commentBlock',
1248-
value: normalizeComment(comment)
1249-
.replace(IGNORE_STATEMENT, '')
1250-
.trim(),
1247+
value: normalizeComment(comment),
12511248
raw: comment.value
12521249
}));
12531250
}
@@ -1283,7 +1280,7 @@ function convert(path, context) {
12831280
// Fallback to a raw string if property uses a type without a matching converter
12841281
if (propertySignature && propertySignature.node) {
12851282
return {
1286-
kind: 'unsupported',
1283+
kind: 'raw',
12871284
name: path.getSource()
12881285
};
12891286
}

packages/kind2string/src/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,7 @@ from file: ${convert(type.source, mode)}`
316316
},
317317

318318
// ERT - Misc
319-
unsupported: (type: any): string => {
320-
console.log('HERE');
321-
return type.name;
322-
}
319+
raw: (type: any): string => type.name
323320
};
324321

325322
function convert(type: any, mode: string = 'value') {

0 commit comments

Comments
 (0)