Skip to content

Non-TS language block in SFC is being linted #2739

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

Closed
2 tasks done
ofekd opened this issue Apr 30, 2025 · 1 comment
Closed
2 tasks done

Non-TS language block in SFC is being linted #2739

ofekd opened this issue Apr 30, 2025 · 1 comment

Comments

@ofekd
Copy link

ofekd commented Apr 30, 2025

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 9.22.0
  • eslint-plugin-vue version: 10.1.0
  • Vue version: 3.5.13
  • Node version: 23.11
  • Operating System: macOS

Please show your full configuration:

import { globalIgnores } from 'eslint/config'
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import pluginVue from 'eslint-plugin-vue'
import pluginVitest from '@vitest/eslint-plugin'
import pluginPlaywright from 'eslint-plugin-playwright'
import pluginOxlint from 'eslint-plugin-oxlint'
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'

// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
// import { configureVueProject } from '@vue/eslint-config-typescript'
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup

export default defineConfigWithVueTs(
  {
    name: 'app/files-to-lint',
    files: ['**/*.{ts,mts,tsx,vue}'],
  },

  globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),

  pluginVue.configs['flat/essential'],
  vueTsConfigs.recommended,
  
  {
    ...pluginVitest.configs.recommended,
    files: ['src/**/__tests__/*'],
  },
  
  {
    ...pluginPlaywright.configs['flat/recommended'],
    files: ['e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'],
  },
  ...pluginOxlint.configs['flat/recommended'],
  skipFormatting,
)

What did you do?

<script lang="gleam">
import gleam/io

pub fn hello () {
 io.debug("hello")
}
</script>

<template>
  <main>
    <TheWelcome />
  </main>
</template>

What did you expect to happen?

Script block with lang="gleam" should have been skipped

What actually happened?

Block was not skipped, and eslint ran into a parsing error

Repository to reproduce this issue
You can paste the code above into any pnpm create vue app. Let me know if you need a repo

@ota-meshi
Copy link
Member

I don't use gleam and you don't provide a reproducible repo so I can't try it, but I think you can change the parser configuration.
See the documentation:

https://github.com/vuejs/vue-eslint-parser/blob/master/README.md#parseroptionsparser

@ota-meshi ota-meshi closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2025
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

2 participants