developerasun / myCodeBox-web

Open source code box for web developers.
Apache License 2.0
5 stars 0 forks source link

NPM : Eslint #230

Open developerasun opened 2 years ago

developerasun commented 2 years ago

research : understanding Eslint

read these

developerasun commented 2 years ago

Read these

Find Problems ESLint statically analyzes your code to quickly find problems. ESLint is built into most text editors and you can run ESLint as part of your continuous integration pipeline.

Fix Automatically Many problems ESLint finds can be automatically fixed. ESLint fixes are syntax-aware so you won't experience errors introduced by traditional find-and-replace algorithms.

Customize Preprocess code, use custom parsers, and write your own rules that work alongside ESLint's built-in rules. You can customize ESLint to work exactly the way you need it for your project.

reference

developerasun commented 2 years ago

Installation and Usage Prerequisites: Node.js (^12.22.0, ^14.17.0, or >=16.0.0) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)

You can install ESLint using npm or yarn:

npm install eslint --save-dev

or

yarn add eslint --dev You should then set up a configuration file, and the easiest way to do that is:

$ npm init @eslint/config

or

$ yarn create @eslint/config Note: npm init @eslint/config assumes you have a package.json file already. If you don't, make sure to run npm init or yarn init beforehand.

After that, you can run ESLint on any file or directory like this:

$ npx eslint yourfile.js

or

$ yarn run eslint yourfile.js It is also possible to install ESLint globally rather than locally (using npm install eslint --global). However, this is not recommended, and any plugins or shareable configs that you use must be installed locally in either case.