UNPKG
eslint-plugin-path-supervisor
Version:
latest (0.0.4)
0.0.4
0.0.3
0.0.2
0.0.1
Plugin for checking the rules of absolute and relative paths in project
eslint-plugin-path-supervisor
/
lib
/
helpers
/
getCurrentFilePath.js
12 lines
(9 loc)
•
295 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
const
path =
require
(
'path'
);
function
getCurrentFilePath
(
context
) {
const
currentFilePath = context.
getFilename
();
const
normalizedPath = path.
toNamespacedPath
(currentFilePath);
return
normalizedPath.
split
(
'\\'
).
join
(
'/'
); }
module
.
exports
= { getCurrentFilePath }