File tree Expand file tree Collapse file tree 3 files changed +3
-5
lines changed
packages/analysis/src/jsts/rules Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -131,5 +131,5 @@ export const rule: Rule.RuleModule = {
131131
132132//handling arrow functions without return statement
133133function returnsJSX ( node : estree . Function ) {
134- return ( node . body as any ) . type . startsWith ( 'JSX' ) ;
134+ return node . body . type . startsWith ( 'JSX' ) ;
135135}
Original file line number Diff line number Diff line change @@ -80,9 +80,7 @@ function getNumericLiteral(node: estree.Literal) {
8080}
8181
8282function numericLiteralValue ( node : estree . Literal ) {
83- if ( typeof node . value === 'number' ) {
84- return node . value ;
85- }
83+ return typeof node . value === 'number' ? node . value : undefined ;
8684}
8785
8886function isNumericLiteral ( node : estree . Node ) : node is estree . Literal {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function reportExempting(
3535 exemptionCondition : ( messageId : string ) => boolean ,
3636) : ( context : Rule . RuleContext , reportDescriptor : Rule . ReportDescriptor ) => void {
3737 return ( context , reportDescriptor ) => {
38- if ( exemptionCondition ( ( reportDescriptor as any ) . messageId ) ) {
38+ if ( 'messageId' in reportDescriptor && exemptionCondition ( reportDescriptor . messageId ) ) {
3939 context . report ( reportDescriptor ) ;
4040 }
4141 } ;
You can’t perform that action at this time.
0 commit comments