FAQ
Heya,

More and more contrib modules are including JavaScript files, so I want to
add the ability to review JavaScript files to the
Coder<http://drupal.org/project/coder>module. However, step 1 is we
need to agree on what coding standards we
should be using for JavaScript.

At present we have the Coding standards for JS
files<http://drupal.org/node/172169>doc which has one or two ideas but
isn't complete. We also have the main Coding
Standards <http://drupal.org/coding-standards> doc, and while most are
transferable to JavaScript, not all are. So I've put some suggestions
together at http://drupal.org/node/260140 A fair few of them come from the
standards used by JSLint so there shouldn't be many surprises. I'd really
appreciate a discussion/debate on this and hopefully we can agree on the
coding standards we want to use.

Cheers,
Stella
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080519/a901cae4/attachment.htm

Search Discussions

  • David Timothy Strauss at May 19, 2008 at 3:38 pm
    I'd rather use jQuery's standards as a foundation rather than Drupal's PHP ones, unless we have a good reason to do otherwise.

    ----- "Stella Power" wrote:
    Heya,
    More and more contrib modules are including JavaScript files, so I want to add the ability to review JavaScript files to the Coder module. However, step 1 is we need to agree on what coding standards we should be using for JavaScript.

    At present we have the Coding standards for JS files doc which has one or two ideas but isn't complete. We also have the main Coding Standards doc, and while most are transferable to JavaScript, not all are. So I've put some suggestions together at http://drupal.org/node/260140 A fair few of them come from the standards used by JSLint so there shouldn't be many surprises. I'd really appreciate a discussion/debate on this and hopefully we can agree on the coding standards we want to use.

    Cheers,
    Stella
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.drupal.org/pipermail/development/attachments/20080519/47837abd/attachment.htm
  • Darrel O'Pry at May 19, 2008 at 3:59 pm
    I'm not sure that jQuery has coding stanards, but I like this form for
    anonymous functions in plugins. It's succint and readable. I'm totally down
    with 2 spaces being the indentation standard. I prefer tighter lines of code
    in my JS and tend to use single line conditional constructs alot.

    $('div').each(function() {
    // do my stuff.
    });

    .darrel.
    On Mon, May 19, 2008 at 11:38 AM, David Timothy Strauss wrote:

    I'd rather use jQuery's standards as a foundation rather than Drupal's PHP
    ones, unless we have a good reason to do otherwise.


    ----- "Stella Power" wrote:
    Heya,
    More and more contrib modules are including JavaScript files, so I want
    to add the ability to review JavaScript files to the Coder<http://drupal.org/project/coder>module. However, step 1 is we need to agree on what coding standards we
    should be using for JavaScript.
    At present we have the Coding standards for JS files<http://drupal.org/node/172169>doc which has one or two ideas but isn't complete. We also have the main Coding
    Standards <http://drupal.org/coding-standards> doc, and while most are
    transferable to JavaScript, not all are. So I've put some suggestions
    together at http://drupal.org/node/260140 A fair few of them come from
    the standards used by JSLint so there shouldn't be many surprises. I'd
    really appreciate a discussion/debate on this and hopefully we can agree on
    the coding standards we want to use.
    Cheers,
    Stella
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.drupal.org/pipermail/development/attachments/20080519/b0ed16bc/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdevelopment @
categoriesdrupal
postedMay 19, '08 at 12:43p
activeMay 19, '08 at 3:59p
posts3
users3
websitedrupal.org
irc#drupal

People

Translate

site design / logo © 2022 Grokbase