Commit b34a155
committed
`RuleTester` accepts `filename` as a property of test cases. Previously it passed `filename` directly through to the linter, but that wasn't right - the linter expects it to be passed an absolute path. Instead, convert `filename` to an absolute path, if it isn't one already.
Not using `process.cwd()` as the base of the path, as `RuleTester` is a testing utility, and the results should be deterministic, unaffected by external factors like CWD. Use the root of `oxlint` package as the base instead (a bit arbitrary, but what would be better?).
This is preamble to #17809. This PR is some of the changes from that one split off, so the diff on #17809 is focused just on that one change.
1 parent 3818486 commit b34a155
1 file changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
974 | 975 | | |
975 | 976 | | |
976 | 977 | | |
977 | | - | |
| 978 | + | |
978 | 979 | | |
979 | | - | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
980 | 983 | | |
981 | 984 | | |
982 | 985 | | |
983 | 986 | | |
984 | 987 | | |
985 | 988 | | |
986 | 989 | | |
987 | | - | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
988 | 997 | | |
989 | 998 | | |
990 | 999 | | |
| |||
995 | 1004 | | |
996 | 1005 | | |
997 | 1006 | | |
998 | | - | |
| 1007 | + | |
999 | 1008 | | |
1000 | 1009 | | |
1001 | 1010 | | |
| |||
1007 | 1016 | | |
1008 | 1017 | | |
1009 | 1018 | | |
1010 | | - | |
| 1019 | + | |
1011 | 1020 | | |
1012 | 1021 | | |
1013 | 1022 | | |
| |||
0 commit comments