From af0acf07fe482ca2e9795a66adfd568a6051b1fc Mon Sep 17 00:00:00 2001 From: Patrick Heneise Date: Sat, 7 Nov 2015 01:00:05 +0100 Subject: [PATCH] code style --- .editorconfig | 17 +++++++++++++++++ .jsbeautifyrc | 12 ++++++++++++ .jscsrc | 20 ++++++++++++++++++++ .jshintrc | 12 ++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 .editorconfig create mode 100644 .jsbeautifyrc create mode 100644 .jscsrc create mode 100644 .jshintrc diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..50a3fdd --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[package.json] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.jsbeautifyrc b/.jsbeautifyrc new file mode 100644 index 0000000..0fa4be2 --- /dev/null +++ b/.jsbeautifyrc @@ -0,0 +1,12 @@ +{ + "indent_size": 2, + "indent_char": " ", + "other": " ", + "indent_level": 0, + "indent_with_tabs": false, + "preserve_newlines": true, + "max_preserve_newlines": 2, + "jslint_happy": false, + "indent_handlebars": true, + "js_space_before_conditional": true +} diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 0000000..a65612f --- /dev/null +++ b/.jscsrc @@ -0,0 +1,20 @@ +{ + "preset": "google", + "fileExtensions": [".js", "jscs"], + + "requireParenthesesAroundIIFE": true, + "maximumLineLength": 120, + "validateLineBreaks": "LF", + "validateIndentation": 2, + "disallowTrailingComma": true, + "requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties", + + "disallowSpacesInsideObjectBrackets": null, + "disallowImplicitTypeConversion": ["string"], + + "safeContextKeyword": "ctx", + + "excludeFiles": [ + "tests/data/**" + ] +} diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..b2dae7b --- /dev/null +++ b/.jshintrc @@ -0,0 +1,12 @@ +{ + "node": true, + "bitwise": true, + "undef": true, + "eqeqeq": true, + "noarg": true, + "mocha": true, + "unused": true, + "indent": 2, + "smarttabs": true, + "esnext": true +}