7

How to take advantage of different tools to write code with your team without conflicts

Learn how to streamline collaboration and maintain code quality using Git flow, ESLint, Prettier, pre-commit hooks, and CI/CD verifications.

Building harmony in team coding workflows

Collaboration in software development is challenging.
Conflicts in workflows, inconsistent code styles, and integration issues can disrupt team productivity and cause frustration.

The good news? With the right tools and practices, your team can transform chaos into harmony.


๐Ÿ› ๏ธ Essential tools for team collaboration

To ensure smooth collaboration, your team needs tools that enhance visibility, enforce standards, and automate tedious tasks. Here's how to use them effectively:


1๏ธโƒฃ Git Flow โ€” Structuring your work

Git Flow is a branching model designed to organize development efforts:

  • Feature branches: Isolate work on new features.
  • Develop branch: Integrate completed features for testing.
  • Release branch: Prepare stable versions for production.
  • Hotfix branch: Quickly address critical issues in production.

๐Ÿ’ฌ Comment: Git Flow gives visibility and structure. Each team member knows where to work without colliding with others, reducing the risk of merge conflicts and messy histories.

๐Ÿ’ก Pro tip: Use branch naming conventions (e.g., feature/login-page, hotfix/payment-crash) to maintain clarity.
๐Ÿ“š Related resource: Git Flow documentation


2๏ธโƒฃ ESLint โ€” Enforcing code quality

Inconsistent and error-prone code slows down development. ESLint ensures your team adheres to consistent coding standards by:

  • Detecting syntax errors.
  • Enforcing best practices.
  • Highlighting potential bugs.

๐Ÿงฉ Example configuration:

{
  "extends": "eslint:recommended",
  "rules": {
    "semi": ["error", "always"],
    "quotes": ["error", "single"]
  }
}

๐Ÿ’ฌ Comment: ESLint keeps everyone aligned with the same standards. No matter who writes the code, the result feels unified and predictable.

๐Ÿ’ก Pro tip: Extend ESLint with plugins like eslint-plugin-react for framework-specific rules.


โš™๏ธ Advanced ESLint Rules and Plugins

Beyond syntax and style, ESLint offers a wide ecosystem of rules and plugins that help maintain a clean and performant project.
Each rule can be configured with different levels โ€” off, warn, or error โ€” and your CI/CD can be set to reject builds or pull requests if certain errors are found.

๐Ÿ” Common Plugins & Rules

  • react-hooks โ€” Rules like react-hooks/rules-of-hooks and react-hooks/exhaustive-deps verify hook usage and dependency arrays to avoid race conditions and logic bugs.
    (You can disable a specific dependency check in a useEffect comment if needed.)

  • plugin-no-inline-styles โ€” Inline styles in React Native often become unmaintainable. This plugin helps enforce style organization.
    Personally, I keep StyleSheet blocks in the same file (for context and cleanup) so the rule can track unused styles efficiently.

  • no-barrel-files โ€” Barrel files (index.js exports) can hurt performance and hide imports.
    This rule helps identify and remove them where possible.

  • @typescript-eslint/no-unused-vars โ€” Highlights unused variables to keep code clean.
    You can prefix a variable with _ to safely ignore it when intentional.

  • react-native/no-inline-styles โ€” Inline styles cause re-renders and performance hits.
    Tools like React Native Style Generator (VS Code plugin) help refactor these quickly.

  • import/order + sort-imports โ€” Maintain a clear, grouped import structure to improve readability and speed up comprehension.

    ๐Ÿ’ก Tip: Organize imports by group:
    react, react-native, external libs, project aliases (@/), parents, siblings.

    Example (single block):

    import React, { useState } from 'react';
    import { Keyboard, Platform, StyleSheet, View } from 'react-native';
    import Animated from 'react-native-reanimated';
    import { MyText } from '@/components';
    import { colors } from '@/styles';
    import { ParentComponent } from '../Parent';
    import { SiblingComponent } from './Sibling';
    

    Example (with newlines-between):

    import React, { useState } from 'react';
    import { Keyboard, Platform, StyleSheet, View } from 'react-native';
    
    import Animated from 'react-native-reanimated';
    
    import { MyText } from '@/components';
    import { colors } from '@/styles';
    
    import { ParentComponent } from '../Parent';
    import { SiblingComponent } from './Sibling';
    

๐Ÿ’ฌ Comment: Start with these rules in warn mode to evaluate project impact. Once your repository is clean, enforce them as error to block regressions during commits or CI builds.


3๏ธโƒฃ Prettier โ€” Formatting code automatically

Arguments about code style are a waste of time. Prettier eliminates these debates by automatically formatting code to match a defined style.

๐Ÿ”ง Integration with ESLint:

{
  "extends": ["eslint:recommended", "plugin:prettier/recommended"]
}

๐Ÿ’ฌ Comment: Let Prettier handle formatting โ€” it's not about "personal style," it's about consistency and readability for everyone.

๐Ÿ’ก Pro tip: Enable Prettier to autoformat code on save in your IDE.


4๏ธโƒฃ Pre-commit hooks โ€” Catch issues early

Pre-commit hooks automate checks locally before your code is even pushed.
Use tools like Husky to enforce:

  • Running ESLint and Prettier.
  • Verifying tests pass.
  • Checking for unused files or code with npx unimported.
  • Ensuring commit messages follow guidelines.

๐Ÿงฉ Example with Husky:

npx husky add .husky/pre-commit "npm run lint && npm run test && npx unimported"

๐Ÿ’ฌ Comment:
Pre-commit hooks run on your local branch, before code reaches remote.
Tools like unimported help keep the project clean by detecting unused code or assets โ€” this reduces binary size and avoids shipping dead files.

๐Ÿ’ก Pro tip: You can configure unimported to ignore specific directories (like templates or config files) that are required but not directly imported.


5๏ธโƒฃ CI/CD verifications โ€” Automating quality checks

CI/CD pipelines ensure every code change is tested and verified before it reaches production.
Typical steps include:

  • Linting: ESLint and Prettier checks.
  • Testing: Run unit and integration tests.
  • Code cleanliness: Use npx unimported to verify the repository doesn't contain unused code or assets.
  • Building: Verify the app compiles successfully.

๐Ÿงฉ Example CI pipeline (GitHub Actions):

name: CI
on:
  pull_request:
    branches: ["*"]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - run: npm ci
      - run: npm run lint
      - run: npm run test
      - run: npx unimported

๐Ÿ’ฌ Comment:
On CI/CD, checks run on your Pull Request, combining your branch with the base branch (usually develop or main).
This ensures your code not only works in isolation โ€” it also integrates cleanly with the rest of the project.
Running unimported here prevents dead code from living in your mainline, keeping builds lean and efficient.

๐Ÿ’ก Pro tip: Use branches like develop or release to test features in staging before merging into main.


๐Ÿ’ช The benefits of using these tools together

By integrating these tools into your workflow, your team can:

  • ๐Ÿšซ Reduce conflicts: Automatic formatting and linting ensure consistent code.
  • ๐Ÿงน Keep the project clean: Tools like unimported remove clutter and reduce bundle size.
  • โš™๏ธ Enforce standards: ESLint plugins and advanced rules prevent regressions before they ship.
  • โฑ๏ธ Save time: Automate tedious checks with pre-commits and CI/CD pipelines.
  • โœ… Improve quality: Early detection of issues prevents production problems.
  • ๐Ÿค Enhance collaboration: A clear Git Flow structure simplifies teamwork.

๐ŸŽฏ The takeaway

Writing code as a team doesn't have to be chaotic.
With Git Flow, ESLint, Prettier, pre-commit hooks, and CI/CD verifications, your team can focus on building great software without worrying about conflicts or quality issues.

Start small โ€” adopt one tool at a time โ€” and gradually build a workflow that fits your team's needs.
Collaboration works best when it's supported by the right tools.

Happy coding! ๐Ÿ’ป