• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

I Like Kill Nerds

The blog of Australian Front End / Aurelia Javascript Developer & brewing aficionado Dwayne Charrington // Aurelia.io Core Team member.

  • Home
  • Aurelia 2
  • Aurelia 1
  • About
  • Aurelia 2 Consulting/Freelance Work

Dealing With Tslint Errors/Warnings In Third Party Files

TypeScript · March 14, 2017

This might be a bit of an edge case for some, but recently I needed to use a third-party script in my Aurelia TypeScript application that wasn’t installable through Npm.

I could have carefully changed it to conform to my TSLint guidelines, but that would have been more effort than I wanted to spend. I just wanted to include the file in a vendor folder and then import it without worrying how it’s written, whether it uses single or double quotes or what indentation setting it uses.

Enter TSLint rule flags.

All you need to do is put /* tslint:disable */ at the top of your file and TSLint will ignore everything after that. You can also selectively ignore certain parts of your file by using /* tslint:disable */ and /* tslint:enable */ to turn parts of your file off and then back on.

You can use TSLint rule flags to ignore certain rules as well, for cases where the rules don’t apply.

Dwayne

Leave a Reply Cancel reply

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Josh Wulf
Josh Wulf
6 years ago

Yeah, if you’re doing react, this line helps:

import { render } from ‘react-dom’; // tslint:disable-line no-unused-variable

0

Primary Sidebar

Popular

  • How To Get The Hash of A File In Node.js
  • Handling Errors with the Fetch API
  • Thoughts on the Flipper Zero
  • Testing Event Listeners In Jest (Without Using A Library)
  • Waiting for an Element to Exist With JavaScript

Copyright © 2023 · Dwayne Charrington · Log in

wpDiscuz