Skip to content

Commit fc529e9

Browse files
committed
Replace stylelint-config-airbnb with stylelint-config-twbs-bootstrap
1 parent 29caf82 commit fc529e9

File tree

5 files changed

+87
-1719
lines changed

5 files changed

+87
-1719
lines changed

.stylelintrc.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,15 @@
33
/** @type {Partial<import('stylelint').Configuration>} */
44
const config = {
55
extends: [
6-
// As of 2020/03/18, stylelint-config-airbnb is still at v0.0.0
7-
// Is this future proof?
8-
// https://github.com/airbnb/css/pull/56
9-
'stylelint-config-airbnb',
6+
// /!\ Order matters: the next one overrides rules from the previous one
107

11-
'stylelint-config-recommended-scss'
12-
],
8+
// Includes stylelint-config-recommended-scss and stylelint-config-standard
9+
'stylelint-config-twbs-bootstrap/scss',
1310

14-
rules: {
15-
// Conflicts with Prettier
16-
'string-quotes': null,
17-
'number-leading-zero': null,
11+
'stylelint-prettier/recommended'
12+
],
1813

19-
'rule-empty-line-before': null,
20-
'at-rule-empty-line-before': null,
21-
'scss/at-extend-no-missing-placeholder': null,
22-
'order/order': null
23-
}
14+
rules: {}
2415
};
2516

2617
module.exports = config;

examples/Bootstrap4/bootstrap-spinner.scss

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@
55
display: none;
66
}
77

8-
@function calcInputRightPadding($rightElementWidth) {
8+
@function calc-input-right-padding($right-element-width) {
99
@return calc(
10-
#{$rightElementWidth} - #{$input-border-width} * 2 + #{$input-height-inner-quarter} * 2
10+
#{$right-element-width} - #{$input-border-width} * 2 + #{$input-height-inner-quarter} * 2
1111
);
1212
}
1313

14-
@function calcInputTopMargin($rightElementHeight) {
14+
@function calc-input-top-margin($right-element-width) {
1515
// Fix for IE, https://github.com/postcss/autoprefixer/issues/1153
1616
$input-height-without-calc-for-ie: str-replace($input-height, 'calc');
1717

18-
@return calc((#{$input-height-without-calc-for-ie} + #{$rightElementHeight}) / -2);
18+
@return calc((#{$input-height-without-calc-for-ie} + #{$right-element-width}) / -2);
1919
}
2020

21+
// stylelint-disable selector-no-qualifying-type
22+
2123
input.is-pending {
2224
// Cannot use the same as the validation icons because .spinner-border is too big
23-
padding-right: calcInputRightPadding($spinner-width);
25+
padding-right: calc-input-right-padding($spinner-width);
2426

2527
&.is-pending-sm {
2628
// Same as the validation icons, this is possible because .spinner-border-sm is small enough
@@ -39,11 +41,12 @@ input.is-pending {
3941
// https://github.com/twbs/bootstrap/blob/v4.3.1/scss/mixins/_forms.scss#L62
4042
margin-right: $input-height-inner-quarter;
4143

42-
margin-top: calcInputTopMargin($spinner-height);
44+
// stylelint-disable-next-line order/properties-order
45+
margin-top: calc-input-top-margin($spinner-height);
4346

4447
&.spinner-border-sm,
4548
&.spinner-grow-sm {
46-
margin-top: calcInputTopMargin($spinner-height-sm);
49+
margin-top: calc-input-top-margin($spinner-height-sm);
4750
}
4851
}
4952
}

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@
5353
"npm-run-all": "^4.1.5",
5454
"prettier": "^2.1.2",
5555
"stylelint": "^13.7.2",
56-
"stylelint-config-airbnb": "^0.0.0",
57-
"stylelint-config-recommended-scss": "^4.2.0",
58-
"stylelint-order": "^4.1.0",
59-
"stylelint-scss": "^3.18.0",
56+
"stylelint-config-prettier": "^8.0.2",
57+
"stylelint-config-twbs-bootstrap": "^2.1.0",
58+
"stylelint-prettier": "^1.1.2",
6059
"typescript": "^4.0.3"
6160
}
6261
}

packages/react-form-with-constraints-bootstrap4/scss/bootstrap.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// [.invalid-feedback doesn't show for .input-group with an invalid control](https://github.com/twbs/bootstrap/issues/23454)
33
.valid-feedback,
44
.invalid-feedback {
5+
// stylelint-disable-next-line declaration-no-important
56
display: block !important; // [Is there an opposite to display:none?](https://stackoverflow.com/a/37289654/990356)
67
}
78

0 commit comments

Comments
 (0)