0.1.5 • Published 6 months ago

vkcn-report-duplicated-class-selectors v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

vkcn-report-duplicated-class-selectors

This tool help to find class selectors which where defined in different files.

It was created only to find duplicates for vue-kebab-class-naming convention and will not work with other naming conventions.

Class extraction supported from files: .css, .scss, .vue.

How to use it

Install the package as a devDependency

yarn add -D vkcn-report-duplicated-class-selectors
# or
npm install -D vkcn-report-duplicated-class-selectors

This tool can be used:

  • programmatically - in a script for custom reporter
  • cli - run as command from terminal

Programmatic usage

Use it in a js/ts script

import { findDuplicatesInFiles } from "vkcn-report-duplicated-class-selectors"

const duplicates = await findDuplicatesInFiles({
  files: ["styles/**/*.{scss,css}", "components/**/*.vue"],
  ignore: ["some/styles/to/ignore/*.css"],
})

doSomethingWithDuplicates(duplicates)

Options: <files> and <ignore> should be array of patterns (provided by glob package)

CLI usage

Use it via shell

yarn vkcn-report-duplicated-class-selectors <files> -i <ignore>

Where files and ignore - is a patterns provided by glob package. Can be used for multiple patterns split by space yarn vkcn-report-duplicated-class-selectors components/**/*.vue styles/**/*.scss

If duplicates was found then the process will finish with code 1

0.1.5

6 months ago

0.1.4

10 months ago

0.1.4-alpha.2

10 months ago

0.1.4-alpha.1

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago