Skip to content

linter: jsPlugin @stylistic/no-multiple-empty-lines false positive in Vue script tag #20896

@drvn-mr

Description

@drvn-mr

What version of Oxlint are you using?

1.58.0

What command did you run?

npx oxlint -c .oxlintrc.json Test.vue

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

{
  "plugins": [
    "vue"
  ],
  "jsPlugins": [
    "@stylistic/eslint-plugin"
  ],
  "env": {
    "browser": true,
    "node": true
  },
  "rules": {
    "@stylistic/no-multiple-empty-lines": [
      "error",
      {
        "max": 1,
        "maxBOF": 0,
        "maxEOF": 0
      }
    ]
  }
}

What happened?

I've uploaded a reproducing repo: https://github.com/drvn-mr/oxlint-test-repo/tree/main/stylistic-empty-lines

<template>
  <div>test</div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const test = ref();


// ok
test.value = 'a';
</script>
npx oxlint -c .oxlintrc.json Test.vue -f stylish

oxlint-test-repo/stylistic-empty-lines/Test.vue
  5:25  error  Too many blank lines at the beginning of file. Max of 0 allowed.  @stylistic(no-multiple-empty-lines)
  10:1  error  More than 1 blank line not allowed.  @stylistic(no-multiple-empty-lines)

✖ 2 problems (2 errors, 0 warnings)

ESLint output:

npx eslint -c eslint.config.mjs Test.vue

oxlint-test-repo/stylistic-empty-lines/Test.vue
   1:1  error  Component name "Test" should always be multi-word  vue/multi-word-component-names
  10:1  error  More than 1 blank line not allowed                 @stylistic/no-multiple-empty-lines

✖ 2 problems (2 errors, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

The beginning of file is interpreted differently when using the @stylistic/eslint-plugin JS plugin but ESLint works as expected.
There should be no error at the end of the <script setup lang="ts"> tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions