Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ class TemplateLintConfiguration(project: Project) : JSLinterConfiguration<Templa

override fun loadPrivateSettings(state: TemplateLintState): TemplateLintState {
this.myPackage.readOrDetect()
val constantPackage = myPackage.getPackage().constantPackage
?: throw AssertionError("TemplateLint does not support non-constant node package refs")

return state.copy(
myInterpreterRef = this.myPackage.interpreter,
myTemplateLintPackage = constantPackage
myTemplateLintPackage = this.myPackage.getPackage().constantPackage
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import com.intellij.lang.javascript.linter.JSNpmLinterState

data class TemplateLintState(
private val myInterpreterRef: NodeJsInterpreterRef,
private val myTemplateLintPackage: NodePackage,
private val myTemplateLintPackage: NodePackage?,
val isRunOnSave: Boolean,
) : JSNpmLinterState<TemplateLintState> {

private val myPackageRef: NodePackageRef = NodePackageRef.create(myTemplateLintPackage)
private val myPackageRef: NodePackageRef? = myTemplateLintPackage?.let { NodePackageRef.create(it) }

override fun withLinterPackage(packageRef: NodePackageRef): TemplateLintState {
val constantPackage = packageRef.constantPackage
Expand All @@ -24,12 +24,12 @@ data class TemplateLintState(
}

override fun getNodePackageRef(): NodePackageRef {
return this.myPackageRef
return this.myPackageRef!!
}

val templateLintPackage: NodePackage
get() {
return this.myTemplateLintPackage
return this.myTemplateLintPackage!!
}

companion object {
Expand Down
Loading