From 7f76c79319bf0817222fc88011fd870d97648963 Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Tue, 7 Feb 2017 19:46:45 -0200 Subject: [#922] Adds eslint for react and es6 files --- web-ui/package.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'web-ui/package.json') diff --git a/web-ui/package.json b/web-ui/package.json index dba34e97..ab5d1b24 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -16,6 +16,11 @@ "css-loader": "^0.26.1", "dompurify": "^0.8.4", "enzyme": "^2.7.1", + "eslint": "^3.15.0", + "eslint-config-airbnb": "^14.1.0", + "eslint-plugin-import": "^2.2.0", + "eslint-plugin-jsx-a11y": "^4.0.0", + "eslint-plugin-react": "^6.9.0", "expect": "^1.20.2", "file-loader": "^0.10.0", "font-awesome": "^4.7.0", @@ -64,7 +69,7 @@ "webpack": "^1.14.0" }, "scripts": { - "test": "npm run jshint --silent && npm run build-statics --silent && npm run mocha-test && npm run karma-test", + "test": "npm run lint --silent && npm run build-statics --silent && npm run mocha-test && npm run karma-test", "mocha-test": "mocha-webpack --webpack-config webpack.test.config.js \"test/unit/**/*.spec.js\"", "mocha-watch": "mocha-webpack --watch --webpack-config webpack.test.config.js \"test/unit/**/*.spec.js\"", "karma-test": "karma start --single-run $GRUNT_OPTS", @@ -80,7 +85,9 @@ "build-prod": "npm run build-statics && webpack -p --config ./webpack.production.config.js", "build-js": "webpack --colors --progress", "build-js-watch": "webpack --colors --progress --watch", + "lint": "npm run jshint && npm run eslint", "jshint": "jshint --config=.jshintrc app test", + "eslint": "eslint src test/unit", "clean": "rm -rf dist/ app/js/generated/hbs/* app/css/*", "package": "PIXELATED_BUILD='package' npm run build-prod && npm run imagemin", "imagemin": "node config/imagemin.js", -- cgit v1.2.3 From 16190197f72ea242ae239dc2741e2887c7008dfa Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Wed, 8 Feb 2017 10:55:10 -0200 Subject: [#922] Add test coverage for new js files Since this added a lot of scripts to our npm scripts, this commit also organizes the package.json. with @tayanefernandes --- web-ui/package.json | 53 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 20 deletions(-) (limited to 'web-ui/package.json') diff --git a/web-ui/package.json b/web-ui/package.json index ab5d1b24..c9229270 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -9,6 +9,7 @@ "babel-cli": "^6.22.2", "babel-core": "^6.21.0", "babel-loader": "^6.2.10", + "babel-plugin-istanbul": "^3.1.2", "babel-preset-es2015": "^6.18.0", "babel-preset-react": "^6.22.0", "bower": "1.7.9", @@ -53,6 +54,7 @@ "mocha-webpack": "^0.7.0", "modernizr": "^3.3.1", "node-sass": "^4.5.0", + "nyc": "^10.1.2", "quoted-printable": "^1.0.1", "react": "^15.4.2", "react-a11y": "^0.3.3", @@ -69,28 +71,39 @@ "webpack": "^1.14.0" }, "scripts": { - "test": "npm run lint --silent && npm run build-statics --silent && npm run mocha-test && npm run karma-test", - "mocha-test": "mocha-webpack --webpack-config webpack.test.config.js \"test/unit/**/*.spec.js\"", - "mocha-watch": "mocha-webpack --watch --webpack-config webpack.test.config.js \"test/unit/**/*.spec.js\"", - "karma-test": "karma start --single-run $GRUNT_OPTS", - "debug": "npm run build && karma start --browsers Chrome $GRUNT_OPTS", - "watch": "npm run compass-watch & npm run handlebars-watch & npm run build-js-watch", - "watch-test": "karma start", - "handlebars": "mkdir -p app/js/generated/hbs/ && handlebars app/templates/**/*.hbs > app/js/generated/hbs/templates.js --namespace=window.Pixelated --root .", - "handlebars-watch": "watch 'npm run handlebars' app/templates", - "compass": "compass compile", - "compass-watch": "compass watch", - "build": "npm run build-statics && npm run build-js", - "build-statics": "npm run clean && npm run handlebars && npm run add_git_version && npm run compass", - "build-prod": "npm run build-statics && webpack -p --config ./webpack.production.config.js", - "build-js": "webpack --colors --progress", - "build-js-watch": "webpack --colors --progress --watch", - "lint": "npm run jshint && npm run eslint", - "jshint": "jshint --config=.jshintrc app test", - "eslint": "eslint src test/unit", + "test": "npm run lint --silent && npm run build:statics --silent && npm run test:unit", + "test:unit": "npm run test:coverage && npm run test:karma", + "test:coverage": "NODE_ENV=test nyc --check-coverage npm run test:mocha", + "test:mocha": "mocha-webpack --webpack-config webpack.test.config.js \"test/unit/**/*.spec.js\"", + "test:karma": "karma start --single-run $GRUNT_OPTS", + "test:watch:mocha": "npm run test:mocha -- --watch", + "test:watch:karma": "karma start", + + "lint": "npm run lint:jshint && npm run lint:eslint", + "lint:jshint": "jshint --config=.jshintrc app test", + "lint:eslint": "eslint src test/unit", + + "build": "npm run build:statics && npm run build:js", + "build:debug": "npm run build && karma start --browsers Chrome $GRUNT_OPTS", + "build:statics": "npm run clean && npm run build:handlebars && npm run add_git_version && npm run build:compass", + "build:prod": "npm run build:statics && webpack -p --config ./webpack.production.config.js", + "build:js": "webpack --colors --progress", + "build:compass": "compass compile", + "build:handlebars": "mkdir -p app/js/generated/hbs/ && handlebars app/templates/**/*.hbs > app/js/generated/hbs/templates.js --namespace=window.Pixelated --root .", + + "watch": "npm run watch:compass & npm run watch:handlebars & npm run watch:js", + "watch:handlebars": "watch 'npm run build:handlebars' app/templates", + "watch:compass": "compass watch", + "watch:js": "webpack --colors --progress --watch", + "clean": "rm -rf dist/ app/js/generated/hbs/* app/css/*", - "package": "PIXELATED_BUILD='package' npm run build-prod && npm run imagemin", "imagemin": "node config/imagemin.js", + "package": "PIXELATED_BUILD='package' npm run build:prod && npm run imagemin", "add_git_version": "/bin/bash config/add_git_version.sh" + }, + "nyc": { + "include": [ + "src/**/*.js" + ] } } -- cgit v1.2.3 From ea852b12e33b0e50ba7986c33ad68be5e38305ba Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Wed, 8 Feb 2017 13:49:54 -0200 Subject: [#922] Add css autoprefixer for compatibility with browsers with @tayanefernandes --- web-ui/package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'web-ui/package.json') diff --git a/web-ui/package.json b/web-ui/package.json index c9229270..4f7c1bc5 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -55,6 +55,7 @@ "modernizr": "^3.3.1", "node-sass": "^4.5.0", "nyc": "^10.1.2", + "postcss-loader": "^1.2.2", "quoted-printable": "^1.0.1", "react": "^15.4.2", "react-a11y": "^0.3.3", @@ -78,11 +79,9 @@ "test:karma": "karma start --single-run $GRUNT_OPTS", "test:watch:mocha": "npm run test:mocha -- --watch", "test:watch:karma": "karma start", - "lint": "npm run lint:jshint && npm run lint:eslint", "lint:jshint": "jshint --config=.jshintrc app test", "lint:eslint": "eslint src test/unit", - "build": "npm run build:statics && npm run build:js", "build:debug": "npm run build && karma start --browsers Chrome $GRUNT_OPTS", "build:statics": "npm run clean && npm run build:handlebars && npm run add_git_version && npm run build:compass", @@ -90,12 +89,10 @@ "build:js": "webpack --colors --progress", "build:compass": "compass compile", "build:handlebars": "mkdir -p app/js/generated/hbs/ && handlebars app/templates/**/*.hbs > app/js/generated/hbs/templates.js --namespace=window.Pixelated --root .", - "watch": "npm run watch:compass & npm run watch:handlebars & npm run watch:js", "watch:handlebars": "watch 'npm run build:handlebars' app/templates", "watch:compass": "compass watch", "watch:js": "webpack --colors --progress --watch", - "clean": "rm -rf dist/ app/js/generated/hbs/* app/css/*", "imagemin": "node config/imagemin.js", "package": "PIXELATED_BUILD='package' npm run build:prod && npm run imagemin", -- cgit v1.2.3