Skip to content

Commit

Permalink
initial version, using eslint which are based on AirBNB ES5 rules
Browse files Browse the repository at this point in the history
  • Loading branch information
haysclark committed Sep 21, 2018
0 parents commit 1f48e6b
Show file tree
Hide file tree
Showing 19 changed files with 1,993 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "2"

checks:
method-lines:
enabled: false

plugins:
eslint:
enabled: true
stylelint:
enabled: true
duplication:
enabled: true
config:
languages:
javascript:
mass_threshold: 70

exclude_patterns:
- static/**/*
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/**
build/**
node_modules/**
163 changes: 163 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
/* Based on https://github.com/FreeCodeCamp/freecodecamp/blob/staging/.eslintrc */
module.exports = {
"env": {
"node": true
},
"extends": "eslint:recommended",
"plugins": [
"mocha"
],
"rules": {
/**
* Strict mode
*/
"strict": 0, // http://eslint.org/docs/rules/strict

/**
* Variables
*/
"no-shadow": 2, // http://eslint.org/docs/rules/no-shadow
"no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names
"no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars
"vars": "local",
"args": "after-used"
}],

/**
* Possible errors
*/
"comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle
"no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign
"no-console": 1, // http://eslint.org/docs/rules/no-console
"no-debugger": 1, // http://eslint.org/docs/rules/no-debugger
"no-alert": 1, // http://eslint.org/docs/rules/no-alert
"no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition
"no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys
"no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case
"no-empty": 2, // http://eslint.org/docs/rules/no-empty
"no-empty-character-class": 2, // http://eslint.org/docs/rules/no-empty-character-class
"no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign
"no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi
"no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign
"no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations
"no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp
"no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace
"no-negated-in-lhs": 2, // http://eslint.org/docs/rules/no-negated-in-lhs
"no-new-require": 2, // http://eslint.org/docs/rules/no-new-require
"no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls
"no-path-concat": 2, // http://eslint.org/docs/rules/no-path-concat
"no-regex-spaces": 2, // http://eslint.org/docs/rules/no-regex-spaces
"no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays
"no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable
"use-isnan": 2, // http://eslint.org/docs/rules/use-isnan
"valid-jsdoc": 2, // http://eslint.org/docs/rules/valid-jsdoc
"valid-typeof": 2, // http://eslint.org/docs/rules/valid-typeof

/**
* Best practices
*/
"consistent-return": 2, // http://eslint.org/docs/rules/consistent-return
"curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly
"default-case": 2, // http://eslint.org/docs/rules/default-case
"dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation
"allowKeywords": true
}],
"eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq
"guard-for-in": 2, // http://eslint.org/docs/rules/guard-for-in
"no-caller": 2, // http://eslint.org/docs/rules/no-caller
"no-div-regex": 2, // http://eslint.org/docs/rules/no-div-regex
"no-else-return": 2, // http://eslint.org/docs/rules/no-else-return
"no-labels": 2, // http://eslint.org/docs/rules/no-labels
"no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null
"no-eval": 2, // http://eslint.org/docs/rules/no-eval
"no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native
"no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind
"no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough
"no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal
"no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval
"no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks
"no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func
"no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str
"no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign
"no-new": 2, // http://eslint.org/docs/rules/no-new
"no-new-func": 2, // http://eslint.org/docs/rules/no-new-func
"no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers
"no-octal": 2, // http://eslint.org/docs/rules/no-octal
"no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape
"no-param-reassign": 2, // http://eslint.org/docs/rules/no-param-reassign
"no-process-exit": 2, // http://eslint.org/docs/rules/no-process-exit
"no-proto": 2, // http://eslint.org/docs/rules/no-proto
"no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare
"no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign
"no-script-url": 2, // http://eslint.org/docs/rules/no-script-url
"no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare
"no-sequences": 2, // http://eslint.org/docs/rules/no-sequences
"no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal
"no-undef": 2, // http://eslint.org/docs/rules/no-undef
"no-undef-init": 2, // http://eslint.org/docs/rules/no-undef-init
"no-undefined": 1, // http://eslint.org/docs/rules/no-undefined
"no-with": 2, // http://eslint.org/docs/rules/no-with
"handle-callback-err": 1, // http://eslint.org/docs/rules/handle-callback-err
"radix": 2, // http://eslint.org/docs/rules/radix
"wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife
"yoda": 2, // http://eslint.org/docs/rules/yoda

/**
* Style
*/
"indent": [2, 2], // http://eslint.org/docs/rules/indent
"brace-style": [2, // http://eslint.org/docs/rules/brace-style
"1tbs", {
"allowSingleLine": true
}],
"quotes": [ // http://eslint.org/docs/rules/quotes
2, "single", "avoid-escape"
],
"camelcase": [2, { // http://eslint.org/docs/rules/camelcase
"properties": "never"
}],
"comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing
"before": false,
"after": true
}],
"comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style
"eol-last": 2, // http://eslint.org/docs/rules/eol-last
"func-names": 0, // http://eslint.org/docs/rules/func-names
"key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing
"beforeColon": false,
"afterColon": true
}],
"new-cap": [2, { // http://eslint.org/docs/rules/new-cap
"newIsCap": true
}],
"new-parens": 2, // http://eslint.org/docs/rules/new-parens
"no-array-constructor": 2, // http://eslint.org/docs/rules/no-array-constructor
"no-lonely-if": 1, // http://eslint.org/docs/rules/no-lonely-if
"no-mixed-spaces-and-tabs": 1, // http://eslint.org/docs/rules/no-mixed-spaces-and-tabs
"no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines
"max": 2
}],
"no-nested-ternary": 2, // http://eslint.org/docs/rules/no-nested-ternary
"no-new-object": 2, // http://eslint.org/docs/rules/no-new-object
"no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func
"no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces
"no-extra-parens": [2, "functions"], // http://eslint.org/docs/rules/no-extra-params
"one-var": [2, "never"], // http://eslint.org/docs/rules/one-var
"padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks
"semi": [2, "always"], // http://eslint.org/docs/rules/semi
"semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing
"before": false,
"after": true
}],
"keyword-spacing": 2, // http://eslint.org/docs/rules/keyword-spacing
"space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], // http://eslint.org/docs/rules/space-before-function-paren
"space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops
"space-unary-ops": 2, // http://eslint.org/docs/rules/space-unary-ops
"spaced-comment": [2, "always", {// http://eslint.org/docs/rules/spaced-comment
"exceptions": ["-", "+"],
"markers": ["=", "!"] // space here to support sprockets directives
}],
"mocha/no-exclusive-tests": "error"
}
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
.idea
node_modules/
coverage/
npm-debug.log
9 changes: 9 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.idea
.git
.gitignore
.travis.yml
node_modules
spec
coverage
static
npm-debug.log
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.10.40
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "0.10.40"

after_success:
- ./node_modules/.bin/istanbul cover -x '**/spec/**' ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --require spec/helpers/chai.js spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
23 changes: 23 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*jshint camelcase: false */

'use strict';

module.exports = function (grunt) {

// Load multiple grunt tasks using globbing patterns
// https://github.com/sindresorhus/load-grunt-tasks
require('load-grunt-tasks')(grunt);

// load modular grunt configuration
// https://github.com/firstandthird/load-grunt-config
require('load-grunt-config')(grunt);

// Default task(s).
grunt.registerTask('default', ['jshint', 'mochacli']);

// tests task(s).
grunt.registerTask('test', ['mochacli']);

// code coverage task(s).
grunt.registerTask('coverage', ['mocha_istanbul']);
};
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2018 Hays Clark

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div align="center">
<img src="static/logos/eMotimo.png" alt="eMotimo logo" />
</div>

# eMotimo ST4 API
[![Code Climate](https://codeclimate.com/github/haysclark/node-emotimo-st4/badges/gpa.svg)](https://codeclimate.com/github/haysclark/node-emotimo-st4)
[![Issue Count](https://codeclimate.com/github/haysclark/node-emotimo-st4/badges/issue_count.svg)](https://codeclimate.com/github/haysclark/node-emotimo-st4)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![Build Status](https://travis-ci.org/haysclark/node-emotimo-st4.svg)](https://travis-ci.org/haysclark/node-emotimo-st4)
[![Coverage Status](https://coveralls.io/repos/haysclark/node-emotimo-st4/badge.svg?service=github)](https://coveralls.io/github/haysclark/node-emotimo-st4)
[![npm version](https://badge.fury.io/js/emotimo-st4.svg)](http://badge.fury.io/js/emotimo-st4)
===========

A simple eMotimo ST4 API wrapper.

## Installation

npm install emotimo-sp4

## Tests

npm test
npm run coverage

## Contributing

πŸ‘πŸŽ‰ First off, thanks for taking the time to contribute! πŸŽ‰πŸ‘

The project uses [Conventional Commits](https://conventionalcommits.org/) which are simple and easy to follow. In general, use your best judgment, and feel free to propose changes by creating an issue and then mention the issue in your pull request.

## License

MIT
2 changes: 2 additions & 0 deletions grunt/mocha_istanbul.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
all:
- spec/**/*.js
5 changes: 5 additions & 0 deletions grunt/mochacli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
all:
- spec/**/*.js
spec:
options:
reporter: 'spec'
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';
// var api = require('./api');

module.exports = {

};
Loading

0 comments on commit 1f48e6b

Please sign in to comment.