IGNOREIT (a vscode extension)

2 min read

A light-weight vscode extension that automatically helps you ignore files and folders which you would probably have to ignore manually.

IGNOREIT was inspired by the need to mitigate security vulnerabilities that could emanate when a developer mistakenly commit secret files, that were expected to be ignored, to git and pushes the changes to a remote source control.

SETUP

By default, after installation, the following files would be ignored with the help of ignoreit. You can add more files to it as you wish [".env", "node_modules", "coverage"]
The array can be updated with as many files and folders you wish to always ignore in any of your workspace on vscode. Follow the guide below for more details:

  • Install and navigate to vscode settings.json.
  • Add this key-value pair property to your settings.json file.

    "ignoreit.array": [".env", "node_modules", "coverage"]
  • The array is a list of files and folders you wish to always ignore. Feel free to modify it (remove or add more items to the array).

HOW IT WORKS

  • If any of the files or folders specified in the array exists in your project directory, ignoreit extension would add it to the .gitignore file.
  • If .gitignore file does not exist in your project directory, ignoreit extension would create a .gitignore file and fill in the files you're to ignore.
  • The .gitignore content would be the files in your project directory that corresponds to the ignoreit.array values you had specified in settings.json
  • You can manually add other files to the .gitignore file. New files are always appended to the existing ones, without duplicate.
  • If a .env file is part of the files in your directory, ignoreit extension would create a .env.example file and fill it with the the contents of your .env file. Only variables are filled in, values are left behind. The .env and .env.example files will always be in sync.

LINKS

📅 23-12-2021