Last active
April 8, 2025 10:02
-
-
Save montasim/62b7f440f23ae69ab78ef897db2ae953 to your computer and use it in GitHub Desktop.
Ignoring these files and directories ensures that Prettier only formats the code files you actively develop and maintain, such as .js, .jsx, .ts, .tsx, .css, .html, etc. This helps maintain the integrity and readability of configuration files and directories that either contain generated code, package dependencies, or configuration settings that…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################################### | |
# .prettierignore Configuration File | |
#################################################### | |
# | |
# Version: 1.0.0 | |
# License: CC BY-NC-ND 4.0 | |
# | |
# Author: Mohammad Montasim-Al-Mamun Shuvo | |
# Created: 2025-01-28 | |
# Contact Email: [email protected] | |
# Contact GitHub: https://github.com/montasim | |
#################################################### | |
# Purpose: | |
# The .prettierignore file is used to specify which files and directories | |
# should be ignored by Prettier, the code formatting tool. Ignoring these files | |
# ensures that Prettier does not format files that are automatically generated, | |
# or where formatting is otherwise unnecessary or undesirable, maintaining a clean | |
# and consistent code style where it matters most. | |
#################################################### | |
# IDE AND CODE EDITOR SETTINGS | |
#################################################### | |
# Purpose: | |
# Configuration files generated by IDEs and editors are often user-specific | |
# and should not be formatted. This prevents formatting conflicts and maintains | |
# individual workspace settings. | |
# JetBrains IDEA/Android Studio project settings. | |
.idea | |
# Visual Studio Code workspace settings. | |
.vscode | |
# Visual Studio workspace settings. | |
.vs | |
# macOS-specific file created by Finder for file metadata. | |
.DS_Store | |
#################################################### | |
# DEPENDENCY DIRECTORIES | |
#################################################### | |
# Purpose: | |
# Directories like `node_modules` or `.yarn/` contain installed dependencies | |
# which should not be formatted. These directories are regenerated by package | |
# managers and are not manually maintained. | |
# Installed Node.js project dependencies. | |
/node_modules | |
# Yarn lockfile, cache, and plugin data. | |
.yarn/ | |
# Plug'n'Play manifest and JavaScript file. | |
.pnp | |
# JavaScript file for Yarn's Plug'n'Play feature. | |
.pnp.js | |
# Cached install state for Yarn berry. | |
.yarn/install-state.gz | |
#################################################### | |
# BUILD OUTPUTS | |
#################################################### | |
# Purpose: | |
# Build artifacts and compiled code are generated automatically during | |
# development or production builds and should not be formatted. | |
# General output folder for build artifacts. | |
/build | |
# Next.js build directory. | |
.next/ | |
# Generic folder for production deployments. | |
.out/ | |
#################################################### | |
# LOG FILES | |
#################################################### | |
# Purpose: | |
# Log files contain runtime and error information and are not relevant | |
# for code formatting. | |
# Generic directory for logs and specific log files. | |
logs/ | |
logs*.json | |
docker.log | |
npm-debug.log* | |
yarn-debug.log* | |
#################################################### | |
# ENVIRONMENT VARIABLE CONFIGURATIONS | |
#################################################### | |
# Purpose: | |
# Environment configuration files contain sensitive data and specific | |
# settings that should not be altered by formatting tools. | |
# All environment variable files. | |
.env | |
.env.development | |
.env.test | |
.env.staging | |
.env.uat | |
.env.production | |
.env*.local | |
#################################################### | |
# DOCUMENTATION | |
#################################################### | |
# Purpose: | |
# Documentation often follows a specified format that should not be altered | |
# by formatting tools to ensure their structured content remains intact. | |
# General documentation directory and specific documentation files. | |
/documentation/ | |
LICENSE | |
src/modules/api/documentation/ | |
#################################################### | |
# VERCEL CONFIGURATION | |
#################################################### | |
# Purpose: | |
# Vercel deployment configuration should not be altered by formatting tools | |
# as it is specific to deployment environments. | |
# Vercel configuration files. | |
.vercel | |
#################################################### | |
# MISCELLANEOUS | |
#################################################### | |
# Purpose: | |
# Miscellaneous files that do not fit other categories but are typically | |
# unnecessary for formatting. | |
# TypeScript incremental build information. | |
*.tsbuildinfo | |
# Auto-generated Next.js environment types. | |
next-env.d.ts | |
# Private keys or other sensitive PEM files. | |
*.pem | |
#################################################### | |
# LOCAL FILE UPLOADS | |
#################################################### | |
# Purpose: | |
# Files uploaded by users during development are stored temporarily and | |
# should not be formatted to avoid conflicts or unauthorized access. | |
# Temporary storage for user-uploaded files. | |
/public/assets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
File Overview
.prettierignore is used to exclude certain files and directories from Prettier's formatting process. This is particularly useful for minimizing disruption in files that may not benefit from formatting, or where formatting might introduce errors or stylistic conflicts.
Descriptions of Ignored Items
.idea: This directory typically contains project settings specific to JetBrains IDEs like IntelliJ IDEA. It includes user-specific settings that do not need formatting and should not be altered by tools like Prettier.
node_modules: A directory where npm or yarn installs the project’s npm package dependencies. It should be ignored as it contains third-party code that you don’t need to format.
build: Often contains compiled or transpiled code generated from your source files. Since this is output code, it should not be formatted by Prettier.
logs: This might refer to a directory that stores log files. Formatting log files is unnecessary and can potentially alter their readability.
documentation: If your documentation includes auto-generated files or specific markdown formatting that shouldn’t be altered, ignoring this directory can prevent unwanted changes.
yarn.lock: This file is automatically generated by Yarn to lock the versions of package dependencies. It should not be formatted as its structure is managed by Yarn itself.
LICENSE: Typically a plain text file outlining the license under which the project is provided. Formatting this could alter its legal phrasing or structure unintentionally.
SECURITY.md: A markdown file typically used to provide security-related information. This might contain specific formatting that should not be altered.
.prettierignore: Including this file in the ignore list ensures that Prettier doesn’t attempt to format its own configuration files.
.babelrc: Configuration file for Babel, a JavaScript compiler. This is typically a JSON file and should retain its format for Babel to read correctly.
.env and .env.development: Environment variable files that should not be altered by formatting tools to prevent potential issues in how values are read at runtime.