You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2016/07/01 07:17:57 UTC
[10/51] [abbrv] ignite git commit: IGNITE-3319 Restored gulp eslint.
Fixed eslint warnings.
IGNITE-3319 Restored gulp eslint. Fixed eslint warnings.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/933f7450
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/933f7450
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/933f7450
Branch: refs/heads/ignite-3262
Commit: 933f745066c5923ac2b2c62e36f3a2a40dddeef3
Parents: f900b7e
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Jun 27 17:57:24 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Jun 27 17:57:24 2016 +0700
----------------------------------------------------------------------
.../src/main/js/gulpfile.babel.js/tasks/copy.js | 2 +-
.../main/js/gulpfile.babel.js/tasks/eslint.js | 43 +++++++++++++++++
.../main/js/gulpfile.babel.js/webpack/common.js | 14 +++---
.../webpack/plugins/progress.js | 50 +++++++++++---------
modules/web-console/src/main/js/package.json | 1 +
5 files changed, 80 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/933f7450/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js
index 55c9485..18bd35a 100644
--- a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/copy.js
@@ -22,7 +22,7 @@ import { destDir, rootDir, jsModulePaths, resourcePaths, resourceModulePaths, ig
gulp.task('copy', (cb) => {
const tasks = ['copy:resource', 'copy:ignite_modules:js', 'copy:ignite_modules:resource'];
-
+
return sequence(tasks, cb);
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/933f7450/modules/web-console/src/main/js/gulpfile.babel.js/tasks/eslint.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/tasks/eslint.js b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/eslint.js
new file mode 100644
index 0000000..67d656e
--- /dev/null
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/tasks/eslint.js
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import gulp from 'gulp';
+import eslint from 'gulp-eslint';
+import sequence from 'gulp-sequence';
+
+const paths = [
+ './app/**/*.js',
+ './controllers/**/*.js',
+ './generator/**/*.js',
+ './ignite_modules_temp/**/*.js',
+ './gulpfile.babel.js/**/*.js',
+ './gulpfile.babel.js/*.js'
+];
+
+gulp.task('eslint:node', () =>
+ gulp.src('./serve/**/*.js')
+ .pipe(eslint({envs: ['node']}))
+ .pipe(eslint.format())
+);
+
+gulp.task('eslint:browser', () =>
+ gulp.src(paths)
+ .pipe(eslint({envs: ['browser']}))
+ .pipe(eslint.format())
+);
+
+gulp.task('eslint', (cb) => sequence('eslint:browser', 'eslint:node', cb));
http://git-wip-us.apache.org/repos/asf/ignite/blob/933f7450/modules/web-console/src/main/js/gulpfile.babel.js/webpack/common.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/common.js b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/common.js
index 80f740c..f4a7da8 100644
--- a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/common.js
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/common.js
@@ -84,7 +84,7 @@ export default () => {
loaders: [
`ngtemplate-loader?relativeTo=${rootDir}`,
'html-loader?attrs[]=img:src&attrs[]=img:data-src',
- `jade-html-loader`
+ 'jade-html-loader'
]
},
{
@@ -125,16 +125,16 @@ export default () => {
loaders: ['file-loader?name=assets/images/[name]_[hash].[ext]']
},
{
- test: require.resolve("jquery"),
+ test: require.resolve('jquery'),
loaders: [
- "expose-loader?$",
- "expose-loader?jQuery"
+ 'expose-loader?$',
+ 'expose-loader?jQuery'
]
},
{
- test: require.resolve("nvd3"),
+ test: require.resolve('nvd3'),
loaders: [
- "expose-loader?nv"
+ 'expose-loader?nv'
]
}
]
@@ -157,7 +157,7 @@ export default () => {
_: 'lodash',
nv: 'nvd3'
}),
- new webpack.DefinePlugin({'NODE_ENV': JSON.stringify(NODE_ENV)}),
+ new webpack.DefinePlugin({NODE_ENV: JSON.stringify(NODE_ENV)}),
// new webpack.NoErrorsPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.CommonsChunkPlugin({
http://git-wip-us.apache.org/repos/asf/ignite/blob/933f7450/modules/web-console/src/main/js/gulpfile.babel.js/webpack/plugins/progress.js
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/plugins/progress.js b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/plugins/progress.js
index 5258059..5f753c7 100644
--- a/modules/web-console/src/main/js/gulpfile.babel.js/webpack/plugins/progress.js
+++ b/modules/web-console/src/main/js/gulpfile.babel.js/webpack/plugins/progress.js
@@ -17,22 +17,23 @@
import ProgressPlugin from 'webpack/lib/ProgressPlugin';
-let chars = 0,
- lastState, lastStateTime;
+let chars = 0;
+let lastState = 0;
+let lastStateTime = 0;
const outputStream = process.stdout;
const _goToLineStart = (nextMessage) => {
- let str = "";
- for (; chars > nextMessage.length; chars--) {
- str += "\b \b";
- }
+ let str = '';
+
+ for (; chars > nextMessage.length; chars--)
+ str += '\b \b';
chars = nextMessage.length;
- for (var i = 0; i < chars; i++) {
- str += "\b";
- }
+ for (let i = 0; i < chars; i++)
+ str += '\b';
+
if (str)
outputStream.write(str);
};
@@ -42,28 +43,32 @@ export default new ProgressPlugin((percentage, msg) => {
if (percentage < 1) {
percentage = Math.floor(percentage * 100);
- msg = percentage + "% " + msg;
- if (percentage < 100) {
- msg = " " + msg;
- }
- if (percentage < 10) {
- msg = " " + msg;
- }
+
+ msg = percentage + '% ' + msg;
+
+ if (percentage < 100)
+ msg = ' ' + msg;
+
+ if (percentage < 10)
+ msg = ' ' + msg;
}
- state = state.replace(/^\d+\/\d+\s+/, "");
+ state = state.replace(/^\d+\/\d+\s+/, '');
if (percentage === 0) {
lastState = null;
- lastStateTime = +new Date();
+ lastStateTime = (new Date()).getTime();
}
else if (state !== lastState || percentage === 1) {
- let now = +new Date();
+ const now = (new Date()).getTime();
if (lastState) {
- var stateMsg = (now - lastStateTime) + "ms " + lastState;
+ const stateMsg = (now - lastStateTime) + 'ms ' + lastState;
+
_goToLineStart(stateMsg);
- outputStream.write(stateMsg + "\n");
+
+ outputStream.write(stateMsg + '\n');
+
chars = 0;
}
@@ -72,5 +77,6 @@ export default new ProgressPlugin((percentage, msg) => {
}
_goToLineStart(msg);
+
outputStream.write(msg);
-});
\ No newline at end of file
+});
http://git-wip-us.apache.org/repos/asf/ignite/blob/933f7450/modules/web-console/src/main/js/package.json
----------------------------------------------------------------------
diff --git a/modules/web-console/src/main/js/package.json b/modules/web-console/src/main/js/package.json
index aea4a2c..d3142ba 100644
--- a/modules/web-console/src/main/js/package.json
+++ b/modules/web-console/src/main/js/package.json
@@ -95,6 +95,7 @@
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"gulp": "^3.9.1",
+ "gulp-eslint": "^2.0.0",
"gulp-inject": "^4.0.0",
"gulp-jade": "^1.1.0",
"gulp-rimraf": "^0.2.0",