Skip to content

Commit

Permalink
fix: Adjust stylelint rules and fix E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilzyla committed Jan 5, 2024
1 parent e4fefc6 commit b59692d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion inst/templates/node/dot.stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"rules": {
"at-rule-no-unknown": null,
"no-empty-source": null,
"scss/at-rule-no-unknown": true
"scss/at-rule-no-unknown": true,
"selector-id-pattern": [
"^([a-z][a-z0-9]*)([-_][a-z0-9]+)*$",
{
"message": "Expected ID selector to be kebab-snake_case"
}
]
}
}
4 changes: 2 additions & 2 deletions tests/e2e/test-lint-sass.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ rhino::lint_sass()

# Create bad scripts and test if formatting returns the expected result
test_scss_path <- fs::path("app", "styles", "bad-style.scss")
cat(".myClass{color: #FFFFFF}", file = test_scss_path)
cat(".my-class{color: #FFFFFF}", file = test_scss_path)
testthat::expect_error(rhino::lint_sass())
rhino::lint_sass(fix = TRUE)
testthat::expect_identical(
readLines(test_scss_path),
".myClass { color: #fff; }"
".my-class { color: #fff; }"
)
# Clean up
file.remove(test_scss_path)

0 comments on commit b59692d

Please sign in to comment.