{"id":25122,"library":"convention-lint","title":"Convention Lint","description":"Convention Lint is a CLI and VS Code extension that enforces naming conventions for files, folders, and HTML/JSX/Vue/Svelte class and id attributes. Current stable version is 1.0.7. It provides real-time diagnostics in the Problems panel, Quick Fix actions, and support for kebab-case, camelCase, PascalCase, snake_case, and lowercase rules. Key differentiators include atomic CSS detection for utility-first frameworks, per-rule severity settings, and disable comments. It competes with tools like ESLint naming plugins but focuses specifically on file and attribute naming.","status":"active","version":"1.0.7","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","naming","convention","lint","cli","kebab-case","camelCase","snake_case"],"install":[{"cmd":"npm install convention-lint","lang":"bash","label":"npm"},{"cmd":"yarn add convention-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add convention-lint","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; no default export.","wrong":"import conventionLint from 'convention-lint'","symbol":"lintCLI","correct":"import { lintCLI } from 'convention-lint'"},{"note":"ESM-only; CommonJS require is not supported.","wrong":"const { check } = require('convention-lint')","symbol":"check","correct":"import { check } from 'convention-lint'"},{"note":"Type import for config types.","wrong":"import { ConventionConfig } from 'convention-lint'","symbol":"typeConfig","correct":"import type { ConventionConfig } from 'convention-lint'"}],"quickstart":{"code":"// Install globally\nnpm install -g convention-lint\n\n// Create .convention.json\nconst fs = require('fs');\nconst config = {\n  convention: {\n    classNamingRule: 'kebab-case',\n    idNamingRule: 'camelCase',\n    fileNamingRule: 'kebab-case',\n    folderNamingRule: 'lowercase',\n    extensions: ['.html', '.vue', '.jsx', '.tsx', '.svelte', '.php'],\n    ignoreAtomicCSS: true,\n    severity: 'warning',\n    ignore: ['node_modules', '.git', 'dist'],\n    ignorePatterns: ['**/*.test.*']\n  }\n};\nfs.writeFileSync('.convention.json', JSON.stringify(config, null, 2));\n\n// Lint a directory\nconvention-lint lint ./src\n\n// Check specific files for pre-commit\nconvention-lint check ./src/index.html ./src/component.vue","lang":"javascript","description":"Installs the CLI globally, creates a configuration file, and runs lint on a directory and specific files."},"warnings":[{"fix":"Add unknown utility classes to 'customAtomicClasses' in .convention.json.","message":"Atomic CSS detection may skip classes that are not in the built-in list; custom atomic classes should be added via 'customAtomicClasses' config.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Rename .conventionrc.json to .convention.json.","message":"Version 1.0.0 changed the configuration file format from .conventionrc.json to .convention.json; old config files are ignored.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Add 'node_modules' to the 'ignore' array in .convention.json or run with '--ignore node_modules'.","message":"CLI commands 'lint' and 'check' do not automatically ignore node_modules; you must specify in 'ignore' config or use --ignore flag.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use exactly '<!-- convention-lint-disable -->' (no extra spaces).","message":"Disable comments must be exactly as documented; extra spaces or typo will be ignored.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use 'convention-lint lint --severity off' instead of '--no-fail'.","message":"The '--no-fail' flag in 'lint' is deprecated; use '--severity off' instead.","severity":"deprecated","affected_versions":">=1.0.5"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Validate JSON with 'jsonlint .convention.json' and ensure only 'convention' top-level key.","cause":"Configuration file has syntax errors or unexpected keys.","error":"Unrecognized token in .convention.json"},{"fix":"Run 'npm install -g convention-lint' and verify with 'which convention-lint'.","cause":"Package not installed globally or not in PATH.","error":"convention-lint: command not found"},{"fix":"Use 'import { lint } from 'convention-lint'' instead of 'import conventionLint from 'convention-lint''.","cause":"Using default import instead of named import in ESM.","error":"TypeError: conventionLint.lint is not a function"},{"fix":"Run 'npm install convention-lint --save-dev' in your project root.","cause":"Package not installed locally or missing in node_modules.","error":"Module not found: Can't resolve 'convention-lint'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}