Skip to content

Add CSS/SCSS linting tools (stylelint) #112

@jaeyeom

Description

@jaeyeom

Summary

Add CSS/SCSS linting support for web development projects.

Tool to Add

stylelint (Linter)

  • Purpose: Mighty CSS linter that helps avoid errors and enforce conventions
  • Supports: CSS, SCSS, Sass, Less, SugarSS
  • Installation:
    • macOS: brew install stylelint
    • Debian/Termux: npm install -g stylelint
  • Usage: stylelint "**/*.css" or stylelint <file.css>
  • Config: .stylelintrc.json, .stylelintrc.yml, or stylelint.config.js

Implementation Notes

1. Add to packages_data.go

{
    command: "stylelint",
    platforms: map[PlatformName]InstallMethod{
        PlatformDarwin:     BrewInstallMethod{Name: "stylelint"},
        PlatformDebianLike: NpmInstallMethod{Name: "stylelint"},
        PlatformTermux:     NpmInstallMethod{Name: "stylelint"},
    },
    Imports: []Import{{Playbook: "setup-npm"}},
},

2. Update setup-js-tools.yml to include CSS tools

---
# setup-js-tools.yml - JavaScript/TypeScript/CSS development tools
# JavaScript/TypeScript
- import_playbook: eslint.yml       # JS/TS Linter (already exists)
- import_playbook: prettier.yml     # Formatter (already exists)
- import_playbook: biome.yml        # All-in-one (to be added)
# CSS/SCSS
- import_playbook: stylelint.yml    # CSS Linter

Or create separate setup-css-tools.yml:

---
# setup-css-tools.yml - CSS/SCSS development tools
- import_playbook: stylelint.yml    # Linter
# Note: prettier (already in playbooks) can also format CSS/SCSS

3. Add to all.yml

- import_playbook: setup-css-tools.yml

Integration with Existing Tools

Tool Purpose Formats Status
prettier Formatting CSS, SCSS, Less ✅ Already in playbooks
stylelint Linting CSS, SCSS, Sass, Less ❌ To be added

Together they provide complete CSS tooling:

  • prettier: Handles formatting (indentation, spacing, etc.)
  • stylelint: Handles linting (error detection, style rules)

Common Stylelint Configuration Presets

  • stylelint-config-standard - Standard CSS rules
  • stylelint-config-standard-scss - Standard SCSS rules
  • stylelint-config-prettier - Disables rules that conflict with Prettier

Acceptance Criteria

  • Add stylelint playbook
  • Update or create CSS tools grouping playbook
  • Update all.yml to import CSS tools
  • Test on macOS
  • Test on Debian/Ubuntu
  • Test on Termux

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions