Skip to content

Commit

Permalink
fix(#2628): generate eol LF config
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-crouzet committed Dec 20, 2024
1 parent 0a97daf commit c22bda8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ packageExtensions:
"@swc/types": "*"
"@typescript-eslint/rule-tester@*":
dependencies:
"@typescript-eslint/parser": ~8.17.0
"@typescript-eslint/parser": ~8.18.0
"@angular-eslint/eslint-plugin-template@*":
dependencies:
"@typescript-eslint/types": "^8.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@ama-sdk/schematics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"@swc/helpers": "~0.5.0",
"@commitlint/cli": "^19.0.0",
"@commitlint/config-conventional": "^19.0.0",
"@typescript-eslint/eslint-plugin": "~8.17.0",
"@typescript-eslint/eslint-plugin": "~8.18.0",
"jest-junit": "~16.0.0",
"lint-staged": "^15.0.0",
"minimist": "^1.2.6",
Expand Down
6 changes: 3 additions & 3 deletions packages/@o3r/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@
"@o3r/store-sync": "workspace:^",
"@stylistic/eslint-plugin": "~2.7.0",
"@types/jest": "~29.5.2",
"@typescript-eslint/eslint-plugin": "~8.17.0",
"@typescript-eslint/parser": "~8.17.0",
"@typescript-eslint/eslint-plugin": "~8.18.0",
"@typescript-eslint/parser": "~8.18.0",
"angular-eslint": "~18.4.0",
"cpy-cli": "^5.0.0",
"eslint": "~9.14.0",
Expand All @@ -176,7 +176,7 @@
"jest-preset-angular": "~14.2.0",
"jsonc-eslint-parser": "~2.4.0",
"nx": "~19.8.0",
"typescript-eslint": "~8.17.0",
"typescript-eslint": "~8.18.0",
"zone.js": "~0.14.2"
},
"engines": {
Expand Down
16 changes: 16 additions & 0 deletions packages/@o3r/create/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
type SpawnSyncOptionsWithBufferEncoding,
} from 'node:child_process';
import {
existsSync,
readFileSync,
writeFileSync,
} from 'node:fs';
Expand Down Expand Up @@ -265,6 +266,21 @@ const prepareWorkspace = (relativeDirectory = '.', projectPackageManager = 'npm'
}
}

if (argv.minimal) {
const editorconfigPath = resolve(cwd, '.editorconfig');
const editorconfig = existsSync(editorconfigPath) ? readFileSync(editorconfigPath, { encoding: 'utf8' }) : '';
const newEditorconfig = /\[[*]\]/.test(editorconfig)
? editorconfig.replace(/(\[[*]\])/, '$1\nend_of_line = lf')
: editorconfig.concat('[*]\nend_of_line = lf');
writeFileSync(editorconfigPath, newEditorconfig);
}
const gitAttributesPath = resolve(cwd, '.gitattributes');
writeFileSync(
gitAttributesPath,
(existsSync(gitAttributesPath) ? readFileSync(gitAttributesPath, { encoding: 'utf8' }) : '')
.concat('* text eol=lf')
);

exitProcessIfErrorInSpawnSync(INSTALL_PROCESS_ERROR_CODE, spawnSync(runner, ['install'], spawnSyncOpts));
};

Expand Down
6 changes: 3 additions & 3 deletions packages/@o3r/eslint-config-otter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
"typescript": "^5.5.4"
},
"generatorDependencies": {
"@typescript-eslint/eslint-plugin": "~8.17.0",
"@typescript-eslint/parser": "~8.17.0",
"@typescript-eslint/utils": "~8.17.0",
"@typescript-eslint/eslint-plugin": "~8.18.0",
"@typescript-eslint/parser": "~8.18.0",
"@typescript-eslint/utils": "~8.18.0",
"eslint": "~9.14.0",
"eslint-plugin-jsdoc": "~50.2.0",
"eslint-plugin-unicorn": "^56.0.0"
Expand Down
64 changes: 0 additions & 64 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14892,24 +14892,6 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/parser@npm:~8.17.0":
version: 8.17.0
resolution: "@typescript-eslint/parser@npm:8.17.0"
dependencies:
"@typescript-eslint/scope-manager": "npm:8.17.0"
"@typescript-eslint/types": "npm:8.17.0"
"@typescript-eslint/typescript-estree": "npm:8.17.0"
"@typescript-eslint/visitor-keys": "npm:8.17.0"
debug: "npm:^4.3.4"
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 10/464981e1424e4a7849ca7253b54092a67d33130d28ecf492efd56d5ce69e640a876b7f84e59f1e368e763125432c34e7de28d78c0eef1bda4e9a9d52de0ccac5
languageName: node
linkType: hard

"@typescript-eslint/rule-tester@npm:~8.18.0":
version: 8.18.1
resolution: "@typescript-eslint/rule-tester@npm:8.18.1"
Expand All @@ -14926,16 +14908,6 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/scope-manager@npm:8.17.0":
version: 8.17.0
resolution: "@typescript-eslint/scope-manager@npm:8.17.0"
dependencies:
"@typescript-eslint/types": "npm:8.17.0"
"@typescript-eslint/visitor-keys": "npm:8.17.0"
checksum: 10/fa934d9fd88070833c57a3e79c0f933d0b68884c00293a1d571889b882e5c9680ccfdc5c77a7160d5a4b8b46657f93db2468a4726a517fce4d3bc764b66f1995
languageName: node
linkType: hard

"@typescript-eslint/scope-manager@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/scope-manager@npm:8.18.1"
Expand All @@ -14961,39 +14933,13 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/types@npm:8.17.0":
version: 8.17.0
resolution: "@typescript-eslint/types@npm:8.17.0"
checksum: 10/46baf69ab30dd814a390590b94ca64c407ac725cb0143590ddcaf72fa43c940cec180539752ce4af26ac7e0ae2f5f921cfd0d07b088ca680f8a28800d4d33a5f
languageName: node
linkType: hard

"@typescript-eslint/types@npm:8.18.1, @typescript-eslint/types@npm:^8.0.0":
version: 8.18.1
resolution: "@typescript-eslint/types@npm:8.18.1"
checksum: 10/57a6141ba17be929291a644991f3a76f94fce330376f6a079decb20fb53378d636ad6878f8f9b6fcb8244cf1ca8b118f9e8901ae04cf3de2aa9f9ff57791d97a
languageName: node
linkType: hard

"@typescript-eslint/typescript-estree@npm:8.17.0":
version: 8.17.0
resolution: "@typescript-eslint/typescript-estree@npm:8.17.0"
dependencies:
"@typescript-eslint/types": "npm:8.17.0"
"@typescript-eslint/visitor-keys": "npm:8.17.0"
debug: "npm:^4.3.4"
fast-glob: "npm:^3.3.2"
is-glob: "npm:^4.0.3"
minimatch: "npm:^9.0.4"
semver: "npm:^7.6.0"
ts-api-utils: "npm:^1.3.0"
peerDependenciesMeta:
typescript:
optional: true
checksum: 10/8a1f8be767b82e75d41eedda7fdb5135787ceaab480671b6d9891b5f92ee3a13f19ad6f48d5abf5e4f2afc4dd3317c621c1935505ef098f22b67be2f9d01ab7b
languageName: node
linkType: hard

"@typescript-eslint/typescript-estree@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/typescript-estree@npm:8.18.1"
Expand Down Expand Up @@ -15027,16 +14973,6 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/visitor-keys@npm:8.17.0":
version: 8.17.0
resolution: "@typescript-eslint/visitor-keys@npm:8.17.0"
dependencies:
"@typescript-eslint/types": "npm:8.17.0"
eslint-visitor-keys: "npm:^4.2.0"
checksum: 10/e7a3c3b9430ecefb8e720f735f8a94f87901f055c75dc8eec60052dfdf90cc28dd33f03c11cd8244551dc988bf98d1db9bd09ef8fd3c51236912cab3680b9c6b
languageName: node
linkType: hard

"@typescript-eslint/visitor-keys@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/visitor-keys@npm:8.18.1"
Expand Down

0 comments on commit c22bda8

Please sign in to comment.