-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[code-infra] Widen eslint file patterns (#44148)
- Loading branch information
Showing
4 changed files
with
57 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 23 additions & 15 deletions
38
packages-internal/scripts/typescript-to-proptypes/test/generator/html-elements/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
Foo.propTypes = { | ||
bothTypes: function (props, propName) { | ||
bothTypes: (props, propName) => { | ||
if (props[propName] == null) { | ||
return new Error("Prop '" + propName + "' is required but wasn't specified"); | ||
} else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) { | ||
return new Error("Expected prop '" + propName + "' to be of type Element"); | ||
return new Error(`Prop '${propName}' is required but wasn't specified`); | ||
} | ||
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) { | ||
return new Error(`Expected prop '${propName}' to be of type Element`); | ||
} | ||
return null; | ||
}, | ||
element: function (props, propName) { | ||
element: (props, propName) => { | ||
if (props[propName] == null) { | ||
return new Error("Prop '" + propName + "' is required but wasn't specified"); | ||
} else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) { | ||
return new Error("Expected prop '" + propName + "' to be of type Element"); | ||
return new Error(`Prop '${propName}' is required but wasn't specified`); | ||
} | ||
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) { | ||
return new Error(`Expected prop '${propName}' to be of type Element`); | ||
} | ||
return null; | ||
}, | ||
htmlElement: function (props, propName) { | ||
htmlElement: (props, propName) => { | ||
if (props[propName] == null) { | ||
return new Error("Prop '" + propName + "' is required but wasn't specified"); | ||
} else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) { | ||
return new Error("Expected prop '" + propName + "' to be of type Element"); | ||
return new Error(`Prop '${propName}' is required but wasn't specified`); | ||
} | ||
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) { | ||
return new Error(`Expected prop '${propName}' to be of type Element`); | ||
} | ||
return null; | ||
}, | ||
optional: function (props, propName) { | ||
optional: (props, propName) => { | ||
if (props[propName] == null) { | ||
return null; | ||
} else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) { | ||
return new Error("Expected prop '" + propName + "' to be of type Element"); | ||
} | ||
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) { | ||
return new Error(`Expected prop '${propName}' to be of type Element`); | ||
} | ||
return null; | ||
}, | ||
}; |