Skip to content

Commit

Permalink
Introduce @stylistic/stylelint-plugin to watch over stylistic rules…
Browse files Browse the repository at this point in the history
… removed in Stylelint 16
  • Loading branch information
adamkudrna committed Jul 29, 2024
1 parent b750460 commit 59ad5dc
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 2 deletions.
53 changes: 53 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@babel/preset-env": "^7.22.14",
"@babel/preset-react": "^7.22.5",
"@babel/register": "^7.22.5",
"@stylistic/stylelint-config": "^1.0.1",
"@svgr/webpack": "^8.1.0",
"@testing-library/jest-dom": "^6.1.2",
"@testing-library/react": "^14.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Grid/_settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ $grid-responsive-properties: [
align-items,
justify-content,
justify-items,
]; // stylelint-disable-line indentation -- Broken rule?
]; // stylelint-disable-line @stylistic/indentation -- Broken rule?

$grid-span-responsive-properties: [
column-span,
row-span,
]; // stylelint-disable-line indentation -- Broken rule?
]; // stylelint-disable-line @stylistic/indentation -- Broken rule?

$initial-fallback-value: initial;
8 changes: 8 additions & 0 deletions stylelint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ module.exports = {
'@visionappscz/stylelint-config/order',
'@visionappscz/stylelint-config/scss',
'@visionappscz/stylelint-config/cssModules',
'@stylistic/stylelint-config',
],
rules: {
// Allow @else and @elseif to be on the same line as the closing brace of the @if block.
'@stylistic/block-closing-brace-newline-after': 'always-single-line',

// Use 4 spaces for indentation.
'@stylistic/indentation': 4,

// Check that custom property name starts with `rui` prefix and follows either SUIT CSS convention
// (for components theming) or kebab-case syntax (for global design tokens and local properties).
//
Expand All @@ -20,6 +27,7 @@ module.exports = {
message: 'Expected custom property name to start with `rui-*` and follow either SUIT CSS or kebab-case syntax',
},
],

// Require camelCase pattern for class names as they are picked up by dot notation in JS.
// Also allow kebab-case class names for global helper and utility classes.
//
Expand Down

0 comments on commit 59ad5dc

Please sign in to comment.