{"id":26254,"library":"remark-lint-no-file-name-irregular-characters","title":"remark-lint-no-file-name-irregular-characters","description":"A remark-lint rule that warns when Markdown file names contain characters outside a configurable allowed set (default: alphanumeric, dash, dot). Current stable version is 3.0.1. It is part of the unified/remark ecosystem, maintained by the remark organization, and follows semantic versioning. Key differentiator: allows custom regex patterns to define which characters are irregular, enabling project-specific naming conventions. Supports ESM only, Node.js 16+, and TypeScript types.","status":"active","version":"3.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","character","file","irregular","lint","name","remark","remark-lint","remark-lint-rule","typescript"],"install":[{"cmd":"npm install remark-lint-no-file-name-irregular-characters","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-file-name-irregular-characters","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-file-name-irregular-characters","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for creating remark-lint rules","package":"unified-lint-rule","optional":false}],"imports":[{"note":"This package is ESM-only since v3; no CJS support.","wrong":"const remarkLintNoFileNameIrregularCharacters = require('remark-lint-no-file-name-irregular-characters')","symbol":"default","correct":"import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'"}],"quickstart":{"code":"import remarkLint from 'remark-lint';\nimport remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport {read} from 'to-vfile';\nimport {unified} from 'unified';\nimport {reporter} from 'vfile-reporter';\n\nconst file = await read('example.md');\n\nawait unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoFileNameIrregularCharacters)\n  .use(remarkStringify)\n  .process(file);\n\nconsole.error(reporter(file));","lang":"typescript","description":"Configures remark with the lint rule to check file names for irregular characters, processes a Markdown file, and reports messages."},"warnings":[{"fix":"Use import syntax instead of require(). If you need CJS, stick with version 2.x.","message":"This package is ESM-only from version 3.0.0 onwards. Importing with require() will fail.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade Node.js to version 16 or later.","message":"Node.js version <16 is no longer supported from version 3.0.0.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Check your options string: it should represent allowed characters, e.g., '\\.a-z0-9' for dots, lowercase letters, and digits.","message":"The options parameter can be a string or RegExp. If string, it is used as the allowed characters set (inverted to form the irregular pattern). Be careful to escape regex special characters in the string.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If you need underscores, pass a custom options string like '\\.a-z0-9_' or a RegExp.","message":"The default regular expression allows only letters (A-Za-z), digits (0-9), dash (-), and dot (.). Underscores and spaces are considered irregular.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to import:\nimport remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'","cause":"Using require() to import an ESM-only package (v3+).","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Configure the plugin with an options string that includes underscore:\n.use(remarkLintNoFileNameIrregularCharacters, '\\.a-z0-9_')","cause":"The underscore is not in the allowed characters set by default.","error":"Unexpected character `_` in file name"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}