feat: copy .editorconfig during installation

This commit is contained in:
Karl-Philipp Wulfert
2018-11-30 16:47:57 +01:00
parent 7cc274c3d5
commit f228af24f9
5 changed files with 16 additions and 3 deletions

View File

@@ -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

View File

@@ -7,5 +7,6 @@
!package.json
!package-lock.json
!README.md
!scripts
!tsconfig.json
!tslint.json

View File

@@ -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:

View File

@@ -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
View 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"