chore: make use of ESLint (#540)

JSCS has merged with ESLint. This is the perfect excuse to move to
ESLint and unify both JSHint and JSCS hints under ESLint.

This PR also deprecates `gulp lint` in favour of `npm run lint`.

See: https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2#.zbuwvxa5y
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-06-30 20:09:44 +05:30 committed by GitHub
parent 09424942a0
commit ea1df5cc11
17 changed files with 506 additions and 478 deletions

469
.eslintrc.yml Normal file
View File

@ -0,0 +1,469 @@
env:
browser: true
commonjs: true
es6: true
node: true
mocha: true
extends: 'eslint:recommended'
rules:
# Possible Errors
comma-dangle:
- error
- never
no-cond-assign:
- error
no-console:
- off
no-constant-condition:
- error
no-control-regex:
- error
no-debugger:
- error
no-dupe-args:
- error
no-dupe-keys:
- error
no-duplicate-case:
- error
no-empty:
- error
no-empty-character-class:
- error
no-ex-assign:
- error
no-extra-boolean-cast:
- error
no-extra-parens:
- error
no-extra-semi:
- error
no-func-assign:
- error
no-inner-declarations:
- error
- both
no-invalid-regexp:
- error
no-irregular-whitespace:
- error
no-negated-in-lhs:
- error
no-obj-calls:
- error
no-prototype-builtins:
- error
no-regex-spaces:
- error
no-sparse-arrays:
- error
no-unexpected-multiline:
- error
no-unreachable:
- error
no-unsafe-finally:
- error
use-isnan:
- error
valid-jsdoc:
- error
- requireReturn: false
requireReturnDescription: false
valid-typeof:
- error
# Best Practices
accessor-pairs:
- error
array-callback-return:
- error
block-scoped-var:
- error
complexity:
- off
curly:
- error
default-case:
- error
dot-location:
- error
- property
dot-notation:
- error
eqeqeq:
- error
guard-for-in:
- error
no-alert:
- error
no-caller:
- error
no-case-declarations:
- error
no-div-regex:
- error
no-else-return:
- error
no-empty-function:
- error
no-empty-pattern:
- error
no-eq-null:
- error
no-eval:
- error
no-extend-native:
- error
no-extra-bind:
- error
no-extra-label:
- error
no-fallthrough:
- error
no-floating-decimal:
- error
no-implicit-coercion:
- error
no-implicit-globals:
- error
no-implied-eval:
- error
no-iterator:
- error
no-labels:
- error
no-lone-blocks:
- error
no-loop-func:
- error
no-multi-spaces:
- error
no-multi-str:
- error
no-native-reassign:
- error
no-new:
- error
no-new-func:
- error
no-new-wrappers:
- error
no-octal:
- error
no-octal-escape:
- error
no-proto:
- error
no-redeclare:
- error
no-return-assign:
- error
no-script-url:
- error
no-self-assign:
- error
no-self-compare:
- error
no-sequences:
- error
no-throw-literal:
- error
no-unmodified-loop-condition:
- error
no-unused-labels:
- error
no-useless-call:
- error
no-useless-concat:
- error
no-useless-escape:
- error
no-void:
- error
no-warning-comments:
- off
no-with:
- error
radix:
- error
vars-on-top:
- off
wrap-iife:
- error
- outside
yoda:
- error
# Strict mode
strict:
- error
- global
# Variables
no-catch-shadow:
- error
no-delete-var:
- error
no-label-var:
- error
no-shadow:
- error
no-shadow-restricted-names:
- error
no-undef:
- error
no-undef-init:
- error
no-unused-vars:
- error
no-use-before-define:
- error
# NodeJS and CommonJS
callback-return:
- error
global-require:
- off
handle-callback-err:
- error
no-mixed-requires:
- error
no-new-require:
- error
no-path-concat:
- error
no-process-env:
- off
no-process-exit:
- off
no-sync:
- off
# Stylistic Issues
array-bracket-spacing:
- error
- always
block-spacing:
- error
brace-style:
- error
- 1tbs
camelcase:
- error
comma-spacing:
- error
- before: false
after: true
comma-style:
- error
- last
computed-property-spacing:
- error
- never
consistent-this:
- error
- self
eol-last:
- error
func-names:
- error
- never
func-style:
- error
- expression
id-blacklist:
- error
indent:
- error
- 2
- SwitchCase: 1
key-spacing:
- error
- beforeColon: false
afterColon: true
mode: strict
keyword-spacing:
- error
- before: true
after: true
linebreak-style:
- error
- unix
lines-around-comment:
- error
- beforeBlockComment: true
afterBlockComment: false
beforeLineComment: true
afterLineComment: false
allowBlockStart: true
allowBlockEnd: false
allowObjectStart: true
allowObjectEnd: false
allowArrayStart: true
allowArrayEnd: false
max-len:
- error
- code: 130
comments: 150
ignoreComments: false
ignoreTrailingComments: false
ignoreUrls: true
max-statements-per-line:
- error
- max: 1
new-cap:
- error
new-parens:
- error
no-array-constructor:
- error
no-bitwise:
- error
no-continue:
- error
no-inline-comments:
- error
no-mixed-operators:
- error
no-mixed-spaces-and-tabs:
- error
no-multiple-empty-lines:
- error
- max: 1
maxEOF: 1
maxBOF: 0
no-negated-condition:
- error
no-nested-ternary:
- error
no-new-object:
- error
no-plusplus:
- error
no-spaced-func:
- error
no-trailing-spaces:
- error
no-underscore-dangle:
- error
- allowAfterThis: false
no-unneeded-ternary:
- error
no-whitespace-before-property:
- error
object-curly-newline:
- error
- minProperties: 1
object-curly-spacing:
- error
- always
object-property-newline:
- error
one-var:
- error
- never
operator-assignment:
- error
- always
operator-linebreak:
- error
- before
quote-props:
- error
- as-needed
quotes:
- error
- single
require-jsdoc:
- error
- require:
FunctionDeclaration: true
ClassDeclaration: true
MethodDefinition: true
semi:
- error
- always
semi-spacing:
- error
- before: false
after: true
space-before-blocks:
- error
space-before-function-paren:
- error
- never
space-in-parens:
- error
- never
space-infix-ops:
- error
spaced-comment:
- error
- always
unicode-bom:
- error
# ECMAScript 6
arrow-body-style:
- error
- always
arrow-parens:
- error
- always
arrow-spacing:
- error
- before: true
after: true
constructor-super:
- error
generator-star-spacing:
- error
- before: true
after: false
no-class-assign:
- error
no-confusing-arrow:
- error
no-const-assign:
- error
no-dupe-class-members:
- error
no-duplicate-imports:
- error
no-new-symbol:
- error
no-this-before-super:
- error
no-useless-computed-key:
- error
no-useless-constructor:
- error
no-useless-rename:
- error
no-var:
- error
prefer-const:
- error
prefer-reflect:
- error
prefer-spread:
- error
require-yield:
- error
rest-spread-spacing:
- error
template-curly-spacing:
- error
- never
yield-star-spacing:
- error
- before: true
after: false

306
.jscsrc
View File

@ -1,306 +0,0 @@
{
"jsDoc": {
"checkAnnotations": {
"preset": "jsdoc3",
"extra": {
"fulfil": true
}
},
"checkParamExistence": true,
"checkParamNames": true,
"requireParamTypes": true,
"checkReturnTypes": true,
"checkRedundantReturns": true,
"requireReturnTypes": true,
"checkTypes": "capitalizedNativeCase",
"checkRedundantAccess": true,
"requireHyphenBeforeDescription": true,
"requireNewlineAfterDescription": true,
"requireDescriptionCompleteSentence": true,
"requireParamDescription": true,
"checkRedundantParams": true
},
"disallowAnonymousFunctions": false,
"disallowShorthandArrowFunctions": true,
"disallowCapitalizedComments": false,
"disallowCommaBeforeLineBreak": false,
"disallowCurlyBraces": false,
"disallowDanglingUnderscores": false,
"disallowEmptyBlocks": true,
"disallowFunctionDeclarations": true,
"disallowIdenticalDestructuringNames": true,
"disallowImplicitTypeConversion": [
"numeric",
"boolean",
"binary",
"string"
],
"disallowKeywordsOnNewLine": [
"else",
"else if"
],
"disallowKeywords": [
"with",
"for"
],
"disallowMixedSpacesAndTabs": true,
"disallowMultiLineTernary": true,
"disallowMultipleLineBreaks": true,
"disallowMultipleLineStrings": true,
"disallowMultipleSpaces": true,
"disallowMultipleVarDecl": true,
"disallowNamedUnassignedFunctions": true,
"disallowNestedTernaries": false,
"disallowNewlineBeforeBlockStatements": true,
"disallowNodeTypes": [
"LabeledStatement"
],
"disallowNotOperatorsInConditionals": false,
"disallowObjectKeysOnNewLine": false,
"disallowOperatorBeforeLineBreak": [
"+",
"."
],
"disallowPaddingNewLinesAfterBlocks": false,
"disallowPaddingNewLinesAfterUseStrict": false,
"disallowPaddingNewLinesBeforeExport": false,
"disallowPaddingNewlinesBeforeKeywords": false,
"disallowPaddingNewLinesBeforeLineComments": false,
"disallowPaddingNewlinesInBlocks": false,
"disallowPaddingNewLinesInObjects": false,
"disallowParenthesesAroundArrowParam": false,
"disallowQuotedKeysInObjects": {
"allExcept": [
"reserved"
]
},
"disallowSemicolons": false,
"disallowShorthandArrowFunctions": true,
"disallowSpaceAfterBinaryOperators": false,
"disallowSpaceAfterComma": false,
"disallowSpaceAfterKeywords": false,
"disallowSpaceAfterLineComment": false,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforeBinaryOperators": false,
"disallowSpaceBeforeBlockStatements": false,
"disallowSpaceBeforeComma": true,
"disallowSpaceBeforeKeywords": false,
"disallowSpaceBeforeObjectValues": false,
"disallowSpaceBeforePostfixUnaryOperators": [
"++",
"--"
],
"disallowSpaceBeforeSemicolon": true,
"disallowSpaceBetweenArguments": false,
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInCallExpression": true,
"disallowSpacesInConditionalExpression": false,
"disallowSpacesInForStatement": false,
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunction": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInGenerator": {
"beforeStar": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideArrayBrackets": false,
"disallowSpacesInsideBrackets": false,
"disallowSpacesInsideObjectBrackets": false,
"disallowSpacesInsideParentheses": true,
"disallowSpacesInsideParenthesizedExpression": true,
"disallowTabs": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"disallowUnusedParams": true,
"disallowVar": false,
"disallowYodaConditions": [
"==",
"===",
"!=",
"!=="
],
"maximumLineLength": 130,
"maximumNumberOfLines": 1000,
"requireAlignedMultilineParams": true,
"requireAlignedObjectValues": false,
"requireAnonymousFunctions": true,
"requireArrayDestructuring": false,
"requireArrowFunctions": false,
"requireBlocksOnNewline": {
"includeComments": true
},
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedComments": true,
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch",
"case",
"default"
],
"requireDollarBeforejQueryAssignment": true,
"requireDotNotation": true,
"requireEarlyReturn": true,
"requireEnhancedObjectLiterals": false,
"requireFunctionDeclarations": false,
"requireLineBreakAfterVariableAssignment": true,
"requireLineFeedAtFileEnd": true,
"requireMatchingFunctionName": true,
"requireMultiLineTernary": false,
"requireMultipleVarDecl": false,
"requireNewlineBeforeBlockStatements": false,
"requireNumericLiterals": true,
"requireObjectDestructuring": false,
"requireObjectKeysOnNewLine": true,
"requireOperatorBeforeLineBreak": [
"?",
"=",
"+",
"-",
"/",
"*",
"==",
"===",
"!=",
"!==",
">",
">=",
"<",
"<="
],
"requirePaddingNewLineAfterVariableDeclaration": false,
"requirePaddingNewLinesAfterBlocks": true,
"requirePaddingNewLinesAfterUseStrict": true,
"requirePaddingNewLinesBeforeExport": true,
"requirePaddingNewlinesBeforeKeywords": [
"do",
"for",
"if",
"while"
],
"requirePaddingNewLinesBeforeLineComments": true,
"requirePaddingNewlinesInBlocks": false,
"requirePaddingNewLinesInObjects": true,
"requireParenthesesAroundArrowParam": true,
"requireParenthesesAroundIIFE": true,
"requireQuotedKeysInObjects": false,
"requireSemicolons": true,
"requireShorthandArrowFunctions": false,
"requireSpaceAfterBinaryOperators": [
"=",
",",
"+",
"-",
"/",
"*",
"==",
"===",
"!=",
"!=="
],
"requireSpaceBeforeBinaryOperators": [
"=",
"+",
"-",
"/",
"*",
"==",
"===",
"!=",
"!=="
],
"requireSpaceAfterComma": true,
"requireSpaceAfterKeywords": [
"do",
"for",
"if",
"else",
"switch",
"case",
"try",
"catch",
"void",
"while",
"with",
"return",
"typeof"
],
"requireSpaceAfterLineComment": false,
"requireSpaceAfterObjectKeys": false,
"requireSpaceAfterPrefixUnaryOperators": false,
"requireSpaceBeforeBlockStatements": 1,
"requireSpaceBeforeComma": false,
"requireSpaceBeforeKeywords": [
"else",
"while",
"catch"
],
"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforePostfixUnaryOperators": false,
"requireSpaceBetweenArguments": true,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInCallExpression": false,
"requireSpacesInConditionalExpression": {
"afterTest": true,
"beforeConsequent": true,
"afterConsequent": true,
"beforeAlternate": true
},
"requireSpacesInForStatement": true,
"requireSpacesInFunctionDeclaration": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunction": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInGenerator": {
"afterStar": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInsideArrayBrackets": "all",
"requireSpacesInsideObjectBrackets": "all",
"requireSpacesInsideParentheses": false,
"requireSpacesInsideParenthesizedExpression": false,
"requireSpread": false,
"requireTemplateStrings": false,
"requireTrailingComma": false,
"requireVarDeclFirst": false,
"requireYodaConditions": false,
"safeContextKeyword": [
"self"
],
"validateAlignedFunctionParameters": false,
"validateCommentPosition": {
"position": "above"
},
"validateIndentation": 2,
"validateLineBreaks": "LF",
"validateNewlineAfterArrayElements": true,
"validateOrderInObjectKeys": false,
"validateParameterSeparator": ", ",
"validateQuoteMarks": "'"
}

120
.jshintrc
View File

@ -1,120 +0,0 @@
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
// * set all relaxing options to false
// * set all environment options to false, except the browser value
// * set all JSLint legacy options to false
//
// [1]: http://www.jshint.com/
// [2]: https://github.com/jshint/node-jshint/blob/master/example/config.json
// [3]: https://github.com/oryband/dotfiles/blob/master/jshintrc
//
// @author http://michael.haschke.biz/
// @license http://unlicense.org/
"esversion" : 6,
// == Enforcing Options ===============================================
//
// These options tell JSHint to be more strict towards your code. Use
// them if you want to allow only a safe subset of JavaScript, very
// useful when your codebase is shared with a big number of developers
// with different skill levels.
"bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
"curly" : true, // Require {} for every new block or scope.
"eqeqeq" : true, // Require triple equals i.e. `===`.
"forin" : true, // Tolerate `for in` loops without `hasOwnPrototype`.
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
"latedef" : true, // Prohibit variable use before definition.
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
"noempty" : true, // Prohibit use of empty blocks.
"nonew" : true, // Prohibit use of constructors for side-effects.
"plusplus" : true, // Prohibit use of `++` & `--`.
"regexp" : true, // Prohibit `.` and `[^...]` in regular expressions.
"undef" : true, // Require all non-global variables be declared before they are used.
"strict" : true, // Require `use strict` pragma in every file.
"trailing" : true, // Prohibit trailing whitespaces.
"maxlen" : 130, // Limit line length.
"unused" : true, // Prohibit unused variables.
"undef" : true, // Prohibit undefined variables.
// == Relaxing Options ================================================
//
// These options allow you to suppress certain types of warnings. Use
// them only if you are absolutely positive that you know what you are
// doing.
"asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
"eqnull" : false, // Tolerate use of `== null`.
"esnext" : true, // Allow ES.next specific features such as `const` and `let`.
"evil" : false, // Tolerate use of `eval`.
"expr" : true, // Tolerate `ExpressionStatement` as Programs.
"funcscope" : false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside.
"globalstrict" : true, // Allow global "use strict" (also enables 'strict').
"iterator" : false, // Allow usage of __iterator__ property.
"lastsemic" : false, // Tolerat missing semicolons when the it is omitted for the last statement in a one-line block.
"laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
"laxcomma" : false, // Suppress warnings about comma-first coding style.
"loopfunc" : false, // Allow functions to be defined within loops.
"multistr" : false, // Tolerate multi-line strings.
"onecase" : false, // Tolerate switches with just one case.
"proto" : false, // Tolerate __proto__ property. This property is deprecated.
"regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
"scripturl" : false, // Tolerate script-targeted URLs.
"smarttabs" : false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only.
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
"validthis" : false, // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function.
// == Environments ====================================================
//
// These options pre-define global variables that are exposed by
// popular JavaScript libraries and runtime environments—such as
// browser or node.js.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"couch" : false, // Enable globals exposed by CouchDB.
"devel" : false, // Allow development statements e.g. `console.log();`.
"dojo" : false, // Enable globals exposed by Dojo Toolkit.
"esnext" : false, // Enable globals exposed by ES6.
"mocha" : true, // Enable globals exposed by Mocha.
"jquery" : false, // Enable globals exposed by jQuery JavaScript library.
"mootools" : false, // Enable globals exposed by MooTools JavaScript framework.
"node" : true, // Enable globals available when code is running inside of the NodeJS runtime environment.
"nonstandard" : false, // Define non-standard but widely adopted globals such as escape and unescape.
"prototypejs" : false, // Enable globals exposed by Prototype JavaScript framework.
"rhino" : false, // Enable globals available when your code is running inside of the Rhino runtime environment.
"wsh" : false, // Enable globals available when your code is running as a script for the Windows Script Host.
// == JSLint Legacy ===================================================
//
// These options are legacy from JSLint. Aside from bug fixes they will
// not be improved in any way and might be removed at any point.
"nomen" : false, // Prohibit use of initial or trailing underbars in names.
"onevar" : false, // Allow only one `var` statement per function.
"passfail" : false, // Stop on first error.
"white" : false, // Check against strict whitespace and indentation rules.
// == Undocumented Options ============================================
//
// While I've found these options in [example1][2] and [example2][3]
// they are not described in the [JSHint Options documentation][4].
//
// [4]: http://www.jshint.com/options/
"maxerr" : 100, // Maximum errors before stopping.
"indent" : 4 // Specify indentation spacing
}

View File

@ -17,11 +17,7 @@
'use strict';
const gulp = require('gulp');
const jscs = require('gulp-jscs');
const jshint = require('gulp-jshint');
const jshintStylish = require('jshint-stylish');
const sass = require('gulp-sass');
const sequence = require('gulp-sequence');
const paths = {
scripts: [
@ -41,23 +37,6 @@ gulp.task('sass', function() {
.pipe(gulp.dest('./build/css'));
});
gulp.task('lint:jshint', function() {
return gulp.src(paths.scripts)
.pipe(jshint())
.pipe(jshint.reporter(jshintStylish))
.pipe(jshint.reporter('fail'));
});
gulp.task('lint:jscs', function() {
return gulp.src(paths.scripts)
.pipe(jscs())
.pipe(jscs.reporter())
.pipe(jscs.reporter('fail'));
});
gulp.task('lint', sequence('lint:jshint', 'lint:jscs'));
gulp.task('watch', [ 'lint', 'sass' ], function() {
gulp.watch(paths.scripts, [ 'lint' ]);
gulp.task('watch', [ 'sass' ], function() {
gulp.watch(paths.sass, [ 'sass' ]);
});

View File

@ -23,13 +23,6 @@ const umount = Bluebird.promisifyAll(require('umount'));
const os = require('os');
const isWindows = os.platform() === 'win32';
if (isWindows) {
// The `can-ignore` annotation is EncloseJS (http://enclosejs.com) specific.
var removedrive = Bluebird.promisifyAll(require('removedrive', 'can-ignore'));
}
/**
* @summary Write an image to a disk drive
* @function
@ -82,6 +75,10 @@ exports.writeImage = (imagePath, drive, options, onProgress) => {
}
if (isWindows && drive.mountpoint) {
// The `can-ignore` annotation is EncloseJS (http://enclosejs.com) specific.
const removedrive = Bluebird.promisifyAll(require('removedrive', 'can-ignore'));
return removedrive.ejectAsync(drive.mountpoint);
}

View File

@ -20,7 +20,12 @@
'use strict';
/* eslint-disable no-var */
var angular = require('angular');
/* eslint-enable no-var */
const _ = require('lodash');
const Store = require('./models/store');

View File

@ -55,10 +55,12 @@ module.exports = function($uibModalInstance, DrivesModel, SelectionStateModel) {
// the drive is then unplugged from the computer and the modal
// is resolved with a non-existent drive.
if (!selectedDrive || !_.includes(this.drives.getDrives(), selectedDrive)) {
return $uibModalInstance.dismiss();
$uibModalInstance.dismiss();
} else {
$uibModalInstance.close(selectedDrive);
}
return $uibModalInstance.close(selectedDrive);
};
};

View File

@ -29,6 +29,8 @@ const fs = require('fs');
* by embedding the SVG contents inside the element, making
* it possible to style icons with CSS.
*
* @returns {Object}
*
* @example
* <svg-icon path="path/to/icon.svg" width="40px" height="40px"></svg-icon>
*/

View File

@ -34,7 +34,7 @@ module.exports = function($uibModalInstance, tooltipData) {
* TooltipModalController.closeModal();
*/
this.closeModal = () => {
return $uibModalInstance.dismiss();
$uibModalInstance.dismiss();
};
};

View File

@ -41,7 +41,7 @@ module.exports = function($uibModalInstance, SettingsModel) {
* UpdateNotifierController.closeModal();
*/
this.closeModal = () => {
return $uibModalInstance.dismiss();
$uibModalInstance.dismiss();
};
};

View File

@ -76,7 +76,7 @@ Drives.service('DrivesModel', function() {
let previous = [];
return () => {
const list = func.apply(this, arguments);
const list = Reflect.apply(func, this, arguments);
if (!_.isEqual(list, previous)) {
previous = list;

View File

@ -43,11 +43,11 @@ analytics.config(($mixpanelProvider) => {
$mixpanelProvider.superProperties({
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
/* eslint-disable camelcase */
distinct_id: username.sync(),
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
/* eslint-enable camelcase */
electron: app.getVersion(),
node: process.version,
@ -89,7 +89,7 @@ analytics.config(($provide) => {
$provide.decorator('$log', ($delegate, $window, $injector) => {
// Save the original $log.debug()
let debugFn = $delegate.debug;
const debugFn = $delegate.debug;
$delegate.debug = (message) => {
message = new Date() + ' ' + message;
@ -100,7 +100,7 @@ analytics.config(($provide) => {
$window.trackJs.console.debug(message);
}
debugFn.call(null, message);
debugFn(message);
};
return $delegate;

View File

@ -84,12 +84,12 @@ return isElevated().then((elevated) => {
return elevator.executeAsync([
[
'set ELECTRON_RUN_AS_NODE=1 &&',
`set ${CONSTANTS.TEMPORARY_LOG_FILE_ENVIRONMENT_VARIABLE}=${logFile} &&`,
'set ELECTRON_RUN_AS_NODE=1 &&',
`set ${CONSTANTS.TEMPORARY_LOG_FILE_ENVIRONMENT_VARIABLE}=${logFile} &&`,
// This is a trick to make the binary afterwards catch
// the environment variables set just previously.
'call'
// This is a trick to make the binary afterwards catch
// the environment variables set just previously.
'call'
].concat(process.argv).join(' ')
], {

View File

@ -13,7 +13,8 @@
"url": "git@github.com:resin-io/etcher.git"
},
"scripts": {
"test": "gulp lint && electron-mocha --recursive --renderer tests/gui -R min",
"test": "npm run lint && electron-mocha --recursive --renderer tests/gui -R min",
"lint": "eslint gulpfile.js lib tests scripts bin",
"start": "electron lib/start.js",
"shrinkwrap": "node ./scripts/shrinkwrap.js"
},
@ -97,13 +98,9 @@
"electron-osx-sign": "^0.3.0",
"electron-packager": "^7.0.1",
"electron-prebuilt": "1.1.1",
"eslint": "^2.13.1",
"gulp": "^3.9.0",
"gulp-jscs": "^3.0.2",
"gulp-jshint": "^2.0.0",
"gulp-sass": "^2.0.4",
"gulp-sequence": "^0.4.5",
"jshint": "^2.9.1",
"jshint-stylish": "^2.0.1",
"jsonfile": "^2.3.1",
"mochainon": "^1.0.0"
},

View File

@ -9,6 +9,8 @@
* node scripts/packageignore.js
*/
'use strict';
const _ = require('lodash');
const fs = require('fs');
const path = require('path');

View File

@ -13,15 +13,17 @@
* See: https://github.com/npm/npm/issues/2679
*/
'use strict';
const _ = require('lodash');
const path = require('path');
const jsonfile = require('jsonfile');
const child_process = require('child_process');
const childProcess = require('child_process');
const shrinkwrapIgnore = require('../package.json').shrinkwrapIgnore;
const SHRINKWRAP_PATH = path.join(__dirname, '..', 'npm-shrinkwrap.json');
try {
console.log(child_process.execSync('npm shrinkwrap', {
console.log(childProcess.execSync('npm shrinkwrap', {
cwd: path.dirname(SHRINKWRAP_PATH)
}));
} catch (error) {

View File

@ -1,4 +1,3 @@
'use strict';
const m = require('mochainon');