{"id":26255,"library":"remark-lint-no-file-name-outer-dashes","title":"remark-lint-no-file-name-outer-dashes","description":"A remark-lint rule that warns when file names start or end with dashes. Current stable version is 3.0.1, compatible with Node.js 16+. It is part of the remark-lint ecosystem and is ESM-only. This rule helps enforce consistent file naming conventions by flagging leading or trailing hyphens, which are often unintended. It is included in the `remark-preset-lint-markdown-style-guide` preset. Releases follow the unified collective's schedule with occasional patches across all packages.","status":"active","version":"3.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","dash","file","hyphen","lint","name","remark","remark-lint","remark-lint-rule","typescript"],"install":[{"cmd":"npm install remark-lint-no-file-name-outer-dashes","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-file-name-outer-dashes","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-file-name-outer-dashes","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Needed as the processor framework","package":"unified","optional":false},{"reason":"Required to use lint rules","package":"remark-lint","optional":false},{"reason":"Used for parsing Markdown in API usage","package":"remark-parse","optional":true},{"reason":"Used for serializing Markdown in API usage","package":"remark-stringify","optional":true}],"imports":[{"note":"Package is ESM-only since v3; CJS require() will fail.","wrong":"const remarkLintNoFileNameOuterDashes = require('remark-lint-no-file-name-outer-dashes')","symbol":"remarkLintNoFileNameOuterDashes","correct":"import remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'"}],"quickstart":{"code":"import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkLint from 'remark-lint';\nimport remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes';\nimport { read } from 'to-vfile';\nimport { reporter } from 'vfile-reporter';\n\nconst file = await read('-mercury.md');\n\nawait unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoFileNameOuterDashes)\n  .use(remarkStringify)\n  .process(file);\n\nconsole.error(reporter(file));\n// Output: 1:1: Unexpected initial or final dashes in file name, expected dashes to join words","lang":"typescript","description":"Shows how to use the rule in Node.js with unified to detect leading dashes in a filename."},"warnings":[{"fix":"Use import instead of require. For older Node.js, use dynamic import or migrate to ESM.","message":"ESM-only: Package is ESM-only since v3. require() will throw an error.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade Node.js to version 16 or higher.","message":"Node.js 16+ required: As of v3, the package requires Node.js 16 or later.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade Node.js to 16+.","message":"No longer supports Node.js <16: Dropped support for Node.js versions below 16.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install remark-lint-no-file-name-outer-dashes' and ensure correct import statement.","cause":"Package not installed or wrong import path.","error":"Cannot find module 'remark-lint-no-file-name-outer-dashes'"},{"fix":"Change to import statement: import remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'","cause":"Using require() with an ESM-only package.","error":"ERR_REQUIRE_ESM: require() of ES Module"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}