-
Notifications
You must be signed in to change notification settings - Fork 49
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
Suggested fixes to tsconfig, prettier config #156
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c6bb407
Suggested dev experience fixes
elliot-nelson 0aa7c33
Bump `@types/prettier`
Andarist e65ffdb
Merge pull request #1 from Thinkmill/andarist/updade-prettier-types
elliot-nelson 97967a3
remove useUnknown setting
elliot-nelson 1d8392b
Update .prettierrc.js
elliot-nelson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Documentation for this file: https://prettier.io/docs/en/configuration.html | ||
module.exports = { | ||
// Use .gitattributes to manage newlines | ||
endOfLine: "auto", | ||
|
||
// Avoid line breaks in markdown | ||
proseWrap: "never", | ||
|
||
// Prettier plugins | ||
// | ||
// Disabling search dirs and pointing directly at folder paths relative to this config file | ||
// makes it easier for VSCode and WebStorm to find your plugins. | ||
pluginSearchDirs: [], | ||
plugins: ["./node_modules/prettier-plugin-packagejson"] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,18 @@ | |
"packages/*", | ||
"test-gatsby" | ||
], | ||
"scripts": { | ||
"postinstall": "preconstruct dev && manypkg check", | ||
"release": "yarn preconstruct build && yarn changeset publish", | ||
"test": "jest", | ||
"test-gatsby": "cd test-gatsby && gatsby develop" | ||
}, | ||
"jest": { | ||
"watchPlugins": [ | ||
"jest-watch-typeahead/filename", | ||
"jest-watch-typeahead/testname" | ||
] | ||
}, | ||
"dependencies": { | ||
"@babel/core": "^7.20.5", | ||
"@babel/preset-env": "^7.20.2", | ||
|
@@ -22,26 +34,12 @@ | |
"jest-watch-typeahead": "^0.6.0", | ||
"preconstruct": "^0.0.89", | ||
"prettier": "^2.8.1", | ||
"prettier-plugin-packagejson": "^2.3.0", | ||
"typescript": "^4.9.4" | ||
}, | ||
"jest": { | ||
"watchPlugins": [ | ||
"jest-watch-typeahead/filename", | ||
"jest-watch-typeahead/testname" | ||
] | ||
}, | ||
"preconstruct": { | ||
"packages": [ | ||
"packages/!(gatsby)*" | ||
] | ||
}, | ||
"prettier": { | ||
"proseWrap": "never" | ||
}, | ||
Comment on lines
-38
to
-40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm in the "explicit configs camp" too 👍 |
||
"scripts": { | ||
"postinstall": "preconstruct dev && manypkg check", | ||
"release": "yarn preconstruct build && yarn changeset publish", | ||
"test-gatsby": "cd test-gatsby && gatsby develop", | ||
"test": "jest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5747,7 +5747,7 @@ detect-libc@^1.0.2: | |
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" | ||
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= | ||
|
||
detect-newline@^3.0.0: | ||
detect-newline@3.1.0, detect-newline@^3.0.0: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" | ||
integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== | ||
|
@@ -7607,6 +7607,11 @@ getpass@^0.1.1: | |
dependencies: | ||
assert-plus "^1.0.0" | ||
|
||
[email protected]: | ||
version "1.0.3" | ||
resolved "https://registry.yarnpkg.com/git-hooks-list/-/git-hooks-list-1.0.3.tgz#be5baaf78203ce342f2f844a9d2b03dba1b45156" | ||
integrity sha512-Y7wLWcrLUXwk2noSka166byGCvhMtDRpgHdzCno1UQv/n/Hegp++a2xBWJL1lJarnKD3SWaljD+0z1ztqxuKyQ== | ||
|
||
[email protected]: | ||
version "4.0.1" | ||
resolved "https://registry.yarnpkg.com/git-up/-/git-up-4.0.1.tgz#cb2ef086653640e721d2042fe3104857d89007c0" | ||
|
@@ -7694,6 +7699,20 @@ globals@^11.1.0, globals@^11.7.0: | |
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" | ||
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== | ||
|
||
[email protected]: | ||
version "10.0.0" | ||
resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.0.tgz#abfcd0630037ae174a88590132c2f6804e291072" | ||
integrity sha512-3LifW9M4joGZasyYPz2A1U74zbC/45fvpXUvO/9KbSa+VV0aGZarWkfdgKyR9sExNP0t0x0ss/UMJpNpcaTspw== | ||
dependencies: | ||
"@types/glob" "^7.1.1" | ||
array-union "^2.1.0" | ||
dir-glob "^3.0.1" | ||
fast-glob "^3.0.3" | ||
glob "^7.1.3" | ||
ignore "^5.1.1" | ||
merge2 "^1.2.3" | ||
slash "^3.0.0" | ||
|
||
globby@^10.0.1: | ||
version "10.0.1" | ||
resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22" | ||
|
@@ -9031,6 +9050,11 @@ is-path-inside@^3.0.1: | |
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" | ||
integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== | ||
|
||
[email protected]: | ||
version "2.1.0" | ||
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" | ||
integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== | ||
|
||
is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: | ||
version "1.1.0" | ||
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" | ||
|
@@ -12361,6 +12385,13 @@ prepend-http@^2.0.0: | |
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" | ||
integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= | ||
|
||
prettier-plugin-packagejson@^2.3.0: | ||
version "2.3.0" | ||
resolved "https://registry.yarnpkg.com/prettier-plugin-packagejson/-/prettier-plugin-packagejson-2.3.0.tgz#5c242a39627c227d813161618fa88e64e44e9c84" | ||
integrity sha512-2SAPMMk1UDkqsB7DifWKcwCm6VC52JXMrzLHfbcQHJRWhRCj9zziOy+s+2XOyPBeyqFqS+A/1IKzOrxKFTo6pw== | ||
dependencies: | ||
sort-package-json "1.57.0" | ||
|
||
prettier@^1.18.2: | ||
version "1.18.2" | ||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" | ||
|
@@ -14041,6 +14072,23 @@ sort-keys@^2.0.0: | |
dependencies: | ||
is-plain-obj "^1.0.0" | ||
|
||
sort-object-keys@^1.1.3: | ||
version "1.1.3" | ||
resolved "https://registry.yarnpkg.com/sort-object-keys/-/sort-object-keys-1.1.3.tgz#bff833fe85cab147b34742e45863453c1e190b45" | ||
integrity sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg== | ||
|
||
[email protected]: | ||
version "1.57.0" | ||
resolved "https://registry.yarnpkg.com/sort-package-json/-/sort-package-json-1.57.0.tgz#e95fb44af8ede0bb6147e3f39258102d4bb23fc4" | ||
integrity sha512-FYsjYn2dHTRb41wqnv+uEqCUvBpK3jZcTp9rbz2qDTmel7Pmdtf+i2rLaaPMRZeSVM60V3Se31GyWFpmKs4Q5Q== | ||
dependencies: | ||
detect-indent "^6.0.0" | ||
detect-newline "3.1.0" | ||
git-hooks-list "1.0.3" | ||
globby "10.0.0" | ||
is-plain-obj "2.1.0" | ||
sort-object-keys "^1.1.3" | ||
|
||
source-list-map@^1.1.1: | ||
version "1.1.2" | ||
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-1.1.2.tgz#9889019d1024cce55cdc069498337ef6186a11a1" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting - do you happen to have a link to some issues related to this? I'm just curious why the automatic plugin search tends to fail in those contexts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you've challenged me on it, I suspect that this is a defense mechanism for Rush in particular.
If you have a Lerna repo or something and you use a root-level
package.json
to keep your prettier devDependency, which lives in a root-levelnode_modules
, then I think 99.9% of the time VSCode would "do the right thing".But in a Rush repo, there is no root package or node modules, and plugins are kept in a special folder; VSCode typically can't find this folder unless you specify exactly where it is. I can test out simplifying this for this repo since it probably would work just fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ye - this might makes sense in the context of Rush if the location of plugins etc is not standard. That being said, I prefer an explicit list of plugins rather than one based on auto-search.