{"id":20081,"library":"gulp-eslint-if-fixed","title":"gulp-eslint-if-fixed","description":"A Gulp plugin helper that filters files that were fixed by ESLint's fix option, allowing you to write fixed files back to source. Current version 1.0.0, no release cadence. Differentiates from plain gulp-eslint by providing a way to only output files that were actually modified during linting, enabling a streamlined fix pipeline without manual change detection.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/lukeapage/gulp-eslint-if-fixed","tags":["javascript","gulp","eslint","fix"],"install":[{"cmd":"npm install gulp-eslint-if-fixed","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-eslint-if-fixed","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-eslint-if-fixed","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peers with Gulp to integrate into task pipeline","package":"gulp","optional":false},{"reason":"Works as a post-processing step after gulp-eslint fix","package":"eslint","optional":false}],"imports":[{"note":"Package is CommonJS only, no ESM exports.","wrong":"import eslintIfFixed from 'gulp-eslint-if-fixed'","symbol":"eslintIfFixed","correct":"const eslintIfFixed = require('gulp-eslint-if-fixed')"},{"note":"Module exports the function directly, not as a named export.","wrong":"const { eslintIfFixed } = require('gulp-eslint-if-fixed')","symbol":"default","correct":"const eslintIfFixed = require('gulp-eslint-if-fixed')"}],"quickstart":{"code":"const gulp = require('gulp');\nconst eslint = require('gulp-eslint');\nconst eslintIfFixed = require('gulp-eslint-if-fixed');\n\ngulp.task('lint-fix', function() {\n  return gulp.src('src/*.js')\n    .pipe(eslint({ fix: true }))\n    .pipe(eslint.format())\n    .pipe(eslintIfFixed('src'));\n});","lang":"javascript","description":"Demonstrates a Gulp task that lints JavaScript files with ESLint's fix option, formats results, and writes only the fixed files back to the source directory."},"warnings":[{"fix":"Ensure you are using gulp.src() with stream mode; avoid using gulp.lastRun or async functions.","message":"The plugin does not work with the async/await or promise-based Gulp APIs (gulp 4+). It expects streams.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use gulp.src with {base: '.'} or the same base as expected by eslintIfFixed.","message":"The 'src' argument passed to eslintIfFixed must match the base directory of your Gulp source files, else fixed files may be written to incorrect paths.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using gulp-eslint's built-in 'fix' feature or updating to a more maintained alternative.","message":"Package has not been updated since 2016 and may not work with newer versions of ESLint or Gulp.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use const eslintIfFixed = require('gulp-eslint-if-fixed');","cause":"Importing the module incorrectly (e.g., as a named export or using ES import).","error":"TypeError: eslintIfFixed is not a function"},{"fix":"Ensure the plugin is placed after eslint({fix:true}) and not in a branch or after a destructive pipe.","cause":"Using the plugin with a stream that has already ended, often due to asynchronous processing.","error":"Error: write after end"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}