question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rollup: Allow definition of jQuery style

See original GitHub issue

In order to make sure we have the correct style rules, I’d like to use the jQuery style guide as a reference. If we can implement the jQuery style guide in ESLint, then we will have a good set of style rules as a basis.

  • Identation check (#1022)
  • No trailing whitespace
  • Unary operators must not have spaces (space-unary-ops)
  • Ternary statements must have spaces before and after both ? and : (space-infix-ops)
  • Maximum line length (max-len)
  • Require braces for control statements (curly)
  • Require multiple lines for control statements (curly)
  • Commas cannot have a preceding space (#628)
  • Semicolons cannot have a preceding space (no-space-before-semi)
  • Semicolons only at end of line (semi)
  • The : in property names should have no preceding space (#1280)
  • No filler spaces in empty constructs like [], {}
  • New line at end of file
  • If entire file is wrapped in closure, the body should not be indented
  • Spaces inside of parens (#627)
  • Spaces inside of square brackets (#631)
  • Line breaks must occur after an operator (#1405)
  • Always use semicolons (semi)
  • Use camel case (camelcase)
  • Allow non-capital constructor names
  • Align case with switch

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:25 (22 by maintainers)

github_iconTop GitHub Comments

4reactions
mysticateacommented, Sep 12, 2015

There is an workaround.

$('#somebutton').click(/* @this HTMLElement */ function(){
    var pid = $(this).attr('pid');
    doAction(pid);
});
4reactions
ndaidongcommented, Sep 12, 2015

How about “no-invalid-this”. While using jQuery, it’s normal to write:

  $('#somebutton').click(function(){
    var pid = $(this).attr('pid');
    doAction(pid);
  });

With “no-invalid-this” enabled, that will become an error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What do you do when a rollup project contains a common ...
I am using rollup to build a library that is dependent on jquery and backbone. Spent three weeks building it, but now I'm...
Read more >
How to Bundle JavaScript With Rollup — Step-by- ...
To show how effective Rollup is, let's walk through the process of building an extremely simple project that uses Rollup to bundle JavaScript....
Read more >
rollup.js
Rollup allows you to write your code using the new module system, and will then compile it back down to existing supported formats...
Read more >
.contents() | jQuery API Documentation
contents() method allows us to search through the immediate children of these elements in the DOM tree and construct a new jQuery object...
Read more >
An Introduction to jQuery
HTML, CSS, and JavaScript are three fundamental languages of the internet. ... DOM, and CDN will be defined in relation to jQuery.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found