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

fix(lint): Change endOfLine rules to better support linting on Windows #311

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

HowardBraham
Copy link
Contributor

Before this PR, if you run eslint on Windows, you will get thousands of CRLF errors like this:

    1:52   error  Delete `␍`  prettier/prettier
    2:52   error  Delete `␍`  prettier/prettier
    3:74   error  Delete `␍`  prettier/prettier

You can fix them with yarn lint:fix, but they will probably come back again, depending on your git and text editor settings.

Meanwhile, git commits everything as LF, so it shouldn't affect Mac/Linux.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

I wonder why the default for endOfLine changed in Prettier 2. It seems like something called "auto" should be the default. Oh well 🤷🏻‍♂️

Changes to the Prettier config look good, just had a question about the changes to environment.json.

@@ -209,6 +209,10 @@
"name": "ClipboardEvent",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "ClipboardItem",
Copy link
Contributor

Choose a reason for hiding this comment

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

Were these changes also necessary to get things working on Windows or should these go in another PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah good question. That's just what happened when I ran yarn generate, but maybe it's not necessary?

Copy link
Contributor

@mcmire mcmire Jul 18, 2023

Choose a reason for hiding this comment

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

It's possible these files are out of date — we've been doing some dependency upgrades lately — but yeah, if the tests still pass here without these changes I'd say leave them out and we can address them in a new PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay I reverted those changes and the tests still passed

Copy link
Contributor

@mcmire mcmire Jul 18, 2023

Choose a reason for hiding this comment

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

Hmm, so when I run yarn generate on your branch, I don't see any changes. Which Node version are you using?

Copy link
Contributor Author

@HowardBraham HowardBraham Jul 18, 2023

Choose a reason for hiding this comment

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

16.20.0
(same result on Node 14 and 18)

Copy link
Contributor

@mcmire mcmire Jul 18, 2023

Choose a reason for hiding this comment

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

Ah - that might be the reason. The .nvmrc specifies v14, so that's the recommended dev version of Node for this repo. Probably need to bump this, but in any case, I think that explains the difference in globals. Oh, I just saw your edit. Hmm, interesting. I'll have to look further into this.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Looks good!

@HowardBraham HowardBraham merged commit 9a3be2b into main Jul 18, 2023
@HowardBraham HowardBraham deleted the fix/windows-lint branch July 18, 2023 18:37
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