aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-10-27 18:03:00 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-10-30 09:20:37 +0100
commit47f6f11637a29d74b171e39a3c37df3617d8aab2 (patch)
treeefdacbddefd5e6e872db66f299382ef16589d22f /server/sonar-web
parent0fac638a9b1300554ab9c8985db61e76a3787229 (diff)
downloadsonarqube-47f6f11637a29d74b171e39a3c37df3617d8aab2.tar.gz
sonarqube-47f6f11637a29d74b171e39a3c37df3617d8aab2.zip
remove error overlay, update pre-commit hook (#2772)
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/config/webpack.config.js39
-rw-r--r--server/sonar-web/package.json4
-rw-r--r--server/sonar-web/yarn.lock47
3 files changed, 33 insertions, 57 deletions
diff --git a/server/sonar-web/config/webpack.config.js b/server/sonar-web/config/webpack.config.js
index 6af13c082c9..8cf804efdb2 100644
--- a/server/sonar-web/config/webpack.config.js
+++ b/server/sonar-web/config/webpack.config.js
@@ -1,8 +1,8 @@
+/* eslint-disable import/no-extraneous-dependencies */
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
-const eslintFormatter = require('react-dev-utils/eslintFormatter');
const webpack = require('webpack');
const paths = require('./paths');
@@ -78,18 +78,6 @@ module.exports = ({ production = true, fast = false }) => ({
},
module: {
rules: [
- // First, run the linter.
- // It's important to do this before Babel processes the JS.
- // Run for development or full build
- (!production || !fast) && {
- test: /\.js$/,
- enforce: 'pre',
- include: paths.appSrc,
- use: {
- loader: 'eslint-loader',
- options: { formatter: eslintFormatter }
- }
- },
{
test: /\.js$/,
loader: 'babel-loader',
@@ -101,6 +89,7 @@ module.exports = ({ production = true, fast = false }) => ({
{
loader: 'awesome-typescript-loader',
options: {
+ transpileOnly: true,
useBabel: true,
useCache: true
}
@@ -152,18 +141,18 @@ module.exports = ({ production = true, fast = false }) => ({
inject: false,
template: paths.appHtml,
minify: production &&
- !fast && {
- removeComments: true,
- collapseWhitespace: true,
- removeRedundantAttributes: true,
- useShortDoctype: true,
- removeEmptyAttributes: true,
- removeStyleLinkTypeAttributes: true,
- keepClosingSlash: true,
- minifyJS: true,
- minifyCSS: true,
- minifyURLs: true
- }
+ !fast && {
+ removeComments: true,
+ collapseWhitespace: true,
+ removeRedundantAttributes: true,
+ useShortDoctype: true,
+ removeEmptyAttributes: true,
+ removeStyleLinkTypeAttributes: true,
+ keepClosingSlash: true,
+ minifyJS: true,
+ minifyCSS: true,
+ minifyURLs: true
+ }
}),
new webpack.DefinePlugin({
diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json
index d6cdd87ec69..225af331c02 100644
--- a/server/sonar-web/package.json
+++ b/server/sonar-web/package.json
@@ -80,7 +80,6 @@
"enzyme": "2.9.1",
"enzyme-to-json": "2.0.1",
"eslint": "4.9.0",
- "eslint-loader": "1.9.0",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jsx-a11y": "6.0.2",
"eslint-plugin-promise": "3.6.0",
@@ -91,6 +90,7 @@
"fs-extra": "0.30.0",
"handlebars-loader": "1.6.0",
"html-webpack-plugin": "2.30.1",
+ "husky": "0.14.3",
"jest": "21.2.1",
"lint-staged": "4.3.0",
"postcss-custom-properties": "6.2.0",
@@ -118,7 +118,7 @@
"flow-check": "flow check src/main/js",
"ts-check": "tsc --noEmit",
"validate": "yarn lint && yarn flow-check && yarn ts-check && NODE_ENV=test jest",
- "precommit": "lint-staged"
+ "precommit": "yarn ts-check && lint-staged && yarn flow-check"
},
"engines": {
"node": ">=6"
diff --git a/server/sonar-web/yarn.lock b/server/sonar-web/yarn.lock
index cb2f50f3c13..5356d950448 100644
--- a/server/sonar-web/yarn.lock
+++ b/server/sonar-web/yarn.lock
@@ -2658,16 +2658,6 @@ eslint-import-resolver-node@^0.3.1:
debug "^2.6.8"
resolve "^1.2.0"
-eslint-loader@1.9.0:
- version "1.9.0"
- resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-1.9.0.tgz#7e1be9feddca328d3dcfaef1ad49d5beffe83a13"
- dependencies:
- loader-fs-cache "^1.0.0"
- loader-utils "^1.0.2"
- object-assign "^4.0.1"
- object-hash "^1.1.4"
- rimraf "^2.6.1"
-
eslint-module-utils@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz#abaec824177613b8a95b299639e1b6facf473449"
@@ -3125,14 +3115,6 @@ finalhandler@~1.0.4:
statuses "~1.3.1"
unpipe "~1.0.0"
-find-cache-dir@^0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9"
- dependencies:
- commondir "^1.0.1"
- mkdirp "^0.5.1"
- pkg-dir "^1.0.0"
-
find-cache-dir@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f"
@@ -3657,6 +3639,14 @@ https-browserify@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82"
+husky@0.14.3:
+ version "0.14.3"
+ resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3"
+ dependencies:
+ is-ci "^1.0.10"
+ normalize-path "^1.0.0"
+ strip-indent "^2.0.0"
+
iconv-lite@0.4.13:
version "0.4.13"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2"
@@ -4655,13 +4645,6 @@ load-json-file@^2.0.0:
pify "^2.0.0"
strip-bom "^3.0.0"
-loader-fs-cache@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/loader-fs-cache/-/loader-fs-cache-1.0.1.tgz#56e0bf08bd9708b26a765b68509840c8dec9fdbc"
- dependencies:
- find-cache-dir "^0.1.1"
- mkdirp "0.5.1"
-
loader-runner@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
@@ -5044,7 +5027,7 @@ mixin-deep@^1.1.3:
for-in "^1.0.2"
is-extendable "^0.1.1"
-mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
+mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
dependencies:
@@ -5192,6 +5175,10 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4:
semver "2 || 3 || 4 || 5"
validate-npm-package-license "^3.0.1"
+normalize-path@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379"
+
normalize-path@^2.0.0, normalize-path@^2.0.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
@@ -5274,10 +5261,6 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"
-object-hash@^1.1.4:
- version "1.1.8"
- resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.1.8.tgz#28a659cf987d96a4dabe7860289f3b5326c4a03c"
-
object-is@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6"
@@ -7094,6 +7077,10 @@ strip-indent@^1.0.1:
dependencies:
get-stdin "^4.0.1"
+strip-indent@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68"
+
strip-json-comments@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"