We are following the common conventions:
Exceptions:
- None
Params, properties and vars should be in camelCase, unless their origin is database call / ORM object.
We have no check for these in the built process (so far) but all developers are highly encouraged to follow those conventions to the best of their abilities.
Please set your IDE to use/check these code conventions: PHPStorm / WebStorm
We are following this convention for HTML:
In depth information on valid HTML according to W3C:
Exceptions:
- Indenting lines with 4 instead of 2 spaces: As PHP's PSR-2 standard enforces indenting with 4 spaces, we decided on applying that to HTML as well.
Please set your IDE to use/check these code conventions.
For JavaScript there are multiple conventions, we decided on the following:
- AirBnB JavaScript Code Conventions
- Inline JavaScript should follow AirBnB JavaScript Code Conventions for ES5
Exceptions:
- "func-names": ["error", "never"],
- "no-use-before-define": ["error", { "functions": false }]
- "no-underscore-dangle": ["error", { "allowAfterThis": true }],
- "comma-dangle": ["error", { "arrays": "only-multiline", "objects": "only-multiline", "imports": "only-multiline", "exports": "only-multiline", "functions": "only-multiline" }]
There is a prepared .eslintrc file in the root folder of the project.
Please set your IDE to use/check these code conventions.
Prettier is an opinionated code formatter that helps us keeping a consistent code style in our company. We have a pre-commit hook set up (if you installed via vmconsole, if not please copy the file yourself to .git/hooks/
) that will ensure that all commited JS/JSX files are run through prettier/prettier. The pre-commit is also part of this repo.
We are following BEM conventions for CSS. Please check with Joel for further information.