convention-lint 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +27 -0
- package/README.md +129 -0
- package/dist/convention-lint.js +1 -1
- package/package.json +4 -2
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015.12.06-2026 Daekyung Yoo. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are the
|
|
6
|
+
exclusive property of Daekyung Yoo.
|
|
7
|
+
|
|
8
|
+
1. GRANT OF USE: You are granted a non-exclusive, non-transferable license
|
|
9
|
+
to use the Software solely through official distribution channels
|
|
10
|
+
(Visual Studio Code Marketplace, npm registry, and the author's servers)
|
|
11
|
+
for your personal or internal business purposes.
|
|
12
|
+
|
|
13
|
+
2. RESTRICTIONS: You may NOT, without prior written permission from the
|
|
14
|
+
copyright holder:
|
|
15
|
+
- Copy, modify, merge, or create derivative works of the Software
|
|
16
|
+
- Distribute, sublicense, sell, or transfer the Software
|
|
17
|
+
- Reverse engineer, decompile, or disassemble the Software
|
|
18
|
+
- Remove or alter any proprietary notices or labels
|
|
19
|
+
|
|
20
|
+
3. TERMINATION: This license is effective until terminated. It will
|
|
21
|
+
terminate automatically if you fail to comply with any term of this
|
|
22
|
+
license.
|
|
23
|
+
|
|
24
|
+
4. DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
25
|
+
KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
|
|
26
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE USE
|
|
27
|
+
OF THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Convention Lint
|
|
2
|
+
|
|
3
|
+
Enforce consistent naming conventions for files, folders, and HTML/JSX/Vue/Svelte class & id attributes — with real-time diagnostics and Quick Fix.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Search **"Convention Lint"** in the VS Code Marketplace, or:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
ext install Drangon-Knight.convention-lint
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### CLI
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g convention-lint
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
### Real-time Diagnostics (Problems Panel)
|
|
22
|
+
|
|
23
|
+
Convention Lint reports violations directly in the **Problems** panel — just like ESLint or Stylelint.
|
|
24
|
+
|
|
25
|
+
- Inline wavy underlines on violations
|
|
26
|
+
- Detailed messages with violation reason
|
|
27
|
+
- Severity levels: Error, Warning, Information, Hint, or Off
|
|
28
|
+
|
|
29
|
+
### Quick Fix + Fix All
|
|
30
|
+
|
|
31
|
+
Click the lightbulb or press `Ctrl+.` on a violation to auto-convert:
|
|
32
|
+
|
|
33
|
+
- `myClass` → `my-class` (kebab-case)
|
|
34
|
+
- `my-component` → `myComponent` (camelCase)
|
|
35
|
+
- **Fix All Convention Lint** — fix every violation in one click
|
|
36
|
+
|
|
37
|
+
### Disable Comments
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<!-- convention-lint-disable -->
|
|
41
|
+
<div class="IgnoreThis"></div>
|
|
42
|
+
<!-- convention-lint-enable -->
|
|
43
|
+
|
|
44
|
+
<!-- convention-lint-disable-next-line -->
|
|
45
|
+
<div class="ThisLineOnly"></div>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Supported Naming Rules
|
|
49
|
+
|
|
50
|
+
| Rule | Pattern | Example |
|
|
51
|
+
|------|---------|---------|
|
|
52
|
+
| `kebab-case` | lowercase + hyphens | `my-component` |
|
|
53
|
+
| `camelCase` | lowercase first, capitalize words | `myComponent` |
|
|
54
|
+
| `PascalCase` | capitalize all words | `MyComponent` |
|
|
55
|
+
| `snake_case` | lowercase + underscores | `my_component` |
|
|
56
|
+
| `lowercase` | lowercase only, no separators | `mycomponent` |
|
|
57
|
+
|
|
58
|
+
### Supported File Types
|
|
59
|
+
|
|
60
|
+
| Language | Attributes |
|
|
61
|
+
|----------|-----------|
|
|
62
|
+
| HTML | `class`, `id`, `src` |
|
|
63
|
+
| Vue | `class`, `:class`, `v-bind:class` |
|
|
64
|
+
| JSX / TSX | `className` |
|
|
65
|
+
| Angular | `class`, `[ngClass]`, `[class.name]` |
|
|
66
|
+
| Svelte | `class`, `class:name` |
|
|
67
|
+
| PHP | `class`, `id` (template syntax excluded) |
|
|
68
|
+
|
|
69
|
+
### Atomic CSS Detection
|
|
70
|
+
|
|
71
|
+
Automatically skips 300+ utility-first CSS class names (df, jcc, w100px, bgFFFFFF, sm-dn, hover-o80, etc.)
|
|
72
|
+
|
|
73
|
+
## Configuration
|
|
74
|
+
|
|
75
|
+
Create `.convention.json` in your project root:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"convention": {
|
|
80
|
+
"classNamingRule": "kebab-case",
|
|
81
|
+
"idNamingRule": "camelCase",
|
|
82
|
+
"fileNamingRule": "kebab-case",
|
|
83
|
+
"folderNamingRule": "lowercase",
|
|
84
|
+
"extensions": [".html", ".vue", ".jsx", ".tsx", ".svelte", ".php"],
|
|
85
|
+
"ignoreAtomicCSS": true,
|
|
86
|
+
"severity": "warning",
|
|
87
|
+
"ignore": ["node_modules", ".git", "dist"],
|
|
88
|
+
"ignorePatterns": ["**/*.test.*"]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Per-Rule Severity
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"convention": {
|
|
98
|
+
"severity": "warning",
|
|
99
|
+
"classSeverity": "error",
|
|
100
|
+
"idSeverity": "hint",
|
|
101
|
+
"pathSeverity": "off"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## CLI Usage
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
convention-lint lint [dir] # Scan folder
|
|
110
|
+
convention-lint lint --no-fail # Warn only (CI mode)
|
|
111
|
+
convention-lint check <files...> # Check specific files (pre-commit)
|
|
112
|
+
convention-lint watch [dir] # Watch mode
|
|
113
|
+
convention-lint init # Create .convention.json
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Commands
|
|
117
|
+
|
|
118
|
+
| Command | Shortcut | Description |
|
|
119
|
+
|---------|----------|-------------|
|
|
120
|
+
| Check & Save | `Ctrl+S` | Validate then save |
|
|
121
|
+
| Check Folder | — | Scan a folder |
|
|
122
|
+
| Check Workspace | — | Scan all files |
|
|
123
|
+
| Toggle ON/OFF | — | Enable/disable |
|
|
124
|
+
|
|
125
|
+
## Links
|
|
126
|
+
|
|
127
|
+
- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Drangon-Knight.convention-lint)
|
|
128
|
+
- [GitHub](https://github.com/Yoodaekyung/Convention-Lint)
|
|
129
|
+
- [Issues](https://github.com/Yoodaekyung/Convention-Lint/issues)
|