-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstylelint.config.js
More file actions
118 lines (116 loc) · 3.43 KB
/
stylelint.config.js
File metadata and controls
118 lines (116 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* =========================================================================
stylelint.config.js
SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
This file is part of Network Pro.
========================================================================= */
/** @type {import('stylelint').Config} */
export default {
extends: [
"stylelint-config-recommended", // Base recommended config
"stylelint-config-html/html", // For linting HTML files
"stylelint-config-html/svelte", // For linting HTML within Svelte or similar frameworks
"stylelint-config-html", // For linting HTML files
],
plugins: ["stylelint-order"], // Add stylelint-order plugin
ignoreFiles: [
"./src/lib/styles/fa-global.css", // Ignore CSS import files
"./src/lib/styles/css/global.css", // Ignore CSS import files
"./src/lib/styles/css/brands.css", // Ignore FontAwesome CSS files
"**/*.min.css", // Also ignore minified CSS files as a best practice
],
overrides: [
{
files: ["**/*.html", "**/*.svelte"], // Use postcss-html for HTML and Svelte files
customSyntax: "postcss-html",
},
],
rules: {
"selector-pseudo-class-no-unknown": [
true,
{
ignorePseudoClasses: [":global"], // Allow :global for Svelte scoped styles
},
],
"property-no-vendor-prefix": null, // Allow vendor prefixes
"selector-no-vendor-prefix": null,
"selector-pseudo-element-colon-notation": [
"double",
{
severity: "warning",
},
],
"media-feature-name-no-vendor-prefix": null,
"font-family-no-duplicate-names": [
true,
{
ignoreFontFamilyNames: ["monospace"],
},
],
"selector-class-pattern": [
"^(?!fa-).*$", // Disallow classes starting with "fa-"
{
message:
"Class names must not start with 'fa-' (FontAwesome classes are ignored)",
},
],
"order/properties-order": [
[
{
groupName: "Positioning",
properties: ["position", "top", "right", "bottom", "left", "z-index"],
},
{
groupName: "Box Model",
properties: [
"display",
"flex",
"flex-grow",
"flex-shrink",
"flex-basis",
"justify-content",
"align-items",
"align-self",
"width",
"height",
"padding",
"margin",
"border",
"box-shadow",
],
},
{
groupName: "Typography",
properties: [
"font",
"font-size",
"font-weight",
"line-height",
"letter-spacing",
"color",
"text-align",
],
},
{
groupName: "Visual",
properties: [
"background",
"background-color",
"background-image",
"opacity",
"visibility",
],
},
{
groupName: "Animation & Transform",
properties: ["transition", "transform", "animation"],
},
],
{
unspecified: "bottomAlphabetical", // Place unspecified properties alphabetically at the bottom
},
],
},
reportDescriptionlessDisables: false, // Do not report disables without descriptions
reportInvalidScopeDisables: true, // Report invalid scope disables
reportNeedlessDisables: true, // Report unnecessary disables
};