"use strict" causes the error $this is undefined

"use strict" causes the error $this is undefined

Hi,

The code bellow works without "use strict" but when I add "use strict" to it, it shows an error saying "Uncaught TypeError".

  1. (function ($) {
  2.   "use strict";

  3.       $('.field-widget-file-generic').each(function () {
  4.         $this = $(this);
  5.         if(!$this.find('.table-striped').length && $this.find('.file-widget span.file').length) {
  6.            $this.find('.file-widget span.file').closest('.file-widget').addClass('only-one-file');
  7.         }
  8.       });

  9. })(jQuery);

I need to use "use strict" but I don't know how to fix the code to get rid of the error.

Thanks