Atom linter-eslint has a very handy command to fix the file with specified linting rules.
You can lint your file with by calling Command + P and typing Fix.
This saves time but you still need to type Fix over and over again to fix your file. Its more time saving if you could lint your file on saving, right? You can!
There's two ways you can config this behaviour. Follow the method that most please you:
- Go to your Settings and select the Packages tab. Find the installed linter-eslint and go to its settings.
- Check the Fix errors on save options.
- Command + P and type
Config
. - Select Application: Open your config. This will open the
config.cson
file for you. - Add the following config:
"linter-eslint":
fixOnSave: true
You are good to go! Now your linting rules will be applied on file saving. Happy linting!
Thanks 👍 🙂