1
00:00:03,010 --> 00:00:07,210
Now before we set up webpack or anything, let's start with linting

2
00:00:07,300 --> 00:00:12,730
and if you're using Visual Studio Code, the easiest way of implementing it is to install a certain extension.

3
00:00:12,730 --> 00:00:19,110
For that, you can go to view, extensions and in there, search for ESLint.

4
00:00:19,120 --> 00:00:21,150
Now I already got that installed,

5
00:00:21,160 --> 00:00:25,850
you can simply install it there and then you might need to reload your IDE,

6
00:00:25,870 --> 00:00:30,850
your editor. Once this is done, ESLint should be installed.

7
00:00:30,850 --> 00:00:38,220
Now once it is installed, you can go back to the explorer view here and then to use ESLint,

8
00:00:38,350 --> 00:00:44,890
you can hit command shift and p on Mac or control shift and p on Windows and Linux to open up this

9
00:00:44,890 --> 00:00:52,130
command menu, there you can type ESLint and then choose enable ESLint.

10
00:00:52,140 --> 00:00:55,680
Now here, it's telling me that it already is enabled.

11
00:00:55,680 --> 00:00:57,750
Now that doesn't seem to change much right,

12
00:00:57,750 --> 00:01:02,300
I don't get any errors or warnings here. For the browser extension to work,

13
00:01:02,310 --> 00:01:08,140
we need to also install the ESLint tool globally on our machine or in this project

14
00:01:08,220 --> 00:01:11,480
and here I want to install it specifically in this project. For that,

15
00:01:11,480 --> 00:01:19,500
quit that development server by pressing control c here and now in there, we need to make this project

16
00:01:19,710 --> 00:01:28,860
manageable by npm, which means I want to be able to install specific packages that are exclusive to this

17
00:01:28,860 --> 00:01:29,460
project,

18
00:01:29,460 --> 00:01:33,840
so I don't want to install them globally but only inside of this project

19
00:01:33,840 --> 00:01:41,010
and for that, we first of all need to create an npm configuration file to basically tell npm that this project

20
00:01:41,010 --> 00:01:46,830
should be managed by npm and then also manage our different dependencies, the different packages we want

21
00:01:46,830 --> 00:01:50,470
to use there. For that you need to have Node.js installed,

22
00:01:50,480 --> 00:01:51,000
so visit

23
00:01:51,000 --> 00:01:56,170
nodejs.org and if you didn't install it already, install the latest version of Node.js

24
00:01:56,180 --> 00:01:56,560
here.

25
00:01:56,630 --> 00:02:02,400
Simply download the installer, walk through the installer, works on Mac, Linux and Windows and once that

26
00:02:02,410 --> 00:02:08,120
is done, potentially restart your system if you're facing any issues with the next steps and otherwise,

27
00:02:08,120 --> 00:02:10,640
just execute npm init.

28
00:02:10,640 --> 00:02:17,000
Here, in this project folder, I'm doing this with the help of the built-in terminal or command prompt

29
00:02:17,000 --> 00:02:20,740
here in the IDE which you can open with view terminal.

30
00:02:20,750 --> 00:02:27,440
This is your normal system terminal or command prompt but automatically navigated into this folder.

31
00:02:27,440 --> 00:02:30,910
Now once you hit npm init, you're getting asked a couple of questions,

32
00:02:30,950 --> 00:02:35,930
for example you need to define a package name and you can confirm the default here which you see in

33
00:02:35,930 --> 00:02:38,130
parentheses by simply hitting enter,

34
00:02:38,150 --> 00:02:42,110
you can also enter an alternative value and hit enter to confirm that.

35
00:02:42,110 --> 00:02:47,510
I'm fine with the default here, also for the version, for description you don't have to enter anything but

36
00:02:47,510 --> 00:02:54,530
you can, here I'll just enter Javascript The Complete Guide and hit enter, entry point doesn't matter

37
00:02:54,530 --> 00:02:56,620
you can confirm this, test command,

38
00:02:56,630 --> 00:03:01,700
you can leave that empty by hitting enter, git repository if you're asked you can confirm the default

39
00:03:01,730 --> 00:03:08,900
or just ignore it, hit enter,  keywords, you can ignore that, hit enter with no keywords, author, you can put

40
00:03:08,900 --> 00:03:16,350
in your name here or leave it blank, hit enter thereafter, confirm the default licence and in the end,

41
00:03:16,590 --> 00:03:17,970
once all of this is okay,

42
00:03:18,000 --> 00:03:24,440
simply hit enter again to confirm. With all of that done, you will have a package.json file which

43
00:03:24,440 --> 00:03:30,950
you shouldn't delete. If you open that, you should see something like this, the settings you confirmed

44
00:03:30,950 --> 00:03:33,160
basically. With that,

45
00:03:33,230 --> 00:03:40,100
this project here can be managed with npm which means we can now install project specific packages with

46
00:03:40,100 --> 00:03:43,760
npm and there, I want to start with linting again.
