Skip to content

chore: add support for lint / format #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Language: JavaScript
BasedOnStyle: Google
ColumnLimit: 100
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"postbuild_npm": "cp package.json README.md .npmignore dist/ && npm run rewrite_npm_package",
"postinstall": "typings install",
"rewrite_npm_package": "node --harmony_destructuring tools/rewrite-published-package.js",
"build_bundle": "cp -r src angularfire2 && tsc typings/main.d.ts angularfire2.ts --rootDir . --module system -t es5 --outFile dist/bundles/angularfire2.js --moduleResolution node --emitDecoratorMetadata --experimentalDecorators"
"build_bundle": "cp -r src angularfire2 && tsc typings/main.d.ts angularfire2.ts --rootDir . --module system -t es5 --outFile dist/bundles/angularfire2.js --moduleResolution node --emitDecoratorMetadata --experimentalDecorators",
"lint": "tslint \"src/**/*.ts\"",
"format": "clang-format -style=file -i --glob=src/**/*.ts"
},
"keywords": [
"angular2",
Expand Down Expand Up @@ -65,7 +67,10 @@
"typedoc": "github:jeffbcross/typedoc",
"typescript": "1.8.9",
"typings": "^0.6.2",
"zone.js": "^0.6.6"
"zone.js": "^0.6.6",
"clang-format": "^1.0.35",
"tslint": "^3.6.0",
"codelyzer": "0.0.14"
},
"typings": "dist/angularfire2.d.ts"
}
72 changes: 72 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"rulesDirectory": ["node_modules/codelyzer"],
"rules": {
"max-line-length": [true, 100],
"no-inferrable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"indent": [
true,
"spaces"
],
"eofline": true,
"no-duplicate-variable": true,
"no-eval": true,
"no-arg": true,
"no-internal-module": true,
"no-trailing-whitespace": true,
"no-bitwise": true,
"no-shadowed-variable": true,
"no-unused-expression": true,
"no-unused-variable": true,
"one-line": [
true,
"check-catch",
"check-else",
"check-open-brace",
"check-whitespace"
],
"quotemark": [
true,
"single",
"avoid-escape"
],
"semicolon": [true, "always"],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"curly": true,
"variable-name": [
true,
"ban-keywords",
"check-format",
"allow-trailing-underscore"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"component-selector-name": [true, "kebab-case"],
"component-selector-type": [true, "element"],
"host-parameter-decorator": true,
"input-parameter-decorator": true,
"output-parameter-decorator": true,
"attribute-parameter-decorator": true,
"input-property-directive": true,
"output-property-directive": true
}
}