@dlzn-ui/stylelint-config 1.0.0
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 +21 -0
- package/index.ts +74 -0
- package/package.json +23 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dlzn-ui
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/index.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// [插件集合](https://stylelint.io/awesome-stylelint/)
|
|
2
|
+
// [stylelint 内置规则集](https://stylelint.io/user-guide/rules)
|
|
3
|
+
// 最新的版本去除了很多配置,比如缩进, 抛弃的规则 可在 @stylistic/stylelint-config(https://github.com/stylelint-stylistic/stylelint-config/blob/main/stylelint.config.js) 中找回
|
|
4
|
+
|
|
5
|
+
import type { Config } from 'stylelint'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
cache: true,
|
|
9
|
+
extends: [
|
|
10
|
+
'@stylistic/stylelint-config',
|
|
11
|
+
'stylelint-config-standard',
|
|
12
|
+
'stylelint-config-recess-order',
|
|
13
|
+
'stylelint-config-recommended-vue', // 放最后一个 依赖 postcss-html
|
|
14
|
+
],
|
|
15
|
+
// 设置 ignoreFiles 会覆盖默认忽略 node_modules,需显式包含
|
|
16
|
+
// https://stylelint.io/user-guide/configure/#ignorefiles
|
|
17
|
+
ignoreFiles: [
|
|
18
|
+
'**/*.min.css',
|
|
19
|
+
'.vscode/**',
|
|
20
|
+
'.idea/**',
|
|
21
|
+
'node_modules/**',
|
|
22
|
+
'dist/**',
|
|
23
|
+
'public/**',
|
|
24
|
+
'dist-ssr/**',
|
|
25
|
+
],
|
|
26
|
+
// 格式化 md 文件中的 css 代码
|
|
27
|
+
overrides: [
|
|
28
|
+
{
|
|
29
|
+
customSyntax: 'postcss-markdown',
|
|
30
|
+
files: ['*.md', '**/*.md'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
files: ['src/plugins/element-plus/theme-chalk/**/*.css'],
|
|
34
|
+
rules: {
|
|
35
|
+
'no-descending-specificity': null,
|
|
36
|
+
'no-duplicate-selectors': null,
|
|
37
|
+
'selector-class-pattern': null,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
plugins: ['stylelint-use-nesting'],
|
|
42
|
+
// null (to turn the rule off)
|
|
43
|
+
rules: {
|
|
44
|
+
'@stylistic/declaration-block-trailing-semicolon': null, // 与 prettier 保持一致
|
|
45
|
+
'@stylistic/declaration-colon-newline-after': null, // 与 prettier 保持一致
|
|
46
|
+
'@stylistic/declaration-colon-space-after': null, // 与 prettier 保持一致
|
|
47
|
+
'@stylistic/indentation': null, // 与 prettier 保持一致
|
|
48
|
+
'@stylistic/no-eol-whitespace': null, // 与 prettier 保持一致
|
|
49
|
+
'@stylistic/selector-combinator-space-before': null, // 与 prettier 保持一致
|
|
50
|
+
'@stylistic/string-quotes': null, // 与 prettier 保持一致
|
|
51
|
+
'@stylistic/value-list-comma-newline-after': null, // 与 prettier 保持一致
|
|
52
|
+
'at-rule-no-unknown': [
|
|
53
|
+
true,
|
|
54
|
+
{
|
|
55
|
+
ignoreAtRules: ['theme', 'reference'],
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
'csstools/use-nesting': [
|
|
59
|
+
'always',
|
|
60
|
+
{
|
|
61
|
+
message: '尽量使用嵌套写法',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
'import-notation': 'string', // TODO url 模式好像 tailwindcss 引入有问题
|
|
65
|
+
'selector-class-pattern': [
|
|
66
|
+
'^(t-|el-|([a-zA-Z][a-zA-Z0-9_]*[a-zA-Z0-9])$)',
|
|
67
|
+
{
|
|
68
|
+
// disableFix: true, // disable autofix
|
|
69
|
+
message: '自定义 class 名称使用 snake_case',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
'value-keyword-case': ['lower', { ignoreFunctions: ['v-bind'] }],
|
|
73
|
+
},
|
|
74
|
+
} satisfies Config
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dlzn-ui/stylelint-config",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./index.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@stylistic/stylelint-config": "^5.0.0",
|
|
16
|
+
"stylelint": "^17.14.1",
|
|
17
|
+
"stylelint-config-recess-order": "^7.7.0",
|
|
18
|
+
"stylelint-config-recommended-vue": "^2.0.0",
|
|
19
|
+
"stylelint-config-standard": "^40.0.0",
|
|
20
|
+
"stylelint-order": "^8.1.1",
|
|
21
|
+
"stylelint-use-nesting": "^6.0.2"
|
|
22
|
+
}
|
|
23
|
+
}
|