Skip to content

Commit f578172

Browse files
committed
feat(prettier): add .gitattributes file for prettier
1 parent dde3aa6 commit f578172

File tree

3 files changed

+44
-16
lines changed

3 files changed

+44
-16
lines changed

Diff for: src/configs.ts

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ export const prettierConfigs = {
6060
singleQuote: false,
6161
};
6262

63+
export const prettierGitAttributeConfigs = `
64+
* text=auto eol=lf
65+
`;
66+
6367
export const flowConfigs = {
6468
ignore: {
6569
"<PROJECT_ROOT>/node_modules/.*": true,

Diff for: src/generators/PrettierGenerator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AddDependenciesAction } from "../actions/AddDependenciesAction";
33
import { AddScriptsAction } from "../actions/AddScriptsAction";
44
import { CreateConfigsFileAction } from "../actions/CreateConfigsFileAction";
55
import { CreateFileAction } from "../actions/CreateFileAction";
6-
import { ignoreFiles, prettierConfigs } from "../configs";
6+
import { ignoreFiles, prettierConfigs, prettierGitAttributeConfigs } from "../configs";
77
import { Formatter } from "../formatters/Formatter";
88
import { Packager } from "../packagers/Packager";
99
import { InquirerConfigs } from "../types";
@@ -23,6 +23,7 @@ export class PrettierGenerator extends Generator {
2323
): Action[] {
2424
return [
2525
new CreateConfigsFileAction(".prettierrc", configs, formatter),
26+
new CreateFileAction(".gitattributes", prettierGitAttributeConfigs),
2627
new CreateFileAction(".prettierignore", ignoreFiles),
2728
new AddScriptsAction(
2829
{ format: "prettier --write .", "check:prettier": "prettier --check ." },

Diff for: yarn.lock

+38-15
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@
2121
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed"
2222
integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==
2323

24-
"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13":
24+
"@babel/highlight@^7.10.4":
25+
version "7.13.10"
26+
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.13.10.tgz#a8b2a66148f5b27d666b15d81774347a731d52d1"
27+
integrity sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==
28+
dependencies:
29+
"@babel/helper-validator-identifier" "^7.12.11"
30+
chalk "^2.0.0"
31+
js-tokens "^4.0.0"
32+
33+
"@babel/highlight@^7.12.13":
2534
version "7.13.8"
2635
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.13.8.tgz#10b2dac78526424dfc1f47650d0e415dfd9dc481"
2736
integrity sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw==
@@ -285,9 +294,9 @@ ajv@^6.10.0, ajv@^6.12.4:
285294
uri-js "^4.2.2"
286295

287296
ajv@^7.0.2:
288-
version "7.1.1"
289-
resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.1.1.tgz#1e6b37a454021fa9941713f38b952fc1c8d32a84"
290-
integrity sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ==
297+
version "7.2.4"
298+
resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.2.4.tgz#8e239d4d56cf884bccca8cca362f508446dc160f"
299+
integrity sha512-nBeQgg/ZZA3u3SYxyaDvpvDtgZ/EZPF547ARgZBrG9Bhu1vKDwAIjtIf+sDtJUKa2zOcEbmRLBRSyMraS/Oy1A==
291300
dependencies:
292301
fast-deep-equal "^3.1.1"
293302
json-schema-traverse "^1.0.0"
@@ -789,9 +798,9 @@ eslint-visitor-keys@^2.0.0:
789798
integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==
790799

791800
eslint@^7.22.0:
792-
version "7.22.0"
793-
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.22.0.tgz#07ecc61052fec63661a2cab6bd507127c07adc6f"
794-
integrity sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==
801+
version "7.23.0"
802+
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.23.0.tgz#8d029d252f6e8cf45894b4bee08f5493f8e94325"
803+
integrity sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q==
795804
dependencies:
796805
"@babel/code-frame" "7.12.11"
797806
"@eslint/eslintrc" "^0.4.0"
@@ -1046,7 +1055,14 @@ github-slugger@^1.2.1:
10461055
dependencies:
10471056
emoji-regex ">=6.0.0 <=6.1.1"
10481057

1049-
glob-parent@^5.0.0, glob-parent@^5.1.0:
1058+
glob-parent@^5.0.0:
1059+
version "5.1.2"
1060+
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
1061+
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
1062+
dependencies:
1063+
is-glob "^4.0.1"
1064+
1065+
glob-parent@^5.1.0:
10501066
version "5.1.1"
10511067
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
10521068
integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==
@@ -1073,9 +1089,9 @@ globals@^12.1.0:
10731089
type-fest "^0.8.1"
10741090

10751091
globals@^13.6.0:
1076-
version "13.6.0"
1077-
resolved "https://registry.yarnpkg.com/globals/-/globals-13.6.0.tgz#d77138e53738567bb96a3916ff6f6b487af20ef7"
1078-
integrity sha512-YFKCX0SiPg7l5oKYCJ2zZGxcXprVXHcSnVuvzrT3oSENQonVLqM5pf9fN5dLGZGyCjhw8TN8Btwe/jKnZ0pjvQ==
1092+
version "13.7.0"
1093+
resolved "https://registry.yarnpkg.com/globals/-/globals-13.7.0.tgz#aed3bcefd80ad3ec0f0be2cf0c895110c0591795"
1094+
integrity sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==
10791095
dependencies:
10801096
type-fest "^0.20.2"
10811097

@@ -1863,7 +1879,14 @@ semver@^6.0.0:
18631879
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
18641880
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
18651881

1866-
semver@^7.2.1, semver@^7.3.2:
1882+
semver@^7.2.1:
1883+
version "7.3.5"
1884+
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
1885+
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
1886+
dependencies:
1887+
lru-cache "^6.0.0"
1888+
1889+
semver@^7.3.2:
18671890
version "7.3.4"
18681891
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97"
18691892
integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==
@@ -2194,9 +2217,9 @@ util-deprecate@^1.0.1:
21942217
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
21952218

21962219
v8-compile-cache@^2.0.3:
2197-
version "2.2.0"
2198-
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132"
2199-
integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==
2220+
version "2.3.0"
2221+
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
2222+
integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==
22002223

22012224
validate-npm-package-license@^3.0.1:
22022225
version "3.0.4"

0 commit comments

Comments
 (0)