ESLint Adds Suggestions API
Written by Kay Ewbank   
Monday, 13 January 2020

ESLint is an open source JavaScript linting utility. Newly updated the latest version adds a new Suggestions API, alongside an IgnorePatterns property.

ESLint was originally created by Nicholas C. Zakas in  2013. and is now an OpenJS Foundation project. Code linting is a type of static analysis  used to find code that doesn't adhere to certain style guidelines. ESLint was created was to allow developers to create their own linting rules, so all rules are completely pluggable. The default rules are written just like any plugin rules would be.

eslint

The new Suggestions API can be used to modify the way the fix command works. In some cases fixes aren't appropriate to be automatically applied, for example, if a fix potentially changes functionality or if there are multiple valid ways to fix a rule depending on the implementation intent. The Suggestions API can be used to provide a suggested alternative. The API can be used by other tools such as code editors to expose helpers for users to manually apply a suggestion. The suggestion objects represent individual suggestions that could be applied, with a key string that describes what applying the suggestion would do.

This release also adds a new ignorePatterns property in config files (including shareable configs) in order to control the files ESLint ignores. Until this release, developers had to create and use an eslintignore file in the project's root directory.

Several new rules have also been added, including the ability to require grouped accessor pairs; the option to disallow returning value in constructor (no-constructor-return); and no-dupe-else-if to disallow duplicate conditions in if-else-if chains. Other new rules include no-setter-return to disallow returning values from setters; and a prefer exponentiation operator that can be used to disallow the use of Math.pow in favor of the ** operator.

eslint

 

 

More Information

ESLint Homepage

Related Articles

Orion 16 Improves Node Server

ReSharper Gets Integrated Spell Checker

 

Language Tooling Enhancements in Orion 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Quadrupedal Parkour
31/03/2024

What is it with robots and parkour? First Atlas and now ANYmal want to impress us with their prowess. For the roboticist, however, emulating the skills of free running can enhance the capabilities of  [ ... ]



Azure AI And Pgvector Run Generative AI Directly On Postgres
26/03/2024

It's a match made in heaven. The Azure AI extension enables the database to call into various Azure AI services like Azure OpenAI. Combined with pgvector you can go far beyond full text search. Let's  [ ... ]


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info