-
Notifications
You must be signed in to change notification settings - Fork 185
/
Copy pathstylelint.config.mjs
108 lines (106 loc) · 3.26 KB
/
stylelint.config.mjs
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
import path from 'node:path';
const config = {
extends: ['stylelint-config-standard', '@vkontakte/stylelint-config'],
plugins: [
'@project-tools/stylelint-plugin-vkui',
'stylelint-media-use-custom-media',
'stylelint-value-no-unknown-custom-properties',
'stylelint-use-logical',
'stylelint-prettier',
],
rules: {
'prettier/prettier': true,
'block-no-empty': null,
'declaration-block-no-redundant-longhand-properties': null,
'comment-empty-line-before': null,
'comment-whitespace-inside': null,
'no-descending-specificity': null,
'no-duplicate-selectors': null,
'value-keyword-case': null,
'selector-class-pattern': null,
'custom-property-pattern': null,
'value-no-vendor-prefix': null,
'property-no-vendor-prefix': null,
'media-feature-range-notation': null, // need 104 chrome
'alpha-value-notation': 'number',
/**
* https://caniuse.com/mdn-css_types_color_hsl_space_separated_parameters
*/
'color-function-notation': 'legacy',
/**
* // In Selectors Level 3, only a single simple selector was allowed as the argument to :not(), whereas Selectors Level 4 allows a selector list.
*/
'selector-not-notation': 'simple',
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['global'],
},
],
'function-no-unknown': [
true,
{
ignoreFunctions: ['constant'],
},
],
'length-zero-no-unit': [
true,
{
ignore: ['custom-properties'],
},
],
'csstools/value-no-unknown-custom-properties': [
true,
{
importFrom: [
path.join(import.meta.dirname, 'packages/vkui/src/styles/constants.css'),
path.join(import.meta.dirname, 'packages/vkui/src/styles/dynamicTokens.css'),
path.join(import.meta.dirname, 'packages/vkui/src/styles/missedThemeTokens.css'),
path.join(
import.meta.dirname,
'node_modules/@vkontakte/vkui-tokens/themes/vkBase/cssVars/declarations/index.css',
),
path.join(import.meta.dirname, 'packages/vkui-docs-theme/styles/constants.css'),
path.join(import.meta.dirname, 'packages/vkui-docs-theme/styles/colors.css'),
],
},
],
'csstools/media-use-custom-media': [
'known',
{
importFrom: path.join(
import.meta.dirname,
'packages/vkui/src/styles/customMedias.generated.css',
),
},
],
'selector-pseudo-class-disallowed-list': ['global'],
'vkui-internal/bad-multiplication': true,
'import-notation': null,
'plugin/vkui': null,
'plugin/selector-bem-pattern': null,
'plugin/logical-shorthands': 'always',
'property-disallowed-list': null,
'csstools/use-logical': 'always',
},
overrides: [
{
files: [
`${path.join(import.meta.dirname, 'website')}/**/*.css`,
`${path.join(import.meta.dirname, 'packages/vkui-docs-theme')}/**/*.css`,
],
rules: {
'csstools/media-use-custom-media': [
'known',
{
importFrom: path.join(
import.meta.dirname,
'packages/vkui/src/styles/customMedias.generated.css',
),
},
],
},
},
],
};
export default config;