mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 06:22:53 +00:00
feat: copy .editorconfig during installation
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
@@ -7,11 +6,10 @@ root = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# We recommend you to keep these unchanged
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
!package.json
|
||||
!package-lock.json
|
||||
!README.md
|
||||
!scripts
|
||||
!tsconfig.json
|
||||
!tslint.json
|
||||
|
||||
@@ -6,6 +6,10 @@ A collection of configuration base files for StApps projects.
|
||||
npm install --save-dev @openstapps/configuration
|
||||
```
|
||||
|
||||
## `.editorconfig`
|
||||
|
||||
This file is automatically copied to your project's root directory upon installation of this package. It tells your editor/IDE about basic settings for indentation and formatting.
|
||||
|
||||
## `tsconfig.json`
|
||||
|
||||
Create a `tsconfig.json` with the following content:
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"description": "A collection of configuration base files for StApps projects.",
|
||||
"scripts": {
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
||||
"install": "./scripts/postinstall.sh",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
9
scripts/postinstall.sh
Executable file
9
scripts/postinstall.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
if [[ ! -d "$INIT_CWD/node_modules/@openstapps/configuration/" ]]; then
|
||||
exit;
|
||||
fi;
|
||||
|
||||
echo "Copying .editorconfig from @openstapps/configuration to this project."
|
||||
|
||||
cp "$INIT_CWD/node_modules/@openstapps/configuration/.editorconfig" "$INIT_CWD/.editorconfig"
|
||||
Reference in New Issue
Block a user