-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
extensions
/no-cycle
/no-extraneous-dependencies
: Correct m…
…odule real path resolution add real support of isAbsolute (windows + unix support) importType refactoring: use the real resolved package path to check if external of internal, and not the name only like before: in case of monorepo, external modules are not under node_modules due to symlink but still out of the module. correct tests node_modules dependencies to really provide teh package.json like in real usage correct no-extraneous-dependencies rule: get the real name from the resolved package.json. If not aliased imports (alias/react for example) will not be correctly interpreted change path import add real support of isAbsolute (windows + unix support) correct no-extraneous-dependencies rule: get the real name from the resolved package.json. If not aliased imports (alias/react for example) will not be correctly interpreted even externals like "a/file.js" must not use extension. only module names like 'module.js' and '@scope/module.js' are allowed correct bad external definition: must be the folder path under the root of the module. Here the module root is test folder, not cycles folder
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { dirname } from 'path'; | ||
import findUp from 'find-up'; | ||
import readPkgUp from 'read-pkg-up'; | ||
|
||
|
||
export function getContextPackagePath(context) { | ||
return getFilePackagePath(context.getFilename()); | ||
} | ||
|
||
export function getFilePackagePath(filePath) { | ||
const fp = findUp.sync('package.json', { cwd: filePath }); | ||
return dirname(fp); | ||
} | ||
|
||
export function getFilePackageName(filePath) { | ||
const { pkg } = readPkgUp.sync({ cwd: filePath, normalize: false }); | ||
return pkg && pkg.name; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.