forked from ag-grid/ag-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.stylelintrc.js
More file actions
62 lines (62 loc) · 2.32 KB
/
.stylelintrc.js
File metadata and controls
62 lines (62 loc) · 2.32 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
module.exports = {
extends: 'stylelint-config-standard',
plugins: ['./plugins/stylelint-plugin-ag/index.mjs'],
rules: {
'comment-empty-line-before': [
'always',
{
except: ['first-nested'],
ignoreComments: ['/rtl:.*/'],
},
],
// NOTE: the intention here is that all our CSS rules have a single
// class name in the selector that identifies the component. Whenever
// we need to target "the instance of a child component inside a parent"
// use `:where(.ag-parent) .ag-child` to reduce the specificity.
//
// We allow state selectors like :focus and .ag-disabled on top of this,
// because we want them to be slightly more specific. If for example a
// component .ag-foo has a default color and a focus color, we want
// `.ag-foo { color: black }` to set the default colour without also
// removing the focus effect.
'selector-max-specificity': [
'0,1,0',
{
// add selectors here only if they refer to states, rather than components
ignoreSelectors: [
'/^:/',
'[disabled]',
':not(:disabled)',
'[readonly]',
'.ag-animating',
'.ag-disabled',
'.ag-selected',
'.ag-not-selected',
'.ag-checked',
'.ag-cell-inline-editing',
'.ag-row-hover',
'.ag-row-selected',
'.ag-picker-has-focus',
'.ag-sticky-label',
'.ag-header-cell-wrap-text',
'.ag-tab-selected',
'.ag-column-select-column-readonly',
'.ag-column-select-column-group-readonly',
'.ag-active-item',
'.ag-layout-print',
'.ag-layout-normal',
'.ag-layout-auto-height',
'.ag-tool-panel-animating',
],
},
],
},
overrides: [
{
files: ['packages/**/*.css'],
rules: {
'ag/no-low-performance-key-selector': true,
},
},
],
};