Skip to content

Commit

Permalink
chore: update code management facilities
Browse files Browse the repository at this point in the history
1. add eslint support
2. add some restrictions on git commit
3. add conventional-changelog for future auto changelog generation
4. update ignores
5. add editor config
  • Loading branch information
e-cloud committed Jul 14, 2016
1 parent 4e0a718 commit c793778
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# http://editorconfig.org
root = true

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

[*.js]
quote_type = single
curly_bracket_next_line = true
indent_brace_style = Allman
spaces_around_operators = true
spaces_around_brackets = inside
continuation_indent_size = 2

[*.html]
# indent_size = 4

[*{.yml,.yaml,.json}]
indent_style = space
indent_size = 2

[.eslintrc]
indent_style = space
indent_size = 2
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "airbnb-base",
"rules": {
"comma-dangle": 1,
"indent": 2,
"object-shorthand": 0,
"func-names": 0,
"max-len": [1, 120, 2],
"no-use-before-define": 1,
"no-param-reassign": [2, { "props": false }]
}
}
21 changes: 21 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Automatically normalize line endings for all text-based files
# http://git-scm.com/docs/gitattributes#_end_of_line_conversion
* text=auto

# For the following file types, normalize line endings to LF on
# checkin and prevent conversion to CRLF when they are checked out
# (this is required in order to prevent newline related issues like,
# for example, after the build script is run)
.* text eol=lf
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.md text eol=lf
*.sh text eol=lf
*.txt text eol=lf
*.xml text eol=lf

# Exclude the `.htaccess` file from GitHub's language statistics
# https://github.com/github/linguist#using-gitattributes
dist/.htaccess linguist-vendored
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# Logs
logs
*.log*
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

build
node_modules
.bob/
test/streams/test-*
.idea
.vscode
.DS_Store
14 changes: 14 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Created by .ignore support plugin
**/.*
node_modules
bower_components
test
tests
support
benchmarks
examples
sample
lib-cov
coverage.html
Makefile
coverage
36 changes: 34 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"node": ">=0.8"
},
"scripts": {
"pretest": "jshint lib/ test/",
"pretest": "echo 'no lint yet'",
"test": "vows"
},
"directories": {
Expand All @@ -34,11 +34,43 @@
"semver": "~4.3.3"
},
"devDependencies": {
"jshint": "^2.9.2",
"conventional-changelog": "^1.1.0",
"eslint": "^3.0.0",
"eslint-config-airbnb-base": "^4.0.0",
"eslint-plugin-import": "^1.5.0",
"ghooks": "^1.2.1",
"sandboxed-module": "0.1.3",
"validate-commit-msg": "^2.6.1",
"vows": "0.7.0"
},
"browser": {
"os": false
},
"config": {
"validate-commit-msg": {
"types": [
"feat",
"fix",
"docs",
"style",
"refactor",
"example",
"perf",
"test",
"chore",
"revert"
],
"warnOnFail": false,
"maxSubjectLength": 72,
"subjectPattern": ".+",
"subjectPatternErrorMsg": "subject does not match subject pattern!",
"helpMessage": "\n# allowed type: feat, fix, docs, style, refactor, example, perf, test, chore, revert\n# subject no more than 50 chars\n# a body line no more than 72 chars"
},
"ghooks": {
"//": {
"pre-commit": "check code style"
},
"commit-msg": "validate-commit-msg"
}
}
}

0 comments on commit c793778

Please sign in to comment.