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
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
@@ -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,
@@ -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: [
{
186 changes: 40 additions & 146 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -31,5 +31,8 @@
"engines": {
"node": "^20.0.0",
"npm": "^10.0.0"
},
"dependencies": {
"stylelint-use-logical": "^2.1.2"
}
}