Code Monkey home page Code Monkey logo

eslint-plugin-vue-types's People

Contributors

dependabot[bot] avatar dwightjack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mrvasia

eslint-plugin-vue-types's Issues

require-default-prop warns when using vue-types named exports

require-default-prop warns when using shape(), string(), etc. rather than VueTypes.shape, VueTypes.string, etc.

import VueTypes, { shape } from 'vue-types';

const MyComponent = Vue.extend({
  props: {
    data: shape({}).isRequired, // ESLint: Prop 'data' requires default value to be set.(vue-types/require-default-prop)
    data2: VueTypes.shape({}).isRequired, // this is fine
  },
});

Conflict with eslint plugin '@vue/typescript'

First of all: Thanks for the great vue-types plugin!

Using @vue/cli-plugin-eslint 3.0.0-beta.15, I have installed eslint-plugin-vue-types alongside with vue-types and have configured Eslint like this:

  extends: [
    'plugin:vue/essential',
    '@vue/prettier',
    '@vue/typescript',
    'plugin:vue-types/strongly-recommended'
  ],

I get this error:

error: Prop 'href' requires default value to be set (vue-types/require-default-prop) at src/components/_BaseLink.vue:21:5:
  19 | export default Vue.extend({
  20 |   props: {
> 21 |     href: VueTypes.string.def('test')
     |     ^
  22 |   }
  23 | })
  24 | </script>

Once I removed '@vue/typescript' everything is working fine.

So it seems there is a conflict between the two plugins?

custom definition issue

Hi Marco, thanks for the plugin again.
I am implementing a more "strong" linter and i am finding issues with the vue-types plugin.
I have a folder where i store common types and re-use them across the application: now it's kind of an issue with the linter because the linter think i'm missing the prop definition.

the only whitelisting feature doesn't really scale tbh. is there another way to do this without whitelisting all the files I am using?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.