Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup JS style guide. #61

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.*
25 changes: 16 additions & 9 deletions manual/en-US/coding-standards/chapters/basic-guidelines.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
## Basic Guidelines

This chapter outlines the basic guidelines covering files contributed to the Joomla project. The most important rule to remember when coding for the Joomla project, **if in doubt, please ask**.
This chapter outlines the basic guidelines covering files contributed to the Joomla project. The most important rule to remember when coding for the Joomla project, **if in doubt, please ask**.

### File Format

All files contributed to Joomla must be:
All source (text) files contributed to Joomla must be:

* Stored as ASCII text
* Stored as ASCII text (except for strings literals used for translation).
* Use UTF-8 character encoding
* Be Unix formatted following these rules.
1. Lines must end only with a line feed (LF).
2. Line feeds are represented as ordinal 10, octal 012 and hex 0A.
* Be Unix formatted following these rules.
1. Lines must end only with a line feed (LF).
2. Line feeds are represented as ordinal 10, octal 012 and hex 0A.
3. Do not use carriage returns (CR) like Macintosh computers do or the carriage return/line feed combination (CRLF) like Windows computers do.

In addition:

* Lines must have no trailing white-space.
* A single blank line must be provided at the end of each file.

### Spelling

The spelling of words and terms used in code comments and in the naming of class, functions, variables and constant should generally be in accordance with British English rules (en\_GB).
The spelling of words and terms used in code comments and in the naming of class, functions, variables and constant should generally be in accordance with British English rules (en\_GB).
Some exceptions are permitted, for example where common programming names are used that align with the PHP API or other established conventions such as for `color` where is it common practice to maintain US English spelling.

### Indenting
### Indenting & Alignment

Tabs are used for indenting PHP and Javascript code. Source code editors or Integrated Development Environments (IDE’s) must have the tab-stops for indenting measuring four (4) spaces in length.

Tabs are used for indenting code (not spaces as required by the PEAR standard). Source code editors or Integrated Development Environments (IDE’s) such as Eclipse must have the tab-stops for indenting measuring four (4) spaces in length.
Where alignment of code is required, spaces must be used.

### Line Length

Expand Down
Loading