diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..84cef4f --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,28 @@ +{ + "parserOptions": { + "ecmaVersion": 5 + }, + "extends": "eslint:recommended", + "env": { + "commonjs": true + }, + "rules": { + "strict": [2, "global"], + "block-scoped-var": 2, + "consistent-return": 2, + "eqeqeq": [2, "smart"], + "guard-for-in": 2, + "no-caller": 2, + "no-extend-native": 2, + "no-loop-func": 2, + "no-new": 2, + "no-param-reassign": 2, + "no-return-assign": 2, + "no-unused-expressions": 2, + "no-use-before-define": 2, + "radix": [2, "always"], + "indent": [2, 2], + "quotes": [2, "double"], + "semi": [2, "always"] + } +} diff --git a/.gitignore b/.gitignore index e306283..7050558 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ /.* !/.gitignore -!/.jscsrc -!/.jshintrc +!/.eslintrc.json !/.travis.yml /bower_components/ /node_modules/ diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 2561ce9..0000000 --- a/.jscsrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "preset": "grunt", - "disallowSpacesInFunctionExpression": null, - "requireSpacesInFunctionExpression": { - "beforeOpeningRoundBrace": true, - "beforeOpeningCurlyBrace": true - }, - "disallowSpacesInAnonymousFunctionExpression": null, - "requireSpacesInAnonymousFunctionExpression": { - "beforeOpeningRoundBrace": true, - "beforeOpeningCurlyBrace": true - }, - "disallowSpacesInsideObjectBrackets": null, - "requireSpacesInsideObjectBrackets": "all", - "validateQuoteMarks": "\"", - "requireCurlyBraces": null -} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 81e6de7..0000000 --- a/.jshintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "bitwise": true, - "eqeqeq": true, - "forin": true, - "freeze": true, - "funcscope": true, - "futurehostile": true, - "strict": "global", - "latedef": true, - "noarg": true, - "nocomma": true, - "nonew": true, - "notypeof": true, - "singleGroups": true, - "undef": true, - "unused": true, - "eqnull": true, - "predef": ["exports"] -} diff --git a/.travis.yml b/.travis.yml index a79fb8b..e06d3f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js dist: trusty sudo: required -node_js: 6 +node_js: stable env: - PATH=$HOME/purescript:$PATH install: diff --git a/bower.json b/bower.json index 66db52d..f081396 100644 --- a/bower.json +++ b/bower.json @@ -16,14 +16,14 @@ "package.json" ], "dependencies": { - "purescript-enums": "^2.0.0", - "purescript-functions": "^2.0.0", - "purescript-generics": "^3.0.0", - "purescript-integers": "^2.0.0", + "purescript-enums": "^3.0.0", + "purescript-functions": "^3.0.0", + "purescript-generics": "^4.0.0", + "purescript-integers": "^3.0.0", "purescript-math": "^2.0.0" }, "devDependencies": { - "purescript-assert": "^2.0.0", - "purescript-console": "^2.0.0" + "purescript-assert": "^3.0.0", + "purescript-console": "^3.0.0" } } diff --git a/package.json b/package.json index 44534d6..132cefc 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,13 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "jshint src && jscs src && pulp build --censor-lib --strict", + "build": "eslint src && pulp build -- --censor-lib --strict", "test": "pulp test" }, "devDependencies": { - "jscs": "^2.8.0", - "jshint": "^2.9.1", - "pulp": "^9.0.0", - "purescript-psa": "^0.3.8", - "rimraf": "^2.5.0" + "eslint": "^3.17.1", + "pulp": "^10.0.4", + "purescript-psa": "^0.5.0-rc.1", + "rimraf": "^2.6.1" } } diff --git a/src/Data/DateTime/Instant.js b/src/Data/DateTime/Instant.js index 0653a15..e79b5e2 100644 --- a/src/Data/DateTime/Instant.js +++ b/src/Data/DateTime/Instant.js @@ -7,9 +7,6 @@ exports.fromDateTimeImpl = function (y, mo, d, h, mi, s, ms) { exports.toDateTimeImpl = function (ctor) { return function (instant) { var dt = new Date(instant); - return ctor - (dt.getUTCFullYear())(dt.getUTCMonth() + 1)(dt.getUTCDate()) - (dt.getUTCHours())(dt.getUTCMinutes())(dt.getUTCSeconds()) - (dt.getUTCMilliseconds()); + return ctor (dt.getUTCFullYear())(dt.getUTCMonth() + 1)(dt.getUTCDate())(dt.getUTCHours())(dt.getUTCMinutes())(dt.getUTCSeconds())(dt.getUTCMilliseconds()); }; }; diff --git a/src/Data/Time/Duration.purs b/src/Data/Time/Duration.purs index ea0dcf6..4b9e21b 100644 --- a/src/Data/Time/Duration.purs +++ b/src/Data/Time/Duration.purs @@ -76,7 +76,7 @@ class Duration a where toDuration :: Milliseconds -> a -- | Converts directly between durations of differing types. -convertDuration :: forall a b. (Duration a, Duration b) => a -> b +convertDuration :: forall a b. Duration a => Duration b => a -> b convertDuration = toDuration <<< fromDuration instance durationMilliseconds :: Duration Milliseconds where