Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Error: Cannot find module 'tslint/lib/lint' when trying to extend tslint-microsoft-contrib #315

Closed
shaunluttin opened this issue Nov 22, 2016 · 4 comments
Milestone

Comments

@shaunluttin
Copy link

shaunluttin commented Nov 22, 2016

This is our environment

> \node_modules\.bin\tslint --version
4.0.1

> npm install --save-dev tslint-microsoft-contrib
`-- [email protected]

This is our tslint.json configuration.

{
    "extends": [
        "./node_modules/tslint-microsoft-contrib/tslint.json"
    ]
}

This is what happens when we run our local tslint with that configuration.

> node_modules\.bin\tslint --config .\tslint.json --project .\tsconfig.json
module.js:471
throw err;
^

Error: Cannot find module 'tslint/lib/lint'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\myApp\node_modules\tslint-microsoft-contrib\insecureRandomRule.js:7:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)     

How can we run tslint on a configuration that extends tslint-microsoft-contrib?

See also: https://stackoverflow.com/questions/40749996/error-cannot-find-module-tslint-lib-lint-when-trying-to-extend-tslint-microso

We have done a find-replace of tslint/lib/lint with tslint, which resolves the above error but causes another one:

Error:
            Could not find implementations for the following rules specified in the configuration:
            no-duplicate-key
use-strict
label-undefined
no-constructor-vars
no-unreachable
            Try upgrading TSLint and/or ensuring that you have all necessary custom rules installed.
            If TSLint was recently upgraded, you may have old rules configured which need to be cleaned up.
@Delagen
Copy link

Delagen commented Nov 23, 2016

duplicate #313

@shaunluttin
Copy link
Author

@Delagen Given that doing a a find-replace of tslint/lib/lint with tslint resolves the problem, would this repository welcome a PR that includes that fix?

@HamletDRC
Copy link
Member

@shaunluttin Let's move the discussion to #313

@HamletDRC HamletDRC added this to the None milestone Nov 27, 2016
@HamletDRC
Copy link
Member

closing as duplicate... but thank you for taking the time to submit this bug report, especially with so much detail. This is one of the nicest bug reports I've ever seen!

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

No branches or pull requests

3 participants