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

pug templates not getting lint #310

Closed
metaory opened this issue Dec 30, 2017 · 8 comments
Closed

pug templates not getting lint #310

metaory opened this issue Dec 30, 2017 · 8 comments
Labels

Comments

@metaory
Copy link

metaory commented Dec 30, 2017

  • ESLint Version: 4.14.0
  • eslint-plugin-vue Version: 4.0.0-beta.4
  • Node Version: 9.2.0
module.exports = {
  root: true,
  parserOptions: {
    'parser': 'babel-eslint',
    'ecmaVersion': 2017,
    'ecmaFeatures': {
      'experimentalObjectRestSpread': true
    },
    'sourceType': 'module'
  },
  env: {
    browser: true,
    es6: true
  },
  'extends': [
    'google',
    'plugin:vue/recommended'
  ],
  plugins: [ ],
  settings: {
    'import/resolver': {
      webpack: {
        config: 'build/webpack.base.conf.js'
      }
    }
  },
  globals: {    'Vue': true  },
  rules: {  }
}

none of rules getting checked on pug templates

<template lang="pug">
  div
    ol(v-for="i in 5")
      li foobar
</template>

it works fine on html templates

<template>
  <div>
    <ol v-for="i in 5">
      <li>item</li>
    </ol>
  </div>
</template>

pug templates not getting lint

@mysticatea
Copy link
Member

Thank you for the report.

Unfortunately, this plugin has not supported pug yet.
I have a plan to lint pug in future, but it's not soon.

@maksnester
Copy link

Hello, just wondering if there are any plans for pug support?

@rossity
Copy link

rossity commented Jun 29, 2018

@mysticatea @michalsnik can we get an update on your plans for pug support? it's a sorely needed feature!

@LeCoupa
Copy link

LeCoupa commented Jul 14, 2018

Any plans for pug support?

@michalsnik
Copy link
Member

No plans so far here. Please fire an issue in vue-eslint-parser - once it supports PUG we'll be able to support it too.

@Shinigami92
Copy link
Contributor

Author of https://github.com/prettier/plugin-pug here.

Please watch/star https://github.com/Shinigami92/eslint-plugin-vue-pug-sfc
I will try to tackle eslint vue pug support in next time

@Shinigami92
Copy link
Contributor

Shinigami92 commented Sep 16, 2021

https://www.npmjs.com/package/eslint-plugin-vue-pug-sfc/v/1.0.0-alpha.2 👀

This is a first alpha and "supports" vue-pug-sfc/this-in-template for the never option. always is currently NOT supported due to it is much harder to implement.

Please give it a try and please also start to create issues in the repo for every rule you want to get support for!
Please do NOT use the --fix option right know (or at least with a backup), cause it can damage your code!
The ranges are not accurate yet so the ~~~~ lines are positioned to broad right now.

Please also feel free to jump into the code and help me 😃
If you use VSCode jump into the Debug Launcher and run the tests with debug-breakpoints.


Please note, if you consider this plugin as helpful, that I'm open to receive money via GitHub sponsoring. I would really appreciate it.


I will not spam here anymore, so please lets move all discussions to the project's repo.

@rashfael
Copy link

Pug support has been added via eslint-plugin-vue-pug, which adds a template tokenizer to vue-eslint-parser, making a lot of rules of eslint-plugin-vue just work.
For full rule compat see this table.
Please try it out on your real world projects and see if you can find some bugs!

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

8 participants