Registry / devops / gulp-lint-filepath

gulp-lint-filepath

JSON →
library1.0.1jsnpmunverified

A Gulp plugin (v1.0.1) that lints file paths and names in a vinyl stream. It enforces naming conventions, allowed extensions, and directory index presence through customizable rules. Built-in rules include directory-index, directory-name, file-extension, and file-name – all disabled by default. The plugin supports custom rules and custom reporters. Last updated in 2015, it requires Node >=0.10 and has no recent maintenance. Unlike generic linters, it focuses solely on path conventions and integrates with Gulp pipelines.

npm install gulp-lint-filepath
INSTALL
IMPORT
SIG · GULP-LINT-FILEPATH
G
gulp-lint-filepath
devopsjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import lintFilepath from 'gulp-lint-filepath'
const lintFilepath = require('gulp-lint-filepath')
Default export is the linter function. CJS require works but ESM import is recommended for modern projects.
reporter
import { reporter } from 'gulp-lint-filepath'
const reporter = require('gulp-lint-filepath').reporter
Named export 'reporter' available since v1.0.0. CJS require also works.
FilePath
import { FilePath } from 'gulp-lint-filepath'
const FilePath = require('gulp-lint-filepath').FilePath
FilePath class used for custom rules. May not be directly exported; check documentation.
types
import type { LintConfig } from 'gulp-lint-filepath'
TypeScript types not bundled; consider @types/gulp-lint-filepath if available.

Shows basic Gulp task setup for linting file paths with rules for extensions, file names, and directory names.

const gulp = require('gulp'); const lintFilepath = require('gulp-lint-filepath'); const config = { 'file-extension': ['.js', '.json'], 'file-name': [/^[a-z0-9.-]+$/], 'directory-name': [/^[a-z0-9-]+$/] }; gulp.task('lint:paths', function() { return gulp.src(['./**/*.*', '!./node_modules/**']) .pipe(lintFilepath(config)) .pipe(lintFilepath.reporter()); });
Debug
Known issues
gotchaAll rules are disabled by default. You must provide configuration to enable any linting.
fix
Pass a config object with rule keys and arrays/regexes.
affects: >=0.0.0
deprecatedPackage is no longer maintained. Last update was in 2015.
fix
Consider alternatives like eslint-plugin-filenames or custom Gulp tasks with glob patterns.
affects: >=1.0.0
gotchaThe 'file-name' rule does not include the file extension in the check.
fix
Ensure your regex for file-name only matches the name without extension.
affects: >=0.0.0
gotchaThe 'directory-index' rule ignores directories with an 'ignore' array, not files.
fix
Provide directory paths or patterns in the ignore property for directory-index.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: lintFilepath is not a function
Default import not used correctly in ESM
fix
Use default import: import lintFilepath from 'gulp-lint-filepath'
Error: Rule 'file-extension' requires an array
Config provided as object instead of array for rule
fix
Make 'file-extension' an array of strings/regex, e.g., ['.js']
TypeError: Cannot read property 'reporter' of undefined
Reporter accessed before lintFilepath was loaded
fix
Ensure lintFilepath is required/imported first: const lintFilepath = require('gulp-lint-filepath')
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
gulp-utilrequiredUsed for plugin error handling and logging
through2requiredStream transformation for vinyl files
Agent activity
4 hits · last 30 days
node
4
Resources
gulp-lint-filepath — npm install gulp-lint-filepath · libregistry