(
node: t.Node,
filename: string,
isJSX = false,
)
| 234 | `${filePath}:${line}:${column}` |
| 235 | |
| 236 | function getNodeLocationAttribute( |
| 237 | node: t.Node, |
| 238 | filename: string, |
| 239 | isJSX = false, |
| 240 | ): string | undefined { |
| 241 | if (node.loc) { |
| 242 | return getLocationAttribute( |
| 243 | path.relative(process.cwd(), filename), |
| 244 | node.loc.start.line, |
| 245 | // 2 is added to place the caret after the "<" character |
| 246 | node.loc.start.column + (isJSX ? 2 : 0), |
| 247 | ) |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | export type JsxLocationPluginConfig = { |
| 252 | jsx: boolean |
no test coverage detected
searching dependent graphs…