From the course: JavaScript: Best Practices for Functions and Classes

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Configure module settings in ESLint

Configure module settings in ESLint - JavaScript Tutorial

From the course: JavaScript: Best Practices for Functions and Classes

Start my 1-month free trial

Configure module settings in ESLint

- [Instructor] ES6 modules are a really useful JavaScript feature, but under the hood, a few aspects of the way they're parsed are different from standard scripts. As a result, ESLint settings require some modifications before you're able to specify and adjust linting settings for your module code. My code for this video uses a module. App.js uses a function exported from distanceTo.js. ES6 module configuration is a little different depending on whether you're writing front end or back end code. For simplicity's sake, this code works in the front end. So in my index.html file, I added type equals module to the script tag for my app.js file. Even though app.js is not itself a module, it uses module syntax. So its code needs to be parsed under that assumption. Now immediately I have ESLint errors in app.js and in distanceTo.js. And when I look at those, they concern the module-specific directives import and export.…

Contents