Code Linting and Auto-fix

VerifiedSafe

Lint and auto-fix JavaScript, CSS, and PHP files to enforce coding standards (ESLint, Stylelint, WPCS). Run before committing to ensure code quality and compliance.

Sby Skills Guide Bot
DevelopmentBeginner
1706/2/2026
Claude CodeCursorWindsurfCopilotCodex
#linting#javascript#css#php#wordpress

Recommended for

Our review

Lints and auto-fixes JavaScript, CSS, and PHP files using npm scripts to enforce coding standards.

Strengths

  • Detects syntax and style errors early.
  • Auto-fix available for JS and CSS.
  • Enforces WordPress Coding Standards for PHP.
  • Covers multiple languages in one command.

Limitations

  • Requires preconfigured npm scripts.
  • Does not replace manual code review.
  • Custom rules are not included by default.
When to use it

Use this skill before every commit to ensure code quality and consistency.

When not to use it

Avoid if you already use other linting tools or if the project lacks npm linting scripts.

Security analysis

Safe
Quality score90/100

The skill only executes npm scripts for linting and auto-fixing, with no destructive commands, external calls, or handling of secrets. It poses no security risk.

No concerns found

Examples

Full project lint and auto-fix
Lint all JavaScript, CSS, and PHP files in the project and auto-fix any issues.
JavaScript lint check only
Run the JavaScript linter on the codebase without fixing anything.
Auto-fix CSS lint errors
Automatically fix all CSS lint errors in the project using npm run lint:css -- --fix.

name: lint description: Lint and auto-fix JavaScript, CSS, and PHP files disable-model-invocation: true allowed-tools: Bash(npm run *), Bash(npx wp-env *), Bash(git *), Read, Glob

Lint JavaScript, CSS, and PHP files for code quality and standards compliance.

Lint Commands

JavaScript:

npm run lint:js

Auto-fix JavaScript:

npm run lint:js -- --fix

CSS/SCSS:

npm run lint:css

Auto-fix CSS:

npm run lint:css -- --fix

PHP (WordPress Coding Standards):

npm run lint:php

Run all linters:

npm run lint:js && npm run lint:css && npm run lint:php

What Gets Checked

JavaScript:

  • ESLint with @wordpress/eslint-plugin
  • WordPress coding standards
  • No deprecated APIs
  • Proper i18n usage

CSS:

  • Stylelint
  • BEM naming conventions
  • No duplicate selectors
  • Property ordering

PHP:

  • WordPress PHP Coding Standards (WPCS)
  • Security best practices
  • Proper escaping and sanitization
  • Documentation standards

Before Committing

Always lint before committing:

npm run lint:js -- --fix && npm run lint:css -- --fix
Related skills