Skip to content

Is it possible to commit with one format while develop locally with another format ? #15973

Answered by fisker
AlwaysNoobCoder asked this question in Q&A
Discussion options

You must be logged in to vote

interesting...

Maybe a dynamic prettier.config.js will do

import editor from "editor-info"

export default {
  printWidth: 
    // Only use 200 when running in my vscode
    // Or other way to identify user, eg: a `.gitignore`d file
    (process.env.USER || process.env.USERNAME) === "a-unique-name" &&
    editor.isEditor ?
      200 :
      80
}

Replies: 1 comment

Comment options

fisker
Jan 22, 2024
Maintainer Sponsor

You must be logged in to vote
0 replies
Answer selected by AlwaysNoobCoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants