Add support for linting typescript files #16494
                
     Merged
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
As discussed in #16449 this PR adds support for linting the typescript definition files using the existing eslint rules. This means that Travis builds will fail if the typescript definition files in
/srcare not linted properly and the.d.tsfiles can be automatically fixed usingnpm run lint -- --fix.In order to get VSCode to display lint errors inline I had to add "typescript" to the
"eslint.validate"options like so:The caveat here is that ind.tsfiles the linter seems to see the imported objects as "unused-variables" for some reason even when they're used in function signatures. For example:If this is merged then
--fixshould be run and then thed.tschanges committed into thedevbranch.Edit: I've fixed the caveat