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

Set the ignorePath for prettier #952

Merged
merged 2 commits into from
Sep 24, 2021
Merged

Set the ignorePath for prettier #952

merged 2 commits into from
Sep 24, 2021

Conversation

prsdta
Copy link
Contributor

@prsdta prsdta commented Sep 24, 2021

Why

#949

What

By simply adding a path to a .prettierignore file at the root of a project, prettier should be able to read it.

TODO

  • Try to add ignore tests

Prettier's node API does not read a `.prettierignore` file by
default, which causes frolint to ignore that file.

By simply adding a path to a `.prettierignore` file at the root of a
project, prettier should be able to read it.
@github-actions github-actions bot added frolint https://www.npmjs.com/package/frolint repo Root directory of this project labels Sep 24, 2021
@prsdta prsdta linked an issue Sep 24, 2021 that may be closed by this pull request
Use a temporary file to test the whole behavior of the prettier
util, as a kind of an integration test.
@prsdta prsdta changed the title WIP Set the ignorePath for prettier Set the ignorePath for prettier Sep 24, 2021
@prsdta prsdta marked this pull request as ready for review September 24, 2021 07:54
} ;`;

function createTestFile() {
(writeFileSync || writeFile)(testFilename, baseContent);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to use different APIs for different Node.js version. writeFileSync is not available in v12

Copy link

@tkeiyama tkeiyama left a comment

Choose a reason for hiding this comment

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

Very nice work :D

The test file is awesome to easily check how the function works.

@prsdta
Copy link
Contributor Author

prsdta commented Sep 24, 2021

@tkeiyama Thanks 😄

@prsdta prsdta merged commit 3673673 into master Sep 24, 2021
@prsdta prsdta deleted the prsdta/fix-prettier-ignore branch September 24, 2021 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frolint https://www.npmjs.com/package/frolint repo Root directory of this project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frolint does not use .prettierignore
2 participants