How to build WordPress development environment with Atom of text editor.
I do not do any difficult things. Just install and configure the required packages.
In order to build WordPress development environment, it is necessary to install the packages necessary for PHP and WordPress development.
Change atom setting (indent setting)
Indentation is tab in WordPress coding convention. Change indent setting of atom.
Set it with FIle -> Settings -> Editor.
In Atom, indentation is expressed as follows.
In WordPress set hard. Incidentally, in PSR the indentation is 4 spaces. For PSR, set soft.
From File -> Settings -> Packages, click "Settings" of linter-phpcs to make the setting.
Set "Code Standard Or Config File" to "WordPress-Core".
The setting is over. Let's check the operation at the end.
Let's change the indentation of the php code on line 6 to a space. Then the result is like this.
Portions that do not conform to WordPress's coding conventions are displayed in red. And its contents are displayed in linter's window.
It is more like a debugger than a static coding checking tool.
Unless we modify it so that it conforms to WordPress' s terms, we will continue to put out the red seal.
So, if you code so that red marks do not appear, you are naturally following WordPress coding conventions.
In this case, you can concentrate on coding without worrying about coding conventions except when red marks appear.
Also, when creating in class, WordPress has its own class and class file naming convention.
These packages also recognize these as Error.
In this time, I built WordPress development environment using only the minimum necessary package.
There are many other convenient packages, so it would be possible to build a more efficient environment.
However, I am developing WordPress in this environment, but I am wondering if this is enough at the present time.