ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Sprout​Core Snippets and JSHint Integration

by sproutcore ST2/ST3

A SproutCore package for Sublime Text 2

Labels snippets

Details

  • 2015.10.14.09.47.23
  • github.​com
  • github.​com
  • 2 years ago
  • 2 hours ago
  • 4 years ago

Installs

  • Total 1K
  • Win 669
  • OS X 291
  • Linux 105
Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5
Windows 1 0 0 0 2 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 2 1 2 0 1 0 1 1 3 0 0 2 0 1 1 1 0 0 2 1 0 1 0 3
OS X 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 3 0 1 0 0 0 1
Linux 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0

Readme

Source
raw.​githubusercontent.​com

sublime-text-package

A SproutCore package for Sublime Text 2 and 3.

This package includes several useful SproutCore specific snippets and integration with JSHint.

To use this package you must first install jshint and ensure that jshint is in your environment path.

  1. Install node-jshint using npm

    $ npm install -g jshint

  2. Install the SproutCore package using Package Control in Sublime Text

    1. ⇧⌘P or ⇧⌃P (Linux/Windows)
    2. select Package Control: Install Package
    3. select SproutCore

JSHint

This package runs jshint on all JavaScript files on every save. This allows you to catch errors early before going to the browser and testing. It also allows you to catch potentially dangerous code like implied globals and redeclared variables.

JSHint also enforces a very standard clean style of JavaScript, which is what the SproutCore framework adheres too. While you may initially find the style warnings to be annoying, following them is easy and in the end it makes for easily recognizable and shareable code.

As part of the JSHint integration, this package also includes a default .jshintrc file that it uses to add the SproutCore specific globals.

Snippets

There are several snippets available to significantly reduce the amount of typing you need to do. To use a snippet, start typing the keyword and select the appropriate snippet to insert useful predefined code. You can then use the tab key to jump between the configurable aspects of the snippet to modify it very quickly without using the mouse.

  • SCButtonView - An SC.ButtonView template.
  • SCLabelView - An SC.LabelView template.
  • SCListView - An SC.ListView template.
  • SCRecord - An SC.Record template with several attributes and a primaryKey.
  • SCState - An SC.State template with enterState and exitState.
  • SCScrollView - An SC.ScrollView template.
  • SCTextFieldView - An SC.TextFieldView template.
  • SCView - An SC.View template.
  • SCView (Class) - An SC.View as a Class template with render and update.
  • SCBinding - A oneWay binding.
  • childViews - Adds childViews property.
  • childViewLayout - Adds childViewLayout & childViewLayoutOptions properties.
  • for - A forward for loop using .get('length') & .objectAt()
  • for - A reverse for loop using .get('length') & .objectAt()
  • function (observes) - A .observes function.
  • function (property) - A .property function.
  • function (cacheable) - A .property.cacheable function.