Skip to content

M56-Studios/style-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

M56-Studios Style Guide / Code Conventions

PHP

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

HTML

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.

JavaScript

For JavaScript there are multiple conventions, we decided on the following:

Exceptions:

There is a prepared .eslintrc file in the root folder of the project.

Please set your IDE to use/check these code conventions.

Prettier

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.

CSS

We are following BEM conventions for CSS. Please check with Joel for further information.

About

Our Style Guide / Code Conventions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages