![]() On the other side, the second example is on one line, uses double quotes and has a semicolon. the first example is split across two lines, has single quotes around the string, and there is no semicolon at the end. ![]() However, it is a little bit tricky to make it work with eslint so let's dive into it! Visual Studio Code setupįirst of all, we need to "teach" our editor to understand eslint □Īfter installation, we need to explicitly tell eslint extension to watch typescript files for linting errors ( by default it lints only javascript and JSX files).Functionally speaking, they both print out “hello world” to the console, but they look different in a variety of ways. It adds another layer of certainty to your code. You probably heard of typescript, it's basically javascript with types (but there is much more in it!). That way we can ensure only correctly formatted code will be merged. Unfortunately, developers might not have prepared their IDE/Text editor to work with eslint and wouldn't see those errors, but we can still create an eslint script which will run on our CI. Fortunately, eslint can handle even that and automatically fix the errors on file save! So this way, all developers would have errors in their IDE/Text editor if they had semicolons in their code, but for some reason, they might ignore that errors/warnings and still commit changes. log ( "I shouldn't be using semicolons there" ) ![]() The semicolon below would be underlined and showing error on hoverĬonsole.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |