diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..39963d3 --- /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, { "SwitchCase": 1 }], + "quotes": [2, "double"], + "semi": [2, "always"] + } +} diff --git a/.gitignore b/.gitignore index f5b26f9..7050558 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ -/bower_components -/node_modules -/.psci_modules -/output -/.psci -/npm-debug.log* -/.pulp-cache -/.pursuit.json +/.* +!/.gitignore +!/.eslintrc.json +!/.travis.yml +/bower_components/ +/node_modules/ +/output/ diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index e512c78..0000000 --- a/.jscsrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "preset": "grunt", - "disallowSpacesInFunctionExpression": null, - "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 f391159..0000000 --- a/.jshintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "bitwise": true, - "eqeqeq": true, - "forin": true, - "freeze": true, - "funcscope": true, - "futurehostile": true, - "globalstrict": true, - "latedef": true, - "maxparams": 1, - "noarg": true, - "nocomma": true, - "nonew": true, - "notypeof": true, - "singleGroups": true, - "undef": true, - "unused": true, - "eqnull": true -} diff --git a/.travis.yml b/.travis.yml index 389dddc..a912a93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js -sudo: false -node_js: - - 5 +dist: trusty +sudo: required +node_js: stable env: - PATH=$HOME/purescript:$PATH install: @@ -12,13 +12,7 @@ install: - npm install -g bower - npm install script: - - npm run build - - npm run test -after_success: -- >- - test $TRAVIS_TAG && - psc-publish > .pursuit.json && - curl -X POST http://pursuit.purescript.org/packages \ - -d @.pursuit.json \ - -H 'Accept: application/json' \ - -H "Authorization: token ${GITHUB_TOKEN}" + - bower install --production + - npm run -s build + - bower install + - npm -s test diff --git a/bower.json b/bower.json index 49eec1c..f978f2e 100644 --- a/bower.json +++ b/bower.json @@ -2,9 +2,6 @@ "name": "purescript-unique", "homepage": "https://github.com/mechairoi/purescript-unique", "description": "Data.Unique for PureScript", - "keywords": [ - "purescript" - ], "license": "MIT", "repository": { "type": "git", @@ -20,11 +17,11 @@ "package.json" ], "dependencies": { - "purescript-prelude": "^2.1.0", - "purescript-eff": "^2.0.0" + "purescript-prelude": "^3.0.0", + "purescript-eff": "^3.1.0" }, "devDependencies": { - "purescript-console": "^2.0.0", - "purescript-assert": "^2.0.0" + "purescript-console": "^3.0.0", + "purescript-assert": "^3.0.0" } } diff --git a/package.json b/package.json index 770a44b..690d264 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,14 @@ { - "name": "purescript-unique", - "description": "Data.Unique for PureScript", "private": true, - "license": "MIT", "devDependencies": { - "jscs": "^2.9.0", - "jshint": "^2.9.1", - "pulp": "^9.0.1", - "rimraf": "^2.5.1" + "eslint": "^3.19.0", + "pulp": "^11.0.0", + "purescript-psa": "^0.5.1", + "rimraf": "^2.6.1" }, "scripts": { - "postinstall": "bower install", - "build": "jshint src && jscs src && pulp build && rimraf docs && pulp docs", - "docs": "pulp docs", + "clean": "rimraf output && rimraf .pulp-cache", + "build": "eslint src && pulp build -- --censor-lib --strict", "test": "pulp test" } } diff --git a/src/Data/Unique.purs b/src/Data/Unique.purs index 51843af..75cb1b5 100644 --- a/src/Data/Unique.purs +++ b/src/Data/Unique.purs @@ -4,10 +4,10 @@ module Data.Unique , UNIQ() ) where -import Control.Monad.Eff (Eff) +import Control.Monad.Eff (Eff, kind Effect) import Prelude (class Ord, class Eq, class Show, compare, (==)) -foreign import data UNIQ :: ! +foreign import data UNIQ :: Effect newtype Unique = Unique String diff --git a/test/Main.purs b/test/Main.purs index 366f642..510a577 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -1,6 +1,6 @@ module Test.Main where -import Prelude ((==), ($), (/=), bind, Unit) +import Prelude ((==), ($), (/=), discard, bind, Unit) import Data.Unique (newUnique, UNIQ) import Test.Assert (assert, ASSERT) import Control.Monad.Eff (Eff)