Permalink
Browse files

lint tools

  • Loading branch information...
1 parent 6b78bff commit a5c3d8585933a13fef393c3beddaeda99a73be34 @feons feons committed Dec 1, 2016
Showing with 1,695 additions and 1,700 deletions.
  1. +4 −0 .eslintignore
  2. +6 −4 .eslintrc.js
  3. +30 −31 Alloy/alloy.js
  4. +156 −159 Alloy/builtins/animation.js
  5. +3 −3 Alloy/builtins/dialogs.js
  6. +31 −31 Alloy/builtins/measurement.js
  7. +92 −92 Alloy/builtins/sha1.js
  8. +522 −514 Alloy/builtins/social.js
  9. +37 −37 Alloy/builtins/string.js
  10. +1 −1 Alloy/commands/compile/BuildLog.js
  11. +3 −3 Alloy/commands/compile/CompilerMakeFile.js
  12. +8 −8 Alloy/commands/compile/Orphanage.js
  13. +9 −9 Alloy/commands/compile/ast/builtins.js
  14. +90 −88 Alloy/commands/compile/compilerUtils.js
  15. +92 −92 Alloy/commands/compile/index.js
  16. +2 −2 Alloy/commands/compile/optimizer.js
  17. +1 −1 Alloy/commands/compile/parsers/Alloy.Abstract.ButtonName.js
  18. +6 −6 Alloy/commands/compile/parsers/Alloy.Abstract.FixedSpace.js
  19. +5 −5 Alloy/commands/compile/parsers/Alloy.Abstract.FlexSpace.js
  20. +1 −1 Alloy/commands/compile/parsers/Alloy.Abstract.Item.js
  21. +3 −3 Alloy/commands/compile/parsers/Alloy.Abstract.ItemTemplate.js
  22. +1 −1 Alloy/commands/compile/parsers/Alloy.Abstract.Option.js
  23. +3 −3 Alloy/commands/compile/parsers/Alloy.Abstract._BackboneClass.js
  24. +2 −2 Alloy/commands/compile/parsers/Alloy.Abstract._ItemArray.js
  25. +2 −2 Alloy/commands/compile/parsers/Alloy.Abstract._ItemContainer.js
  26. +1 −1 Alloy/commands/compile/parsers/Alloy.Abstract._ProxyProperty.js
  27. +1 −1 Alloy/commands/compile/parsers/Alloy.Module.js
  28. +9 −9 Alloy/commands/compile/parsers/Alloy.Require.js
  29. +1 −1 Alloy/commands/compile/parsers/Alloy.Widget.js
  30. +18 −18 Alloy/commands/compile/parsers/Ti.Android.ActionBar.js
  31. +15 −15 Alloy/commands/compile/parsers/Ti.Android.Menu.js
  32. +1 −1 Alloy/commands/compile/parsers/Ti.Android.MenuItem.js
  33. +2 −2 Alloy/commands/compile/parsers/Ti.Map.View.js
  34. +5 −5 Alloy/commands/compile/parsers/Ti.UI.Button.js
  35. +1 −1 Alloy/commands/compile/parsers/Ti.UI.DashboardView.js
  36. +2 −2 Alloy/commands/compile/parsers/Ti.UI.Label.js
  37. +1 −1 Alloy/commands/compile/parsers/Ti.UI.ListItem.js
  38. +2 −2 Alloy/commands/compile/parsers/Ti.UI.ListSection.js
  39. +2 −2 Alloy/commands/compile/parsers/Ti.UI.ListView.js
  40. +9 −9 Alloy/commands/compile/parsers/Ti.UI.Picker.js
  41. +4 −4 Alloy/commands/compile/parsers/Ti.UI.PickerColumn.js
  42. +2 −2 Alloy/commands/compile/parsers/Ti.UI.ScrollableView.js
  43. +1 −1 Alloy/commands/compile/parsers/Ti.UI.Switch.js
  44. +1 −1 Alloy/commands/compile/parsers/Ti.UI.Tab.js
  45. +1 −1 Alloy/commands/compile/parsers/Ti.UI.TabGroup.js
  46. +5 −5 Alloy/commands/compile/parsers/Ti.UI.TableView.js
  47. +1 −1 Alloy/commands/compile/parsers/Ti.UI.iOS.NavigationWindow.js
  48. +3 −3 Alloy/commands/compile/parsers/Ti.UI.iPad.Popover.ContentView.js
  49. +1 −1 Alloy/commands/compile/parsers/Ti.UI.iPhone.NavigationGroup.js
  50. +14 −16 Alloy/commands/compile/parsers/default.js
  51. +1 −1 Alloy/commands/compile/parsers/default_abstract.js
  52. +25 −25 Alloy/commands/compile/sourceMapper.js
  53. +32 −42 Alloy/commands/compile/styler.js
  54. +3 −3 Alloy/commands/copy/index.js
  55. +65 −66 Alloy/commands/extract-i18n/i18nHandler.js
  56. +55 −55 Alloy/commands/extract-i18n/index.js
  57. +15 −15 Alloy/commands/generate/generateUtils.js
  58. +2 −2 Alloy/commands/generate/index.js
  59. +3 −3 Alloy/commands/generate/targets/controller.js
  60. +3 −3 Alloy/commands/generate/targets/jmk.js
  61. +1 −1 Alloy/commands/generate/targets/migration.js
  62. +9 −9 Alloy/commands/generate/targets/model.js
  63. +17 −17 Alloy/commands/generate/targets/style.js
  64. +17 −17 Alloy/commands/generate/targets/widget.js
  65. +14 −14 Alloy/commands/info/index.js
  66. +2 −2 Alloy/commands/install/index.js
  67. +6 −6 Alloy/commands/move/index.js
  68. +29 −29 Alloy/commands/new/index.js
  69. +5 −5 Alloy/commands/remove/index.js
  70. +3 −3 Alloy/commands/test/index.js
  71. +7 −9 Alloy/common/constants.js
  72. +18 −18 Alloy/lib/alloy/controllers/BaseController.js
  73. +13 −13 Alloy/lib/alloy/sync/localStorage.js
  74. +9 −10 Alloy/lib/alloy/sync/properties.js
  75. +21 −22 Alloy/lib/alloy/sync/sql.js
  76. +2 −2 Alloy/lib/alloy/widget.js
  77. +2 −2 Alloy/logger.js
  78. +12 −12 Alloy/template/lib/alloy.js
  79. +1 −1 Alloy/template/wpath.js
  80. +10 −10 Alloy/tiapp.js
  81. +60 −60 Alloy/utils.js
  82. +9 −9 test/apps/testing/ALOY-262/_generated/ios/alloy/controllers/index.js
  83. +3 −3 test/apps/testing/ALOY-657/_generated/android/alloy/controllers/index.js
  84. +3 −3 test/apps/testing/ALOY-657/_generated/ios/alloy/controllers/index.js
  85. +3 −3 test/apps/testing/ALOY-657/_generated/mobileweb/alloy/controllers/index.js
  86. +2 −2 test/apps/testing/ALOY-981/_generated/ios/alloy/controllers/index.js
View
@@ -16,3 +16,7 @@ docs/
**/underscore.js
**/backbone.js
Alloy/grammar
+Alloy/builtins/social.js
+Alloy/builtins/moment
+Alloy/builtins/moment.js
+Alloy/template
View
@@ -12,18 +12,20 @@ module.exports = {
rules: {
'brace-style': [ERROR, '1tbs', {'allowSingleLine': true}],
'comma-spacing': [ERROR, {'before': false, 'after': true}],
- 'indent': [ERROR, 'tab', {'SwitchCase': 1}],
+ 'indent': [ERROR, 'tab', {'SwitchCase': 1, 'FunctionExpression': {'body': 1}}],
'keyword-spacing': ERROR,
'linebreak-style': [ERROR, 'unix'],
- 'no-fallthrough': OFF,
- 'no-console': OFF,
'no-cond-assign': OFF,
+ 'no-console': OFF,
+ 'no-control-regex': OFF,
+ 'no-fallthrough': OFF,
'no-unused-vars': OFF,
'no-undef': OFF,
'no-octal': OFF,
'quotes': [ERROR, 'single', {'avoidEscape': true, allowTemplateLiterals: true}],
'space-before-blocks': [ERROR, 'always'],
'space-infix-ops': [ERROR, {'int32Hint': false}],
- 'semi': [ERROR, 'always']
+ 'semi': [ERROR, 'always'],
+ 'valid-typeof': OFF
}
};
View
@@ -3,12 +3,12 @@
* Copyright (c) 2012 by Appcelerator, Inc. All Rights Reserved.
* See LICENSE for more information on licensing.
*/
- var program = require('commander'),
- logger = require("./logger"),
+var program = require('commander'),
+ logger = require('./logger'),
os = require('os'),
U = require('./utils'),
- colors = require("colors"),
- _ = require("./lib/alloy/underscore")._,
+ colors = require('colors'),
+ _ = require('./lib/alloy/underscore')._,
pkginfo = require('pkginfo')(module, 'version'),
path = require('path'),
fs = require('fs'),
@@ -21,10 +21,10 @@ path.existsSync = fs.existsSync || path.existsSync;
if (process.env.ALLOY_TESTS && /^win/i.test(os.platform())) {
console.error = function(m) {
fs.writeSync(2, m);
- }
+ };
console.log = console.warn = console.info = function(m) {
fs.writeSync(1, m);
- }
+ };
}
////////////////////////////////////
@@ -39,40 +39,40 @@ program
.option('-a, --app <app>', 'Test app folder for running "alloy test"')
.option('-A, --apply', 'Applies command changes [extract-i18n]')
.option('-b, --noBanner', 'Disable the banner')
- .option('-c, --config <config>','Pass in compiler configuration')
- .option('-f, --force','Force the command to execute')
+ .option('-c, --config <config>', 'Pass in compiler configuration')
+ .option('-f, --force', 'Force the command to execute')
.option('-l, --logLevel <logLevel>', 'Log level (default: 3 [DEBUG])')
- .option('-n, --no-colors','Turn off colors')
+ .option('-n, --no-colors', 'Turn off colors')
.option('-o, --outputPath <outputPath>', 'Output path for generated code')
.option('-p, --project-dir <project-dir>', 'Titanium project directory')
.option('-q, --platform <platform>', 'Target mobile platform [android,ios,mobileweb]')
.option('-s, --spec <spec>', 'test spec to use with "alloy test"')
- .option('-w, --all','require flag for generate styles')
+ .option('-w, --all', 'require flag for generate styles')
.option('-x, --column <column>', 'Column for source map query', 1)
.option('-y, --line <line>', 'Line for source map query', 1)
.option('-z, --source <source>', 'Source original file for source map query')
.option('--widgetname <name>', 'Widget name, used with generate command')
.option('--testapp <name>', 'Test app name to import, used with new command');
-program.command('new'.blue+' <dir>'.white)
+program.command('new'.blue + ' <dir>'.white)
.description(' create a new alloy project'.grey);
-program.command('compile'.blue+' [dir]'.white)
+program.command('compile'.blue + ' [dir]'.white)
.description(' compile into titanium source code'.grey);
-program.command('extract-i18n'.blue+' <language>'.white)
+program.command('extract-i18n'.blue + ' <language>'.white)
.description(' extracts i18n strings from the source code (js and tss files)'.grey);
-program.command('generate'.blue+' <type> <name>'.white)
+program.command('generate'.blue + ' <type> <name>'.white)
.description(' generate a new alloy type such as a controller'.grey);
-program.command('copy'.blue+' <source> <destination>'.white)
+program.command('copy'.blue + ' <source> <destination>'.white)
.description(' copy the controller, view, and style files from <source> to <destination>'.grey);
-program.command('move'.blue+' <source> <destination>'.white)
+program.command('move'.blue + ' <source> <destination>'.white)
.description(' move the controller, view, and style files from <source> to <destination>'.grey);
-program.command('remove'.blue+' <source>'.white)
+program.command('remove'.blue + ' <source>'.white)
.description(' remove the controller, view, and style files at <source>'.grey);
program.parse(process.argv);
@@ -82,18 +82,17 @@ program.parse(process.argv);
Error.stackTraceLimit = Infinity;
logger.stripColors = program['colors'] === false;
logger.logLevel = program['logLevel'] || logger.TRACE;
-if(program.config && program.config.indexOf('logLevel')!==-1) {
+if (program.config && program.config.indexOf('logLevel') !== -1) {
logger.logLevel = -1;
}
-if (!program.noBanner && program.args[0] !== 'info' && (program.config && program.config.indexOf('noBanner')===-1)) {
+if (!program.noBanner && program.args[0] !== 'info' && (program.config && program.config.indexOf('noBanner') === -1)) {
banner();
}
-if (program.args.length === 0)
-{
+if (program.args.length === 0) {
var help = program.helpInformation();
- help = help.replace('Usage: alloy COMMAND [ARGS] [OPTIONS]','Usage: '+'alloy'.blue+' COMMAND'.white+' [ARGS] [OPTIONS]'.grey);
+ help = help.replace('Usage: alloy COMMAND [ARGS] [OPTIONS]', 'Usage: ' + 'alloy'.blue + ' COMMAND'.white + ' [ARGS] [OPTIONS]'.grey);
help = logger.stripColors ? colors.stripColors(help) : help;
console.log(help);
process.exit(0);
@@ -117,25 +116,25 @@ if (!_.contains(getCommands(), command)) {
///////////////////////////////
function banner() {
var str =
- " .__ .__ \n"+
- "_____ | | | | ____ ___.__.\n"+
- "\\__ \\ | | | | / _ < | |\n"+
- " / __ \\| |_| |_( <_> )___ |\n"+
- "(____ /____/____/\\____// ____|\n"+
- " \\/ \\/";
+ ' .__ .__ \n' +
+ '_____ | | | | ____ ___.__.\n' +
+ '\\__ \\ | | | | / _ < | |\n' +
+ ' / __ \\| |_| |_( <_> )___ |\n' +
+ '(____ /____/____/\\____// ____|\n' +
+ ' \\/ \\/';
if (!program.dump) {
console.log(logger.stripColors ? str : str.blue);
- var m = "Alloy " + module.exports.version + " by Appcelerator. The MVC app framework for Titanium.\n".white;
+ var m = 'Alloy ' + module.exports.version + ' by Appcelerator. The MVC app framework for Titanium.\n'.white;
console.log(logger.stripColors ? colors.stripColors(m) : m);
}
}
function getCommands() {
try {
- var commandsPath = path.join(__dirname,'commands');
+ var commandsPath = path.join(__dirname, 'commands');
return _.filter(fs.readdirSync(commandsPath), function(file) {
- return path.existsSync(path.join(commandsPath,file,'index.js'));
+ return path.existsSync(path.join(commandsPath, file, 'index.js'));
});
} catch (e) {
U.die('Error getting command list', e);
Oops, something went wrong.

0 comments on commit a5c3d85

Please sign in to comment.