Skip to content

Commit

Permalink
chore(project-wide): add commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Burak Tasci committed Dec 24, 2018
1 parent 5d68613 commit ec046c5
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 16 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 140

[*.md]
trim_trailing_whitespace = false
max_line_length = off

[*.html]
indent_size = 4
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{json,css,scss,md,js}": ["prettier --write", "git add"],
"*.(ts)": ["prettier-tslint fix", "git add"]
}
50 changes: 50 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# angular gitignore
# see https://github.com/prettier/prettier/issues/2294

## compiled output
/.awcache
/dist
/docs
/tmp
/out-tsc

## dependencies
/bower_components
/node_modules

## IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
test-report.xml
/typings

# System Files
.DS_Store
Thumbs.db

# auto-generated files
/angular.json
/.angular-cli.json
/package-lock.json
/yarn.lock
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 140,
"singleQuote": true,
"endOfLine": "crlf"
}
23 changes: 23 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [
2,
'always',
[
'project-wide',
'core',
'fs-storage',
'platform-browser',
'platform-server',
'package',
'npm',
'webpack',
'circle',
'lint',
'packaging',
'changelog'
]
]
}
};
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
"typescript": "~3.1.6",
"zone.js": "~0.8.26"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"jest": {
"preset": "jest-preset-angular",
"setupTestFrameworkScriptFile": "./tools/test/jest.setup.ts",
Expand Down
12 changes: 4 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"importHelpers": true,
"baseUrl": "",
"paths": {
"@ngx-cache/*": ["./packages/@ngx-cache/*"]
},
"lib": [
"es2017",
"dom"
]
"lib": ["es2017", "dom"]
},
"include": [
"tools/**/*.ts",
"packages/**/*.ts"
]
"include": ["tools/**/*.ts", "packages/**/*.ts"]
}
7 changes: 7 additions & 0 deletions tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2015",
"strictNullChecks": true
}
}
28 changes: 20 additions & 8 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"extends": [
"angular-tslint-rules"
],
"rulesDirectory": ["node_modules/codelyzer"],
"extends": ["angular-tslint-rules", "tslint-config-prettier"],
"rules": {
"no-dynamic-delete": false,
"comment-format": [true, "check-lowercase", {"ignore-words": ["TODO", "NOTE"]}]
"ordered-imports": [
true,
{
"import-sources-order": "case-insensitive",
"named-imports-order": "case-insensitive",
"grouped-imports": true
}
],
"strict-boolean-expressions": [
true,
"allow-undefined-union",
"allow-null-union",
"allow-string",
"allow-enum",
"allow-number",
"allow-mix"
],
"no-dynamic-delete": false
}
}

0 comments on commit ec046c5

Please sign in to comment.