How can I turn off ESLint’s no-restricted-syntax rule just for ForOfStatement?

Check existing config Based on the current master branch, eslint-config-airbnb currently disables four syntax forms: ForInStatement ForOfStatement LabeledStatement WithStatement You can verify this or see if there are any differences by using ESLint’s –print-config CLI flag: $ eslint –print-config file.js ESLint will print out the config it would use to lint file.js, and you can … Read more

Is it safe to use async/await now? [closed]

There are two places I check whenever I have questions such as this: The Can I Use website: http://caniuse.com/#search=await And Node Green: http://node.green/#async-functions Typically an answer is encouraged to include the relevant information to avoid link rot. But ironically this answer has exactly the opposite problem: this answer will rot (the information below will become … Read more

useSelector not updating when store has changed in Reducer. ReactJS Redux

NOTE: you better start using redux-toolkit to prevent references in you code its a better and almost a must way for using redux the problem your facing is very common when handling with objects, the props do not change because you’re changing an object property but the object itself does not change from the react … Read more

How to minify ES6 code using Webpack?

Not sure if you’re still looking for an answer to this, but now you can include the beta version of uglifyjs-webpack-plugin as a webpack plugin and it’ll use uglify-es which can minify ES6 code. npm install uglifyjs-webpack-plugin and then in your webpack.config.js: const Uglify = require(“uglifyjs-webpack-plugin”); module.exports = { entry: …, output: …, plugins: [ … Read more

Using ES6 Classes as Angular 1.x directives

From my point of view, there is no need to use external libraries like register.js, because you can create directive as a ES6 class in this way: class MessagesDirective { constructor() { this.restrict=”E” this.templateUrl=”messages.html” this.scope = {} } controller($scope, $state, MessagesService) { $scope.state = $state; $scope.service = MessagesService; } link(scope, element, attrs) { console.log(‘state’, scope.state) … Read more