Skip to content
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

eslint warns about "unsafe any" in default shim when formatting #6021

Open
jeneser opened this issue Oct 28, 2020 · 0 comments
Open

eslint warns about "unsafe any" in default shim when formatting #6021

jeneser opened this issue Oct 28, 2020 · 0 comments
Labels

Comments

@jeneser
Copy link
Contributor

jeneser commented Oct 28, 2020

Version

4.5.8

Reproduction link

https://github.com/jeneser/vue-cli-prettier-issue

Environment info

Environment Info:

  System:
    OS: Linux 4.14 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (16) x64 Intel(R) Xeon(R) CPU @ 2.20GHz
  Binaries:
    Node: 12.19.0 - ~/.nvm/versions/node/v12.19.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v12.19.0/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v12.19.0/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1 
    @vue/babel-helper-vue-transform-on:  1.0.0-rc.2 
    @vue/babel-plugin-jsx:  1.0.0-rc.3 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  4.5.8 
    @vue/babel-preset-jsx:  1.2.4 
    @vue/babel-sugar-composition-api-inject-h:  1.2.1 
    @vue/babel-sugar-composition-api-render-instance:  1.2.4 
    @vue/babel-sugar-functional-vue:  1.2.2 
    @vue/babel-sugar-inject-h:  1.2.2 
    @vue/babel-sugar-v-model:  1.2.3 
    @vue/babel-sugar-v-on:  1.2.3 
    @vue/cli:  4.5.8 
    @vue/cli-overlay:  4.5.8 
    @vue/cli-plugin-babel:  4.5.8 
    @vue/cli-plugin-eslint:  4.5.8 
    @vue/cli-plugin-router:  4.5.8 
    @vue/cli-plugin-vuex:  4.5.8 
    @vue/cli-service:  4.5.8 
    @vue/cli-service-global:  4.5.8 
    @vue/cli-shared-utils:  4.5.8 
    @vue/cli-ui:  4.5.8 
    @vue/cli-ui-addon-webpack:  4.5.8 
    @vue/cli-ui-addon-widgets:  4.5.8 
    @vue/compiler-core:  3.0.2 
    @vue/compiler-dom:  3.0.2 
    @vue/compiler-sfc:  3.0.2 
    @vue/compiler-ssr:  3.0.2 
    @vue/component-compiler-utils:  3.2.0 
    @vue/preload-webpack-plugin:  1.1.2 
    @vue/reactivity:  3.0.2 
    @vue/runtime-core:  3.0.2 
    @vue/runtime-dom:  3.0.2 
    @vue/shared:  3.0.2 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue:  5.2.3 
    typescript:  3.9.7 
    vue:  2.6.12 (3.0.2)
    vue-cli-plugin-apollo:  0.21.3 
    vue-codemod:  0.0.4 
    vue-eslint-parser:  5.0.0 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  15.9.4 (16.0.0-beta.9)
    vue-style-loader:  4.1.2 
    vue-template-compiler:  2.6.12 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. Create a new project selecting TypeScript and Prettier.
  2. Run: yarn run lint

What is expected?

Formatting without any failures.

What is actually happening?

warning: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any) at src/shims-vue.d.ts:3:44:
  1 | declare module "*.vue" {
  2 |   import type { DefineComponent } from "vue";
> 3 |   const component: DefineComponent<{}, {}, any>;
    |                                            ^
  4 |   export default component;
  5 | }
  6 | 

We should pretty much never have to use any, as never and unknown should be able to cover.

@LinusBorg LinusBorg changed the title Prettier gives error when using unsafe any eslint gives error when using unsafe any Oct 28, 2020
@LinusBorg LinusBorg changed the title eslint gives error when using unsafe any eslint warns about "unsafe any" in default shim when formatting Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants