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] | 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) == | ||
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) == | ||
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.