How to lint for Typescript compilation issues?

前端 未结 2 1646
我寻月下人不归
我寻月下人不归 2020-12-20 11:53

Take the following Typescript arrow function:

/**
 * Returns a probably unique component name.
 * 
 * @param baseName a suggested name to make unique.
 * @re         


        
2条回答
  •  天命终不由人
    2020-12-20 12:39

    I don't have enough reputation to add this as a comment, but anyone that is getting an error similar to

    ./scripts/ts-staged-files.sh: line 4: 
       src/ui/Components/Select/Select.tsx: division by 0 
      (error token is "/Components/Select/Select.tsx")
    

    I made this small modification to Matt McCutchen's answer to fix it.

    #!/bin/bash
    
    include_files=()
    
    for f in "$@"; do
      include_files+=("${f#$PWD/}")
    done
    

提交回复
热议问题