Setup Gulp enforces code quality through a three-layer linting stack: ESLint handles TypeScript source files, Stylelint enforces SCSS conventions, and Prettier manages consistent formatting across all file types. These tools are wired together with Husky and lint-staged so that every commit is automatically checked before it lands in version control.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jpachecox/setup-gulp/llms.txt
Use this file to discover all available pages before exploring further.
ESLint for TypeScript
ESLint is configured with the@typescript-eslint/parser to understand TypeScript syntax and @typescript-eslint/eslint-plugin to apply TypeScript-specific rules. The base configuration extends three shared rule sets — airbnb-base for strict JavaScript best practices, standard for community-standard style, and prettier to disable any rules that would conflict with Prettier formatting.
The following plugins are active:
| Plugin | Purpose |
|---|---|
import | Enforces correct ES module import/export usage |
n | Node.js-specific rules (replaces node plugin) |
promise | Best practices for Promise-based code |
react / react-hooks | React component and hooks rules |
html | Lints inline scripts in HTML files |
prettier | Surfaces Prettier formatting violations as ESLint errors |
gulp lintJs task sources all .ts files from ./src/js/, pipes them through gulp-eslint, prints a formatted report, and calls eslint.failAfterError() to halt the build if any violations remain:
Stylelint for SCSS
Stylelint validates all SCSS source files against two shared configurations:stylelint-config-standard-scss for SCSS-specific syntax rules and stylelint-config-rational-order (via stylelint-order) to enforce a logical CSS property ordering. The stylelint-order plugin is included to handle the ordering rules.
For the Gulp pipeline, gulp-sass-lint powers the dedicated lintScss task, which sources every .scss file from ./src/scss/, formats the report, and fails the pipeline on any error:
Prettier
Prettier handles opinionated formatting across JavaScript, TypeScript, JSX, TSX, and SCSS files. It is integrated with ESLint viaeslint-config-prettier (which turns off conflicting ESLint rules) and eslint-plugin-prettier (which re-exposes Prettier violations as ESLint errors), so a single yarn lint pass enforces both style and formatting.
Three scripts cover different use cases:
yarn prettier in CI pipelines where you want a failing exit code without modifying files, and yarn format locally when you want a quick full-project cleanup.
Husky pre-commit hooks
Husky interceptsgit commit and delegates to lint-staged, which runs targeted fixers only on the files actually staged for the commit. This keeps pre-commit checks fast regardless of project size.
The configuration lives directly in package.json:
.scss files, lint-staged runs stylelint --fix on them and re-stages the fixed output before the commit is finalised. The pre-commit hook delegates entirely to lint-staged, so only staged files are checked — keeping pre-commit runs fast regardless of project size.