npm

Need private packages and team management tools?Check out npm Orgs. »

eslint-plugin-gridsome

1.2.8 • Public • Published

ESLint plugin for Gridsome

eslint-plugin-gridsome

This is ESlint plugin for Gridsome.



usage

$ yarn add eslint eslint-plugin-gridsome vue-eslint-parser -D

Tip: 👩‍🚀

There is a reason to install vue-eslint-parser. eslint-plugin-gridsome has been using vue-eslint-parser over the ^6.0.4 version. If you want to use other eslint plugin package, be careful vue-eslint-parser's version.

// .eslintrc.*
// this sample is .eslintrc.js
 
module.exports = {
  parser: "vue-eslint-parser",
  parserOptions: {
    ecmaVersion: 2018,
    sourceType: "module",
    ecmaFeatures: {
      jsx: true
    }
  },
  env: {
    browser: true,
    es6: true
  },
  plugins: ["gridsome"],
  rules: {
    "gridsome/format-query-block": "error"
    ...
  },
};

or

$ yarn add eslint eslint-plugin-gridsome -D
module.exports = {
  plugins: ["gridsome"],
  extends: ["plugin:gridsome/recommended"]
};

If you want to use eslint-config-prettier, you set that before gridsome configs.

module.exports = {
  plugins: ["gridsome"],
  extends: ["prettier", "plugin:gridsome/recommended"]
};

configs

contributing

Check CONTRIBUTING.md.

Rules

Rule Name Description
format-query-block Format fix for <page-query> and <static-query> in .vue. Using Prettier API
require-g-image-src Require v-bind:src or src of <g-image> elements
require-g-link-to Require v-bind:to or to of <g-link> elements

install

npm i eslint-plugin-gridsome

Downloadsweekly downloads

303

version

1.2.8

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability