Skip to content

Commit

Permalink
Fix partial-no-import message to include more accurate rule name (#…
Browse files Browse the repository at this point in the history
…1019)

By this change, the rule message will be properly associated with the rule name. See the examples below:

Before:

```sh-session
$ echo '@import "file.scss"' | npx stylelint

<input css ZECpLj>
       ✖  The 'partial-no-import' rule won't work if linting in a code string without an actual file

✖ 1 problem (1 error, 0 warnings)
```

After:

```sh-session
$ echo '@import "file.scss"' | npx stylelint

<input css PE6AAM>
  1:2  ✖  This rule won't work if linting in a code string without an actual file  scss/partial-no-import

✖ 1 problem (1 error, 0 warnings)
```

In addition, this change updates `jest-preset-stylelint` to use `testRule()` instead of `postcss`.
Because `testRule()` is closer to the actual use of `stylelint` and easier to avoid any potential troubles.
See https://github.com/stylelint/jest-preset-stylelint/releases/tag/7.1.0
  • Loading branch information
ybiquitous authored Jul 8, 2024
1 parent ebc9893 commit c1aa465
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 326 deletions.
15 changes: 8 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"github-contributors-list": "^1.2.5",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-preset-stylelint": "^7.0.1",
"jest-preset-stylelint": "^7.1.0",
"lint-staged": "^14.0.1",
"np": "^10.0.6",
"postcss": "^8.4.39",
Expand Down
Loading

0 comments on commit c1aa465

Please sign in to comment.