Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn clean breaks tslint due to /lib/test/ folder required for tslint to work #2331

Closed
renzska opened this issue Dec 22, 2016 · 4 comments
Closed

Comments

@renzska
Copy link

renzska commented Dec 22, 2016

This has been mentioned before, but they just keep getting closed. yarn clean is a great feature, but it breaks for tslint (others may also break) because it has src files in the /lib/test/ folder. This is a request to ignore any files in the /src/test or /lib/test or any combination of /"source files folder"/test".

Do you want to request a feature or report a bug?
bug

What is the current behavior?
yarn clean removes necessary files for tslint to work if 'yarn clean' has been used

If the current behavior is a bug, please provide the steps to reproduce.
did:

yarn init
yarn add typescript tslint
yarn clean
tslint

Fails with:

module.js:457
    throw err;
    ^

Error: Cannot find module './test/parse'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/reflog/Rafael/yarn_problem_2/node_modules/tslint/lib/test.js:10:13)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

tslint requires the /tslint/lib/test/ folder to run correctly. Can we get clean to ignore anything under src or lib that has 'test' in it whether it's a folder or a file and any files under a /lib/test/ or /src/test/folder. In this case, it breaks tslint.

What is the expected behavior?
yarn clean to not break tslint.

Please mention your node.js, yarn and operating system version.
node 7.2.1, yarn 0.18.1, Mac OS Sierra 10.12.2

darscan added a commit to snyk/cli that referenced this issue Jan 11, 2017
Many tools treat directories named 'test' as test directories and give them special treatment. Our lib/test directory is not a test directory - it holds code for 'snyk test'.

'yarn clean' is a prime example as it removes all directories named 'test' from a project's node_modules.

See: yarnpkg/yarn#2331
See: https://github.com/Snyk/snyk/issues/64
@ckuyehar
Copy link

something needs to be done to alleviate this error. yarn clean shouldn't break tslint.

tslint issue on yarn - palantir/tslint#1770

@anitsh
Copy link

anitsh commented Jul 16, 2017

Any update on the issue?

@sebmck
Copy link
Contributor

sebmck commented Jul 18, 2017

You can fix this by removing the test line from your .yarnclean file.

@sebmck sebmck closed this as completed Jul 18, 2017
@rally25rs
Copy link
Contributor

The docs also state

Unless you are experiencing issues with the amount of files that are installed as part of node_modules it is not recommended to use this command. It uses a heuristic to identify files that may not be needed from a distributed package and may not be entirely safe.

If the command breaks things, just don't run it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants