I just created a new Vue application by runningnpm init vue@latest
as specified in the official documentation. I then tried to add Tailwind to my application following the guides on the Vue and Vite websites. However, when opening the filetailwind.config.js
, I noticed that ESLint tells me thatmodule
is undefined and themodule.exports
syntax does not work.
why is that? How can I solve it?
Edit: The default.eslintrc.cjs
file created by Vue is as follows:
/* eslint-env node */ require("@rushstack/eslint-patch/modern-module-resolution"); module.exports = { root: true, extends: [ "plugin:vue/vue3-essential", "eslint:recommended", "@vue/eslint-config-prettier", ], parserOptions: { ecmaVersion: "latest", }, };
Consider using
.eslintrc.cjs
and set the
compilerOptions.types: ["node"]
TS option only for these files.It might look like this:
.eslintrc.cjs
tsconfig.config.json
Add it to
.eslintrc.cjs
So your file looks like
You can add anyof thesevalues