Skip to content

Commit

Permalink
Integrate babel
Browse files Browse the repository at this point in the history
So that we can maximise compatibility and yet still write modern
JavaScript, use Babel to compile ES2015.
  • Loading branch information
jbilbo committed May 19, 2017
1 parent 4a68260 commit a604ce8
Show file tree
Hide file tree
Showing 8 changed files with 692 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
11 changes: 7 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
"env": {
"es6": true,
"node": true
"node": true,
"jest": true
},
"extends": "eslint:recommended",
"rules": {
Expand All @@ -21,9 +22,11 @@ module.exports = {
"error",
"always"
],
"curly": [
"error",
"all"
"no-console": [
"warn"
]
},
"parserOptions": {
"sourceType": "module"
}
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
lib
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"name": "identifiers-bibcode",
"version": "0.1.0",
"description": "Extract, validate and normalize ADS Bibcodes.",
"keywords": ["ads", "bibcode", "identifiers"],
"keywords": [
"ads",
"bibcode",
"identifiers"
],
"main": "./lib/bibcode.js",
"repository": "https://github.com/altmetric/identifiers-bibcode",
"bugs": "https://github.com/altmetric/identifiers-bibcode/issues",
Expand All @@ -12,12 +16,17 @@
"node": ">= 4"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-jest": "^20.0.3",
"babel-preset-es2015": "^6.24.1",
"eslint": "^3.15.0",
"jest": "^18.1.0"
},
"scripts": {
"pretest": "eslint lib tests",
"test": "jest"
"pretest": "yarn compile && eslint src tests",
"test": "jest",
"compile": "babel src -d lib",
"prepublish": "yarn compile"
},
"jest": {
"testEnvironment": "node"
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion tests/bibcode.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals test, expect */
"use strict";

const bibcode = require("../lib/bibcode");
Expand Down
Loading

0 comments on commit a604ce8

Please sign in to comment.