๐Ÿ“ฆ Stirling-Tools / Stirling-PDF

๐Ÿ“„ STYLELINT.md ยท 48 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48# STYLELINT.md

## Usage

Apply Stylelint to your project's CSS with the following steps:

1. **NPM Script**

   - Go to directory: `devTools/`

   - Add Stylelint & stylistic/stylelint-plugin
     ```bash
     npm install --save-dev stylelint stylelint-config-standard
     npm install --save-dev @stylistic/stylelint-plugin
     ```
   - Add a script entry to your `package.json`:
     ```jsonc
     {
       "scripts": {
          "lint:css:check": "stylelint \"../app/core/src/main/**/*.css\" \"../app/proprietary/src/main/resources/static/css/*.css\" --config ../.stylelintrc.json",
          "lint:css:fix": "stylelint \"../app/core//src/main/**/*.css\" \"../app/proprietary/src/main/resources/static/css/*.css\" --config .stylelintrc.json --fix"
       }
     }
     ```
   - Run the linter:
     ```bash
     npm run lint:css:check
     npm run lint:css:fix
     ```

2. **CLI Usage**

   - Lint all CSS files:
     ```bash
     npx stylelint ../app/core/src/main/**/*.css ../app/proprietary/src/main/resources/static/css/*.css
     ```
   - Lint a single file:
     ```bash
     npx stylelint ../app/proprietary/src/main/resources/static/css/audit-dashboard.css
     ```
   - Apply automatic fixes:
     ```bash
     npx stylelint "../app/core/src/main/**/*.css" "../app/proprietary/src/main/resources/static/css/*.css" --fix
     ```

For full configuration options and rule customization, refer to the official documentation: [https://stylelint.io](https://stylelint.io)