Skip to content
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

Run prettier on project. #6

Merged
merged 19 commits into from
Aug 18, 2023
Merged

Run prettier on project. #6

merged 19 commits into from
Aug 18, 2023

Conversation

geekiam23
Copy link
Contributor

  • Run prettier on project to use single quotes.

@geekiam23 geekiam23 requested review from fridaland and removed request for stevehanson May 10, 2023 21:28
Copy link
Contributor

@stevehanson stevehanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: it seems this PR is just for running Prettier. I was confused because the diff shows the changes for where you add the Prettier command. Can we clean up this diff so it can be reviewed more easily?

.prettierrc Outdated Show resolved Hide resolved
src/commands/prettier.ts Outdated Show resolved Hide resolved
src/util/getPackageManager.ts Outdated Show resolved Hide resolved
@stevehanson
Copy link
Contributor

@geekiam23 what is the status of this PR? I'd like to either close this or move the PR forward so we can get this in or so someone else can pick it up.

stevehanson and others added 14 commits August 14, 2023 22:16
Commander can automatically import files for us by specifying
'executableFile' for commands. This unfortunately doesn't work well with
TypeScript, which was why we were using `node -r ts-node` to run the CLI
instead of `ts-node`. This setup to get commander working was also
causing other issues with file imports.

This commit updates so we now manually import files for commands, which
enables us to revert the less-conventional TypeScript config.
- Setup inquirer to ask questions about prettier config
- If prettierrc/prettier.js or .prettierignore exists, it will not create any new files.
- Add ts-node key to tsconfig.json to help with node typescript errors.
- Add .prettierignore.template to use to write to .prettierignore.
- Add formatFile to format any files we add to the project.
- Add getProjectDir to get main directory of project.
Since the tool is only React Native for now, it didn't seem necessary to
have the 'react-native' directory. Moved to 'src'.

Also created utility for importing commands for commander
- Setup inquirer to ask questions about prettier config
- If prettierrc/prettier.js or .prettierignore exists, it will not create any new files.
- Add ts-node key to tsconfig.json to help with node typescript errors.
- Add .prettierignore.template to use to write to .prettierignore.
- Add formatFile to format any files we add to the project.
- Add getProjectDir to get main directory of project.
Copy link
Contributor

@stevehanson stevehanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. Does this project have a Prettier config already?

Copy link
Contributor

@stevehanson stevehanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

* Add eslint path

* Run linter

* Remove log

* Remove extra formatting file

* Update to use thoughtbot eslint package

* Remove overrides in template
Base automatically changed from create-prettier-path to main August 18, 2023 17:09
@geekiam23 geekiam23 merged commit 030b4b1 into main Aug 18, 2023
4 checks passed
@geekiam23 geekiam23 deleted the run-prettier branch August 18, 2023 17:14
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

Successfully merging this pull request may close these issues.

2 participants