1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Update build process for ES6

* Make npm run build run npm compile (it needs the output)
 * Switch to ESlint so we can actually use ES6 without the linter
   crying.
This commit is contained in:
David Baker
2017-01-11 18:11:47 +00:00
parent 09e4e4709f
commit 9b5cb3a631
4 changed files with 21 additions and 22 deletions

15
.eslintrc.js Normal file
View File

@@ -0,0 +1,15 @@
module.exports = {
parserOptions: {
ecmaVersion: 6,
sourceType: "module",
ecmaFeatures: {
}
},
rules: {
"max-len": ["warn", {
code: 90,
ignoreComments: true,
}],
curly: ["error", "multi-line"],
}
}

11
.jshint
View File

@@ -1,11 +0,0 @@
{
"node": true,
"jasmine": true,
"nonew": true,
"curly": true,
"forin": true,
"freeze": false,
"undef": true,
"unused": "vars"
}

View File

@@ -14,13 +14,8 @@ function fail {
npm test || fail "npm test finished with return code $?"
jshint --reporter=checkstyle -c .jshint src spec > jshint.xml ||
fail "jshint finished with return code $?"
gjslint --unix_mode --disable 0131,0211,0200,0222,0212 \
--max_line_length 90 \
-r src/ -r spec/ > gjslint.log ||
fail "gjslint finished with return code $?"
node_modules/.bin/eslint -f checkstyle src spec > eslint.xml ||
fail "eslint finished with return code $?"
# delete the old tarball, if it exists
rm -f matrix-js-sdk-*.tgz

View File

@@ -7,12 +7,12 @@
"test": "istanbul cover --report cobertura --config .istanbul.yml -i \"lib/**/*.js\" jasmine-node -- spec --verbose --junitreport --captureExceptions",
"check": "jasmine-node spec --verbose --junitreport --captureExceptions",
"gendoc": "jsdoc -r lib -P package.json -R README.md -d .jsdoc",
"compile": "babel -s -d lib src",
"compile": "npm run lint && babel -s -d lib src",
"start": "babel -s -w -d lib src",
"build": "jshint -c .jshint lib/ && rimraf dist && mkdir dist && browserify --exclude olm browser-index.js -o dist/browser-matrix.js --ignore-missing && uglifyjs -c -m -o dist/browser-matrix.min.js dist/browser-matrix.js",
"build": "npm run compile && rimraf dist && mkdir dist && browserify --exclude olm browser-index.js -o dist/browser-matrix.js --ignore-missing && uglifyjs -c -m -o dist/browser-matrix.min.js dist/browser-matrix.js",
"dist": "npm run build",
"watch": "watchify --exclude olm browser-index.js -o dist/browser-matrix-dev.js -v",
"lint": "jshint -c .jshint src spec && gjslint --unix_mode --disable 0131,0211,0200,0222,0212 --max_line_length 90 -r spec/ -r src/",
"lint": "eslint src",
"prepublish": "npm run compile && git rev-parse HEAD > git-revision.txt"
},
"repository": {
@@ -53,10 +53,10 @@
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-preset-es2015": "^6.18.0",
"eslint": "^3.13.1",
"istanbul": "^0.3.13",
"jasmine-node": "^1.14.5",
"jsdoc": "^3.4.0",
"jshint": "^2.8.0",
"rimraf": "^2.5.4",
"uglifyjs": "^2.4.10",
"watchify": "^3.2.1"