Skip to content

use .prettierrc when it exist (instead of default prettier config with tabWidth: 2) #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mixalbl4-127 opened this issue Jun 1, 2021 · 1 comment

Comments

@mixalbl4-127
Copy link

mixalbl4-127 commented Jun 1, 2021

@js2me https://prettier.io/docs/en/configuration.html

@mixalbl4-127 mixalbl4-127 changed the title Feature: use .prettierrc when it exist (instead of default prettier config with tabWidth: 2) use .prettierrc when it exist (instead of default prettier config with tabWidth: 2) Jun 1, 2021
@jjaros
Copy link

jjaros commented Oct 6, 2022

Hi, I simply updated the scripts in my project package.json as follows:

  "scripts": {
    ...
    "generate-api": "ts-node build-scripts/generate-api && eslint --fix \"src/models/swagger-gen/*.ts?(x)\"",
    "build": "yarn generate-api && react-scripts build",
    ...
  },

generate-api - it starts the swagger-typescript-api (customized via build-scripts/generate-api/index.ts file) and then starts the ESlint which also runs the prettier. The files .eslintrc and .prettierrc are used from the project.

build - first generates the API files and then builds my React app in standard way

I think you can easily use this approach regardless of the framework (React, Angular, Vue, ...) or package manager (yarn, npm, ...) you use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants