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 775d86a commit 316597c
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 14 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
@@ -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
@@ -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
@@ -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
@@ -0,0 +1,5 @@
{
"printWidth": 140,
"singleQuote": true,
"endOfLine": "crlf"
}
10 changes: 10 additions & 0 deletions commitlint.config.js
@@ -0,0 +1,10 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [
2,
'always',
['project-wide', 'core', 'http-loader', 'merge-loader', 'package', 'npm', 'webpack', 'circle', 'lint', 'packaging', 'changelog']
]
}
};
6 changes: 6 additions & 0 deletions package.json
Expand Up @@ -68,6 +68,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
Expand Up @@ -5,18 +5,14 @@
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"importHelpers": true,
"baseUrl": "",
"paths": {
"@ngx-config/*": ["./packages/@ngx-config/*"]
},
"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
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es2015",
"strictNullChecks": true
}
}
17 changes: 11 additions & 6 deletions tslint.json
@@ -1,11 +1,16 @@
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"extends": [
"angular-tslint-rules"
],
"rulesDirectory": ["node_modules/codelyzer"],
"extends": ["angular-tslint-rules", "tslint-config-prettier"],
"rules": {
"ordered-imports": [
true,
{
"import-sources-order": "case-insensitive",
"named-imports-order": "case-insensitive",
"grouped-imports": true
}
],
"no-null-keyword": false,
"no-forward-ref": false
}
}

0 comments on commit 316597c

Please sign in to comment.