From the course: Learning Functional Programming with JavaScript ES6+
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Ensuring immutability: Finalize ESLint - JavaScript Tutorial
From the course: Learning Functional Programming with JavaScript ES6+
Ensuring immutability: Finalize ESLint
The next thing we're going to do is install the eslint plugin immutable package for our project. So in the terminal, we'll type npm install dash dash save-dev eslint-plugin dash immutable and hit enter, and then all have to do is add some of these rules to our eslint rc file. So we'll open up eslintrc.js and add a plugins property right above rules. Plugins, and it's going to be an array, and then we simply add our immutable package to it. Like this: immutable, and don't forget to add the commas. Then, inside the rules object, we're going to add a rule from immutable. Specifically, we're going to use the immutable slash no dash mutation rule. And we're going to give it the value two because we want eslint to treat this as an error if it finds it, not just a warning, which would be one. And for those of you who are wondering, if we want to specifically disable a rule, we could set this value to zero like this. But we're going to leave it as two. Let's save our file, as well. So now, if…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
The goal of functional programming3m 38s
-
(Locked)
Declarative vs. imperative programming2m 46s
-
(Locked)
Immutability4m 18s
-
(Locked)
Separation of data and functions1m 47s
-
(Locked)
Object oriented to functional approach3m 29s
-
(Locked)
First-class functions2m 33s
-
(Locked)
Ensuring immutability: ESLint3m 14s
-
(Locked)
Ensuring immutability: Install ESLint1m 14s
-
(Locked)
Ensuring immutability: Finalize ESLint2m 27s
-
(Locked)
-
-
-
-
-