palantir/grunt-tslint

Cannot read property 'findConfiguration' of undefined Use --force to continue.

Closed this issue · 3 comments

My gruntfile.js is as following and get the warning message " Cannot read property 'findConfiguration' of undefined Use --force to continue."
my code:
`module.exports = function(grunt){

grunt.initConfig({
	tslint:{
		options:{ configuration: "tslint.json"
		,force:false
		,fix:false
	}
		,files:{
			src:["src/**/*.ts"]
		}
	}
});

grunt.loadNpmTasks('grunt-tslint');
grunt.registerTask('default', ['tslint']);

}`

message:
`Running "tslint:files" (tslint) task
Warning: Cannot read property 'findConfiguration' of undefined Use --force to co
ntinue.

Aborted due to warnings.`

I have debugged in the grunt-tslint and found the require('tslint') doesn't return object that has Configuration property, so the code below raise error:
configuration = Linter.Configuration.findConfiguration(configuration, filepath).results;

Could you please give any advice on it?

which versions of grunt-tslint, tslint, and typescript are you using?

nros commented

It seems as if tslintchanged the interface with version 4.x see: palantir/tslint#1720

nros commented

@cao5zy to be clear: I think you are using an old grunt-ts package. I assume the commit 46c5514 has already fixed your issue. Try updating your grunt-ts.