Skip to content

bug: An import declaration can only be used at the top level of a module #1137

@cn2156

Description

@cn2156

In 1.65, ESLint find problems "An import declaration can only be used at the top level of a module."
but in 1.64.2, ESLint not found any problems

The code is:

import { useRouter } from "vue-router";
const router = useRouter();

import OtherView from './OtherView.vue'

ESLint
v2.2.2
Released on
2015/11/16 19:58:32
Last updated
2022/1/13 17:49:56
Identifier
dbaeumer.vscode-eslint

Version: 1.65.0 (Universal)
Commit: b5205cc8eb4fbaa726835538cd82372cc0222d43
Date: 2022-03-02T11:11:20.886Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 21.3.0

Version: 1.64.2 (Universal)
Commit: f80445acd5a3dadef24aa209168452a3d97cc326
Date: 2022-02-09T22:00:58.347Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 21.3.0

Please clone the project: https://github.com/cn2156/vue3-for-test-eslint, then read the README.md to show the details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions