Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add csstools/use-logical for warning about LTR-RTL properties #121

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'stylelint-config-recommended-vue/scss'
],
ignoreFiles: ['**/*.js', '**/*.ts', '**/*.svg'],
plugins: ['stylelint-use-logical'],
rules: {
// Stylistic rules conflicting with prettier
'scss/operator-no-newline-after': null,
Expand Down Expand Up @@ -43,6 +44,31 @@ module.exports = {
ignorePseudoElements: ['deep'],
},
],

// Logical properties
'csstools/use-logical': [
'always',
{
// TODO: make it an error later?
severity: 'warning',
// Only lint LTR-RTL properties for now
except: [
// Position properties
'top',
'bottom',
// Position properties with directional suffixes
/-top$/,
/-bottom$/,
// Size properties
'width',
'max-width',
'min-width',
'height',
'max-height',
'min-height',
],
},
],
},
overrides: [
{
Expand Down
Loading
Loading