ESLint Flashcards
How do you use ESLint
Install the eslint package and run eslint init
to create the configuration file called .eslintrc.json. This includes base Javascript linting with recommended javascript settings.
What are plugins
You can install plugins to enhance the ESlint functionality. Plugins such as react-specific eslint-plugin-react or eslint-plugin-react-hooks.
They always include ‘plugin’ in the name.
Add it to the list of ‘plugins’ and the ‘extends’ to extend with recommended settings.
What is a parser
It allows ESlint to parse the code behind the scenes so that it can lint it properly. For example a typescript parser can parse typescript so that Eslint can understand the code, with it’s type annotations.