0.0.8 • Published 1 year ago

eslint-plugin-nuxt-middleware v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

eslint-plugin-nuxt-middleware

Install

npm install -D eslint-plugin-nuxt-middleware
yarn add -D eslint-plugin-nuxt-middleware

Usage

module.exports = {
  plugins: ['nuxt-middleware'],
  rules: {
    'nuxt-middleware/no-unresolved-middleware': 'error',
  },
}

Rules

Rule IDDescription
nuxt/no-unresolved-middlewareChecks for the presence of Nuxt.js middleware.

Rule Details

nuxt/no-unresolved-middleware

This rule outputs an error if a file that does not exist in the middleware directory is specified.

Examples of incorrect code for this rule:

middleware
  └─ middleware-sample.js
// pages/home.vue
<script lang="ts">
export default defineComponent({
  middleware: 'sample', // sample is not found.
});
</script>

Examples of correct code for this rule:

middleware
  └─ middleware-sample.js
// pages/home.vue
<script lang="ts">
export default defineComponent({
  middleware: 'middleware-sample',
});
</script>

Options

srcDir: Define the source directory of your Nuxt application.

{
  "plugins": ["nuxt"],
  "rules": {
    "nuxt/no-unresolved-middleware": [
      "error",
      {
        "srcDir": "src"
      }
    ]
  }
}
0.0.8

1 year ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago