Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/levchak0910/vkcn-reporter
Tool that helps to detect VKCN violations across the whole project
https://github.com/levchak0910/vkcn-reporter
cli naming-convention vkcn vue
Last synced: 16 days ago
JSON representation
Tool that helps to detect VKCN violations across the whole project
- Host: GitHub
- URL: https://github.com/levchak0910/vkcn-reporter
- Owner: levchak0910
- License: mit
- Created: 2023-07-13T18:10:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-08T15:16:31.000Z (9 months ago)
- Last Synced: 2024-12-02T02:03:36.009Z (20 days ago)
- Topics: cli, naming-convention, vkcn, vue
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@vkcn/reporter
- Size: 146 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @vkcn/report
The tool that helps to detect [VKCN](https://www.npmjs.com/package/@vkcn/eslint-plugin) (vue-kebab-class-naming) violations:
- [element](https://github.com/levchak0910/vkcn-eslint-plugin/blob/HEAD/docs/rules/no-convention-violation.md#element-class) class selectors that are defined in different files.
- [modifier](https://github.com/levchak0910/vkcn-eslint-plugin/blob/HEAD/docs/rules/no-convention-violation.md#modifier-class) class selectors that may leak in different files.It was created specifically for VKCN convention and will not work with any other naming conventions.
Class extraction supported from files: `.css`, `.scss`, `.vue`.
## How to use it
Install the package as a devDependency
```bash
npm install -D @vkcn/reporter
``````bash
yarn add -D @vkcn/reporter
``````bash
pnpm add -D @vkcn/reporter
```This tool can be used:
- programmatically - in a script for a custom reporter
- cli - run as a command from the terminal### Programmatic usage
Use it in a js/ts script
```ts
import { findViolationsInFiles } from "@vkcn/reporter"const { duplicates, leaks } = await findViolationsInFiles({
files: ["styles/**/*.{scss,css}", "components/**/*.vue"],
ignore: ["some/styles/to/ignore/*.css"],
})doSomethingWithDuplicates(duplicates)
doSomethingWithLeaks(leaks)
```Options: `files` and `ignore` should be an array of patterns (provided by [glob](https://www.npmjs.com/package/glob) package)
### CLI usage
Use it via a shell
```bash
vkcn-reporter -i
```Where `` and `` - are patterns provided by [glob](https://www.npmjs.com/package/glob) package. Can be used for multiple patterns split by a space `vkcn-reporter 'components/**/*.vue styles/**/*.scss'`. (_Make sure your folder and file names do not contain space_)
If violations are found, the process will finish with a code `1`