Files
meteor/lib/util/meta/getRelativePath.js
Dominik Ferber bbf9f22109 refactor(): Determine env only once per file
Also fixes a bug in audit-argument-checks where it would show errors in non-meteor blocks.

BREAKING CHANGE: Envs specified through comments are now restricted to client and server.
2015-10-17 23:28:42 +02:00

17 lines
389 B
JavaScript

import stripPathPrefix from './stripPathPrefix'
const getRootPath = require('./getRootPath')
export default function (filename) {
// '<input>' is ESLint's default filename when the real one is not known
if (filename === '<input>') {
return false
}
const rootPath = getRootPath(filename)
if (!rootPath) {
return false
}
return stripPathPrefix(rootPath, filename)
}