File tree Expand file tree Collapse file tree 6 files changed +35
-8
lines changed
src/main/kotlin/com/emberjs/hbs/linter/ember-template-lint Expand file tree Collapse file tree 6 files changed +35
-8
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
33
4+ ## v2024.3.7 (2025-03-21)
5+
6+ #### :bug : Bug Fix
7+ * [ #225 ] ( https://github.com/patricklx/intellij-emberjs-experimental/pull/225 ) limit ember template lint processing to correct files ([ @patricklx ] ( https://github.com/patricklx ) )
8+
9+ #### :house : Internal
10+ * [ #208 ] ( https://github.com/patricklx/intellij-emberjs-experimental/pull/208 ) Delete GlintStatusBarWidget ([ @alexander-doroshko ] ( https://github.com/alexander-doroshko ) )
11+
12+ #### Committers: 2
13+ - Alexander Doroshko ([ @alexander-doroshko ] ( https://github.com/alexander-doroshko ) )
14+ - Patrick Pircher ([ @patricklx ] ( https://github.com/patricklx ) )
15+
16+
417
518
619
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ plugins {
2222
2323
2424group = " com.emberjs"
25- version = " 2024.3.6 "
25+ version = " 2024.3.7 "
2626
2727dependencies {
2828 testImplementation(" org.jetbrains.kotlin:kotlin-test" )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class TemplateLintConfiguration(project: Project) : JSLinterConfiguration<Templa
2424
2525 return state.copy(
2626 myInterpreterRef = this .myPackage.interpreter,
27- myTemplateLintPackage = constantPackage
27+ myTemplateLintPackage = this .myPackage.getPackage(). constantPackage
2828 )
2929 }
3030
Original file line number Diff line number Diff line change @@ -32,7 +32,14 @@ class TemplateLintExternalAnnotator(onTheFly: Boolean = true) : JSLinterExternal
3232
3333 override fun acceptPsiFile (file : PsiFile ): Boolean {
3434 val f = file
35- return f.viewProvider is GtsFileViewProvider || f.viewProvider is HbFileViewProvider || file is JSFile
35+ val pkg = TemplateLintConfiguration .getInstance(file.project).extendedState.state.templateLintPackage
36+ val supportsJS = pkg.version?.let { it.major < 8 } ? : false
37+ return (f.name.endsWith(" .hbs" )
38+ || (f.name.endsWith(" .js" ) && supportsJS)
39+ || (f.name.endsWith(" .ts" ) && supportsJS)
40+ || f.name.endsWith(" .gjs" )
41+ || f.name.endsWith(" .gts" ))
42+ && ! f.name.endsWith(" .d.ts" )
3643 }
3744
3845 override fun annotate (input : JSLinterInput <TemplateLintState >): JSLinterAnnotationResult ? {
Original file line number Diff line number Diff line change @@ -60,8 +60,15 @@ class TemplateLintFixAction : JSLinterFixAction(
6060 }
6161
6262 override fun isFileAccepted (project : Project , file : VirtualFile ): Boolean {
63- val f = PsiManager .getInstance(project).findFile(file)
64- return f?.viewProvider is GtsFileViewProvider || f?.viewProvider is HbFileViewProvider || f is JSFile
63+ val f = PsiManager .getInstance(project).findFile(file) ? : return false
64+ val pkg = TemplateLintConfiguration .getInstance(project).extendedState.state.templateLintPackage
65+ val supportsJS = pkg.version?.let { it.major < 8 } ? : false
66+ return (f.name.endsWith(" .hbs" )
67+ || (f.name.endsWith(" .js" ) && supportsJS)
68+ || (f.name.endsWith(" .ts" ) && supportsJS)
69+ || f.name.endsWith(" .gjs" )
70+ || f.name.endsWith(" .gts" ))
71+ && ! f.name.endsWith(" .d.ts" )
6572 }
6673
6774 private fun fixFile (psiFile : PsiFile ) {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import com.intellij.lang.javascript.linter.JSNpmLinterState
66
77data class TemplateLintState (
88 private val myInterpreterRef : NodeJsInterpreterRef ,
9- private val myTemplateLintPackage : NodePackage ,
9+ private val myTemplateLintPackage : NodePackage ? ,
1010 val isRunOnSave : Boolean ,
1111) : JSNpmLinterState<TemplateLintState> {
1212
@@ -23,12 +23,12 @@ data class TemplateLintState(
2323 }
2424
2525 override fun getNodePackageRef (): NodePackageRef {
26- return this .myPackageRef
26+ return this .myPackageRef!!
2727 }
2828
2929 val templateLintPackage: NodePackage
3030 get() {
31- return this .myTemplateLintPackage
31+ return this .myTemplateLintPackage!!
3232 }
3333
3434 companion object {
You can’t perform that action at this time.
0 commit comments