Skip to content

Commit 635566a

Browse files
Merge pull request #266 from TheDragonCode/6.x
Update README.md
2 parents a8d65df + ad18c12 commit 635566a

1 file changed

Lines changed: 44 additions & 46 deletions

File tree

README.md

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,14 @@ It is also possible to establish dependence in the global area of visibility:
3030
composer global require dragon-code/codestyler
3131
```
3232

33-
If you need to apply code-style to JS, TS, CSS, JSON, and other files, you also need to install an additional dependency
34-
in your project:
35-
36-
```bash
37-
npm i -D @biomejs/biome
38-
```
39-
40-
Next, write the commands in the `package.json` file:
41-
42-
```json
43-
{
44-
"scripts": {
45-
"lint": "npx @biomejs/biome lint --write",
46-
"format": "npx @biomejs/biome format --write",
47-
"style": "npm run lint && npm run format"
48-
}
49-
}
50-
```
51-
5233
After installing the dependency, add a file copy command to the `scripts.post-update-cmd` section.
5334
This will automatically copy the `pint.json` file to the project root.
5435

5536
When adding the command, replace `8.4` with the minimum PHP version your application works with.
5637
Available presets: `8.2`, `8.3` and `8.4`.
5738

58-
You can also add copying the `.editorconfig` file to help the IDE and calling normalize the `composer.json` file:
39+
You can also add copying the `.editorconfig` file to help the IDE and calling normalize the `composer.json` file
40+
and `biome.json` file for [Biome Linter](https://biomejs.dev):
5941

6042
```json
6143
{
@@ -70,7 +52,7 @@ You can also add copying the `.editorconfig` file to help the IDE and calling no
7052
}
7153
```
7254

73-
When using a globally established dependence, the call call must be replaced with the following:
55+
When using a globally established dependence, the call must be replaced with the following:
7456

7557
```json
7658
{
@@ -85,21 +67,55 @@ When using a globally established dependence, the call call must be replaced wit
8567
}
8668
```
8769

70+
### For JS, CSS, JSON
71+
72+
If it is necessary to correct the code style for JS, CSS and JSON, you need to separately set the dependence through
73+
the NPM package manager (or any other):
74+
75+
```bash
76+
npm i -D @biomejs/biome
77+
```
78+
79+
After that, write the commands in the `package.json` file:
80+
81+
```json
82+
{
83+
"scripts": {
84+
"lint": "npx @biomejs/biome lint --write",
85+
"format": "npx @biomejs/biome format --write",
86+
"style": "npm run lint && npm run format"
87+
}
88+
}
89+
```
90+
8891
## Usage
8992

90-
### Linter
93+
### PHP Linter
9194

92-
[`Laravel Pint`](https://laravel.com/docs/pint) is used as the linter for PHP and [Biome](https://biomejs.dev) for others. Documentation for working with it can be
93-
found [here](https://laravel.com/docs/pint).
95+
[`Laravel Pint`](https://laravel.com/docs/pint) is used as the linter for PHP.
9496

95-
The linter is invoked by a console command:
97+
The linter is invoked by a console commands:
9698

9799
```bash
98-
# For PHP
99100
composer style
101+
```
102+
103+
### Node Linter
100104

101-
# For JS, TS, CSS, JSON, etc.
102-
npm run style
105+
[Biome](https://biomejs.dev) is used as the linter for JS, CSS and JSON.
106+
107+
Make sure the `biome.json` file is in the root of the project.
108+
You can also automate this process by adding a call to the file copy function in the `scripts.post-update-cmd`
109+
section of the `composer.json` file:
110+
111+
```JSON
112+
{
113+
"scripts": {
114+
"post-update-cmd": [
115+
"vendor/bin/codestyle npm"
116+
]
117+
}
118+
}
103119
```
104120

105121
### EditorConfig
@@ -150,24 +166,6 @@ Now you can just a run console command:
150166
composer update
151167
```
152168

153-
### Npm Linter
154-
155-
[Biome](https://biomejs.dev) - format, lint, and more in a fraction of a second.
156-
157-
To do this, make sure the `biome.json` file is in the root of the project.
158-
You can also automate this process by adding a call to the file copy function in the `scripts.post-update-cmd`
159-
section of the `composer.json` file.
160-
161-
```JSON
162-
{
163-
"scripts": {
164-
"post-update-cmd": [
165-
"vendor/bin/codestyle npm"
166-
]
167-
}
168-
}
169-
```
170-
171169
### Finalized `composer.json`
172170

173171
After completing all the steps, the `composer.json` file will have the following changes:

0 commit comments

Comments
 (0)