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
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// All of these are defaults except singleQuote, but we specify them
// All of these are defaults except singleQuote and endOfLine, but we specify them
// for explicitness
module.exports = {
endOfLine: 'auto',
quoteProps: 'as-needed',
singleQuote: true,
tabWidth: 2,
Expand Down
25 changes: 9 additions & 16 deletions packages/base/rules-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@
"name": "ClipboardEvent",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "ClipboardItem",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "close",
"message": "This global is not available in the Node.js and browser environment."
Expand Down Expand Up @@ -884,10 +888,6 @@
"name": "FontFaceSetLoadEvent",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "FormData",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "FormDataEvent",
"message": "This global is not available in the Node.js and browser environment."
Expand Down Expand Up @@ -928,10 +928,6 @@
"name": "HashChangeEvent",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "Headers",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "history",
"message": "This global is not available in the Node.js and browser environment."
Expand Down Expand Up @@ -1564,6 +1560,10 @@
"name": "Navigator",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "NavigatorUAData",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "NetworkInformation",
"message": "This global is not available in the Node.js and browser environment."
Expand Down Expand Up @@ -2248,10 +2248,6 @@
"name": "reportError",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "Request",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "requestAnimationFrame",
"message": "This global is not available in the Node.js and browser environment."
Expand All @@ -2276,10 +2272,6 @@
"name": "resizeTo",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "Response",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "RTCCertificate",
"message": "This global is not available in the Node.js and browser environment."
Expand Down Expand Up @@ -3310,6 +3302,7 @@
"prettier/prettier": [
"error",
{
"endOfLine": "auto",
"quoteProps": "as-needed",
"singleQuote": true,
"tabWidth": 2,
Expand Down
24 changes: 8 additions & 16 deletions packages/base/src/environment.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.

"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "close",
"message": "This global is not available in the Node.js and browser environment."
Expand Down Expand Up @@ -553,10 +557,6 @@
"name": "FontFaceSetLoadEvent",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "FormData",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "FormDataEvent",
"message": "This global is not available in the Node.js and browser environment."
Expand Down Expand Up @@ -597,10 +597,6 @@
"name": "HashChangeEvent",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "Headers",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "history",
"message": "This global is not available in the Node.js and browser environment."
Expand Down Expand Up @@ -1233,6 +1229,10 @@
"name": "Navigator",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "NavigatorUAData",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "NetworkInformation",
"message": "This global is not available in the Node.js and browser environment."
Expand Down Expand Up @@ -1917,10 +1917,6 @@
"name": "reportError",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "Request",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "requestAnimationFrame",
"message": "This global is not available in the Node.js and browser environment."
Expand All @@ -1945,10 +1941,6 @@
"name": "resizeTo",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "Response",
"message": "This global is not available in the Node.js and browser environment."
},
{
"name": "RTCCertificate",
"message": "This global is not available in the Node.js and browser environment."
Expand Down
3 changes: 2 additions & 1 deletion packages/base/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ module.exports = {
'prettier/prettier': [
'error',
{
// All of these are defaults except singleQuote, but we specify them
// All of these are defaults except singleQuote and endOfLine, but we specify them
// for explicitness
endOfLine: 'auto',
quoteProps: 'as-needed',
singleQuote: true,
tabWidth: 2,
Expand Down
24 changes: 8 additions & 16 deletions packages/commonjs/rules-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@
"name": "ClipboardEvent",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "ClipboardItem",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "close",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down Expand Up @@ -553,10 +557,6 @@
"name": "FontFaceSetLoadEvent",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "FormData",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "FormDataEvent",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down Expand Up @@ -597,10 +597,6 @@
"name": "HashChangeEvent",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "Headers",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "history",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down Expand Up @@ -1233,6 +1229,10 @@
"name": "Navigator",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "NavigatorUAData",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "NetworkInformation",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down Expand Up @@ -1917,10 +1917,6 @@
"name": "reportError",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "Request",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "requestAnimationFrame",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand All @@ -1945,10 +1941,6 @@
"name": "resizeTo",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "Response",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "RTCCertificate",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down
24 changes: 8 additions & 16 deletions packages/commonjs/src/environment.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@
"name": "ClipboardEvent",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "ClipboardItem",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "close",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down Expand Up @@ -553,10 +557,6 @@
"name": "FontFaceSetLoadEvent",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "FormData",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "FormDataEvent",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down Expand Up @@ -597,10 +597,6 @@
"name": "HashChangeEvent",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "Headers",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "history",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down Expand Up @@ -1233,6 +1229,10 @@
"name": "Navigator",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "NavigatorUAData",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "NetworkInformation",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down Expand Up @@ -1917,10 +1917,6 @@
"name": "reportError",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "Request",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "requestAnimationFrame",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand All @@ -1945,10 +1941,6 @@
"name": "resizeTo",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "Response",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
},
{
"name": "RTCCertificate",
"message": "This global is not available in the Node.js and browser (CommonJS) environment."
Expand Down
24 changes: 8 additions & 16 deletions packages/nodejs/rules-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@
"name": "ClipboardEvent",
"message": "This global is not available in the Node.js environment."
},
{
"name": "ClipboardItem",
"message": "This global is not available in the Node.js environment."
},
{
"name": "close",
"message": "This global is not available in the Node.js environment."
Expand Down Expand Up @@ -590,10 +594,6 @@
"name": "FontFaceSetLoadEvent",
"message": "This global is not available in the Node.js environment."
},
{
"name": "FormData",
"message": "This global is not available in the Node.js environment."
},
{
"name": "FormDataEvent",
"message": "This global is not available in the Node.js environment."
Expand Down Expand Up @@ -634,10 +634,6 @@
"name": "HashChangeEvent",
"message": "This global is not available in the Node.js environment."
},
{
"name": "Headers",
"message": "This global is not available in the Node.js environment."
},
{
"name": "history",
"message": "This global is not available in the Node.js environment."
Expand Down Expand Up @@ -1270,6 +1266,10 @@
"name": "Navigator",
"message": "This global is not available in the Node.js environment."
},
{
"name": "NavigatorUAData",
"message": "This global is not available in the Node.js environment."
},
{
"name": "NetworkInformation",
"message": "This global is not available in the Node.js environment."
Expand Down Expand Up @@ -1954,10 +1954,6 @@
"name": "reportError",
"message": "This global is not available in the Node.js environment."
},
{
"name": "Request",
"message": "This global is not available in the Node.js environment."
},
{
"name": "requestAnimationFrame",
"message": "This global is not available in the Node.js environment."
Expand All @@ -1982,10 +1978,6 @@
"name": "resizeTo",
"message": "This global is not available in the Node.js environment."
},
{
"name": "Response",
"message": "This global is not available in the Node.js environment."
},
{
"name": "RTCCertificate",
"message": "This global is not available in the Node.js environment."
Expand Down
Loading