Nuxt.js is my go to framework for static site generation. I was getting a
vue/comment-directive error on bootstrap and wasn't able to get pass this error screen.
First, let's make sure we have all the prerequisites installed.
create-nuxt-app to bootstrap my Nuxt project.
npm i create-nuxt-app
Creating a Nuxt project
Once you have
create-nuxt-app installed, we can create the app by running the
npm init nuxt-app <project-name>
The command creates a project directory with the folder structure necessary to start building a Nuxt app.
Let's start the app.
npm run dev
Fixing the Nuxt vue/comment-directive error
As soon as I saw the error in my terminal, I googled
vue/comment-directive and saw the rule being included in all of the eslint plugins.
The rule allows us to have
eslint-disable functionality in our Vue
<template> . The rule is throwing false positives, and we need to turn it off in our
Adding a custom rule in .eslintrc.js
.eslintrc.js file in your root directory.
We can add a custom rule to turn off
I'm able to rerun the app without the eslint errors.