Registry / testing / eslint-plugin-check-file

eslint-plugin-check-file

JSON →
library3.3.1jsnpmunverified

ESLint plugin for enforcing consistent naming conventions for files and folders. Current stable version is 3.3.1, requiring Node >=18 and ESLint >=9 with flat config. Provides five rules: no-index, filename-blocklist, folder-match-with-fex, filename-naming-convention (supports built-in cases like PASCAL_CASE, CAMEL_CASE, NEXT_JS_PAGE_ROUTER_FILENAME_CASE), and folder-naming-convention. Unlike generic naming tools, it uses glob patterns to target specific file paths and supports linting non-JS/TS files via a dedicated processor. Ships TypeScript definitions.

npm install eslint-plugin-check-file
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-CHEC
E
eslint-plugin-check-file
testingjavascriptv3.3.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

checkFile
import checkFile from 'eslint-plugin-check-file'
const checkFile = require('eslint-plugin-check-file')
Plugin is ESM-only in v3. CommonJS require will fail.
rules
import { rules } from 'eslint-plugin-check-file'
import { rules } from 'eslint-plugin-check-file'
Access rules object if needed for custom configuration.
FlatConfig
import checkFile from 'eslint-plugin-check-file'; export default [ { plugins: { 'check-file': checkFile } } ]
module.exports = { plugins: ['check-file'] }
v3 only supports flat config. Legacy .eslintrc style not supported.

Shows the minimal flat config setup with two rules to enforce PascalCase for JSX/TSX files and CamelCase for JS/TS files, plus a folder naming rule.

// eslint.config.js import checkFile from 'eslint-plugin-check-file'; export default [ { files: ['src/**/*.{js,ts,jsx,tsx}'], plugins: { 'check-file': checkFile, }, rules: { 'check-file/filename-naming-convention': [ 'error', { '**/*.{jsx,tsx}': 'PASCAL_CASE', '**/*.{js,ts}': 'CAMEL_CASE', }, ], 'check-file/folder-naming-convention': [ 'error', { 'src/components/*': 'PASCAL_CASE', }, ], 'check-file/no-index': 'error', }, }, ]; // Run: npx eslint src/
Debug
Known issues
breakingv3 migrated to ESM-only and flat config; Node <18 and ESLint <9 not supported.
fix
Upgrade Node to >=18, ESLint to >=9, and use flat config syntax (eslint.config.js).
affects: >=3.0.0
breakingv3 requires ESLint flat config; legacy .eslintrc.* files are ignored.
fix
Convert .eslintrc.* to eslint.config.js using plugins array with object syntax.
affects: >=3.0.0
deprecatedv3 removes support for CommonJS; require() will throw.
fix
Use ESM imports (import) or dynamic import() in CJS contexts.
affects: >=3.0.0
gotchaThe 'processor' field is required for non-JS/TS files like .yaml, .webp. Without it, those files are skipped.
fix
Add 'processor: "check-file/eslint-processor-check-file"' to the file config block.
affects: >=3.0.0
gotchaGlob patterns in rules must match file paths relative to the project root; incorrect patterns cause rules to silently not apply.
fix
Test patterns using ESLint's --debug flag or run with a single file to verify matching.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-plugin-check-file'
Missing dependency or wrong import path when using ESM in non-module context.
fix
Run 'npm install eslint-plugin-check-file --save-dev' and ensure the import uses ESM syntax or a bundler.
TypeError: eslint.PLUGIN_VERSION is not a function
Using v3 with ESLint <9 or legacy .eslintrc config.
fix
Upgrade ESLint to >=9 and switch to flat config (eslint.config.js).
Parsing error: The keyword 'import' is reserved
Attempting to use ESM import in a CommonJS file without .mjs extension or type:'module' in package.json.
fix
Rename eslint.config.js to eslint.config.mjs or add 'type': 'module' to package.json.
Error: No configuration found for file '...'
File does not match any 'files' pattern in eslint config.
fix
Add a 'files' pattern that includes the file's path (e.g., ['**/*.js']).
Upgrade
Version history
3.3.1latest on npm
Audit
Dependencies
eslintrequiredPeer dependency: v3.x requires ESLint >=9.0.0 with flat config
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-check-file — npm install eslint-plugin-check-file · libregistry