Posts

Showing posts from 2020

Setting up ESLint in React

  I love ESLint. It’s a pluggable linter that’s going to tell you if you’ve imported something and not used it, if your function could be short-handed, and loads of other little gotchas that you can fully configure. I really think that it makes me a better developer — I know the things it normally picks me up on, so I learn not to do them! Let’s go through how I get up and running in a new React project with ESLint installed. In reality though, this setup could be used for any Javascript application. I’m going to assume you already have   npm and node   installed. Starting a New React App There are a whole bunch of React starter projects out there, but Facebook’s own —  create-react-app  is one of the simplest. All you need to do is  create-react-app app-name  and you have a React starter with a local server, Babel, Webpack and Jest. It's a super easy way to get setup, and naturally  Facebook have some great documentation . Installing ESLint Installing our linter couldn’t be easier

Viewencapsulation in Angular

Image
  Hello Readers, In this article, we will see what actually view encapsulation is? How it is working? What are the types of view encapsulation available in angular? What is Shadow DOM? Does angular application support the scope for styling, even though the browser doesn’t support shadow DOM? We will see this entire list of questions in details one by one! So to start with, let me explain you the use case, say for example we had two components 1. app. component ( parent component) 2. demo. component( child component) We will be using the demo component inside the app component, all right! Now furthermore we had an h1 selector on both the components to display title, and as view encapsulation works with styling, we had created a style in app component for the selector h1. Now as we are calling the demo component inside the app component and demo component also had an h1 selector. What happened then? Does that style which we created on app component should automatically be applied to the

[Mac OS] How to Add to the Shell Path in macOS Catalina 10.5 using Terminal

Image
The  shell path  for a user in macOS is a set of paths in the filing system whereby the user has permissions to use certain applications, commands, and programs without the need to specify the full path to that command or program in the  Terminal . So instead of running something like this, with a path to the command: /usr/local/mysql/bin/mysql You can just type the command, regardless of where you are in the filing system: mysql Your  shell path  is a bunch of absolute paths of the filing system separated by colons  : You can find out what's in your path by launching  Terminal  in  Applications/Utilities  and entering: echo $PATH And the result should be like this… /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin So this is stating that you can run Unix style applications or commands located in 5 default locations of a certain  path  in the filing system: /usr/local/bin /usr/bin /bin /usr/sbin /sbin These directories are not visible by default in the filin