From the course: Learning Functional Programming with JavaScript ES6+
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Ensuring immutability: Finalize ESLint - JavaScript Tutorial
From the course: Learning Functional Programming with JavaScript ES6+
Ensuring immutability: Finalize ESLint
- [Instructor] 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 --save-dev eslint-plugin-immutable, and hit Enter. And then all we have to do is add some of these rules to our eslintrc 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/no-mutation rule. And we're going to give it the value 2 because we want ESLint to treat this as an error if it finds it, not just a warning, which would be 1. And for those of you who are wondering, if we want to specifically disable a rule, we could set this value to 0, like this. But we're going to leave it as 2. Let's save our file as well. So now, if we delete all…
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)
Converting object-oriented to functional code3m 29s
-
(Locked)
First-class functions2m 33s
-
(Locked)
Ensuring immutability with ESLint3m 14s
-
(Locked)
Installing and setting up ESLint1m 14s
-
(Locked)
Ensuring immutability: Finalize ESLint2m 27s
-
(Locked)
-
-
-
-
-