Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Linting: Difference between revisions

From MoodleDocs
(Created page with "In Moodle development code linters are used to help ensure consistent coding conventions and help prevent common errors in code. == PHP (PHP_CodeSniffer) ==...")
 
No edit summary
Line 1: Line 1:
In Moodle development code linters are used to help ensure consistent [[Coding_style|coding conventions]] and help prevent common errors in code.  
In Moodle development code linters are used to help ensure consistent [[Coding_style|coding conventions]] and help prevent common errors in code.  


= Linters =
== PHP (PHP_CodeSniffer) ==
== PHP (PHP_CodeSniffer) ==


PHP code in Moodle is linted by [https://github.com/squizlabs/PHP_CodeSniffer PHP_CodeSniffer] using the rules in the [https://moodle.org/plugins/local_codechecker Code-checker plugin].
PHP code in Moodle is linted by [https://github.com/squizlabs/PHP_CodeSniffer PHP_CodeSniffer].
 
=== Rules ===
The rules defined as part of the [https://moodle.org/plugins/local_codechecker Code-checker plugin].


== Javascript (ESLint) ==
== Javascript (ESLint) ==


Since Moodle 3.2, Javascript code has been linted by [http://eslint.org eslint].
Javascript code is linted with [http://eslint.org eslint].
 
=== Rules ===
 
ESlint rules are defined within Moodle
 
=== Ignores ===
 
 


== CSS/SCSS/Less (stylelint) ==
== CSS/SCSS/Less (stylelint) ==


Since Moodle 3.2, CSS code has been linted by [http://stylelint.io stylelint].
CSS code has been linted by [http://stylelint.io stylelint].
 
=== Rules ===
 
=== Ignores ===
 
= Editor integrations =
== Atom ==
== Visual Studio Code ==
== PHPStorm ==

Revision as of 15:15, 28 November 2016

In Moodle development code linters are used to help ensure consistent coding conventions and help prevent common errors in code.

Linters

PHP (PHP_CodeSniffer)

PHP code in Moodle is linted by PHP_CodeSniffer.

Rules

The rules defined as part of the Code-checker plugin.

Javascript (ESLint)

Javascript code is linted with eslint.

Rules

ESlint rules are defined within Moodle

Ignores

CSS/SCSS/Less (stylelint)

CSS code has been linted by stylelint.

Rules

Ignores

Editor integrations

Atom

Visual Studio Code

PHPStorm