Comments (8)
A lot of that is due to indentation? If this were fresh code we could look at refactoring or other limits such as cyclomatic complexity that would help, but since we're trying to impose this ex-post-facto it might be easier to just raise the limit for now.
from contribute.jquery.org.
maxindent
from jshint would help alot. Simply changing some nested ifs to guard clauses would help to, but I'm wondering about code readibility and overall size. It seems like 100 characters may actually hurt readibility here.
from contribute.jquery.org.
I agree the reformatting does make it look ugly, often due to the high indent levels. This could be fixed with a lot of yak shaving to clean up the intent levels and refactor code with things like early-out returns but it would be a shame to make that a blocker for getting this done.
from contribute.jquery.org.
120 seems excessively wide to me, but I'd be fine allowing projects to temporarily disable the 100 character check. Projects with a high number of long lines can take the time to adjust them before re-enabling the check. Reducing the indentation levels and staying under 100 characters will improve the readability more than just bumping the limit to 120.
from contribute.jquery.org.
@scottgonzalez sounds fine to me. @markelog please note this for core.
from contribute.jquery.org.
please note this for core.
In what way? In jquery/jquery#1590 most changes are done for comments, others, for things like:
- if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+
+ if (
+ typeof dataTypeOrTransport === "string" &&
+ !seekingTransport &&
+ !inspected[ dataTypeOrTransport ]
+ ) {
Which for me is cleaner and easier to read, isn't that why we impose 100 chars limit in the first place? Not sure if guards would helps with things like that.
Big changes are scary, right, but this is only code-style, we could do that temporary thing, but i'm not sure why, i already done everything necessary to make that permanent.
If, however, project wanted to do this 120 (or something) -> 100 limit change in iterative way, developer can override that rule, simple as that.
So to make this clear, what are wanted to do here? And what are we wanted to do in Core?
from contribute.jquery.org.
That conditional format isn't what's in our style guide. The correct format is:
if ( typeof dataTypeOrTransport === "string" &&
!seekingTransport &&
!inspected[ dataTypeOrTransport ] ) {
// body goes here
}
We can certainly discuss changing this, but based on our current style guide, what you've used is incorrect.
from contribute.jquery.org.
I prefer the current format that Scott described. Moving the opening brace
to the left seems inconsistent.
from contribute.jquery.org.
Related Issues (20)
- Style Guide: Context-changing methods as first method call HOT 2
- CLA Checker: Show time of attempted verification HOT 3
- Wrong link to the github repository for the http://sizzlejs.com/ website HOT 9
- Update CLA check text in maintainers guide HOT 2
- Deploying command is kind of confusing HOT 10
- fresh jQuery style guide
- Clarify the need to setup Wordpress locally HOT 5
- Commits and Pull Requests: Inconsistent with current workflow HOT 6
- Document focus problems in IE HOT 2
- JS styleguide: Replacement for onevar HOT 1
- Document consistency goods with files examples HOT 5
- Prefix commit subjects with semver level HOT 23
- Please clarify documentation issues in "How to Report Bugs" -> Where to Report HOT 4
- Don't require spaces inside expression parentheses HOT 2
- Plugin contribute HOT 1
- Adopt standard module (for new projects) HOT 14
- The JavaScript Style Guide incorrectly says all projects use JSHint HOT 3
- drag actions not working on microsoft touch screen laptops HOT 1
- Delete "Verify the Author Info and CLA" section HOT 1
- CLA link redirects to OpenJS Foundation page with no CLA in evidence HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contribute.jquery.org.