tackbox 0.1.80 → 0.1.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,8 +115,10 @@ function validateDeclarations(decls) {
115
115
  // line: null (location-unknown) - the caller over-reports, never drops it.
116
116
  function emitMachine(results) {
117
117
  for (const r of results) {
118
- // The contract path is POSIX; path.relative yields `\` on Windows.
119
- const file = path.relative(process.cwd(), r.filePath).replace(/\\/g, '/')
118
+ // The contract path is POSIX; path.relative yields `\` on Windows. Split on
119
+ // the platform separator, never a blanket replace: off Windows a `\` in a
120
+ // name is part of the name and rewriting it misfiles the finding.
121
+ const file = path.relative(process.cwd(), r.filePath).split(path.sep).join('/')
120
122
  for (const m of r.messages) {
121
123
  if (m.severity !== 2) continue
122
124
  process.stdout.write(JSON.stringify({ file, line: m.line ?? null, rule: m.ruleId, message: m.message }) + '\n')
@@ -159,9 +159,11 @@ function declaredReporters(context) {
159
159
  }
160
160
 
161
161
  // Declarations are POSIX; path.relative hands back `\` on Windows, and a key
162
- // that keeps it stops matching its own declaration.
162
+ // that keeps it stops matching its own declaration. Only the platform separator
163
+ // is rewritten - off Windows `\` is a legal file name character, and replacing
164
+ // it would invent a key that never matches git's own spelling.
163
165
  function toPosix(p) {
164
- return p.replace(/\\/g, '/')
166
+ return p.split(path.sep).join('/')
165
167
  }
166
168
 
167
169
  function relFile(context) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tackbox",
3
- "version": "0.1.80",
3
+ "version": "0.1.82",
4
4
  "description": "ESLint and Markdown lint plugins plus direct error-reporting helpers for JavaScript and TypeScript.",
5
5
  "license": "MIT",
6
6
  "main": "./js/eslint-plugin.js",