Closed mgav closed 4 days ago
We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info. Please provide a minimal reproduction to reopen the issue. Thanks.
@antfu , I don't know what else to provide, in the way of a reproduction. I'm a novice, stuck on this problem for a week. Does @nuxt/eslint-config@0.7.1 export the createConfig or createConfigForNuxt functions, or not? If not, THAT is the problem.
Environment
Package
@nuxt/eslint
Reproduction
// eslint.config.js
import { createConfig } from '@nuxt/eslint-config';
const nuxtConfig = createConfig({ features: { stylistic: true, }, });
// Since createConfig returns an array, we can modify it directly // and add our custom rules to the first configuration object.
nuxtConfig[0] = { ...nuxtConfig[0], ignores: ['node_modules/', '.nuxt/', 'dist/', '.history/'], rules: { ...nuxtConfig[0].rules, // Your custom ESLint rules 'no-restricted-globals': ['error', 'name', 'length'], 'prefer-arrow-callback': 'error', quotes: ['error', 'single', { avoidEscape: true }], semi: ['error', 'always'], 'no-trailing-spaces': 'error', 'eol-last': ['error', 'always'],
}, };
export default nuxtConfig;
/////
packge.json:
{ "name": "insiderbnb", "private": true, "type": "module", "license": "UNLICENSED", "scripts": { "build": "nuxt build", "dev": "nuxt dev", "dev:watch": "./watch-dev.sh", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare", "lint": "eslint .", "format": "prettier --write '/*.{js,vue,json,css,md}'", "lint:fix": "eslint '*/.{js,vue}' --fix", "prepare": "husky install" }, "resolutions": { "path-to-regexp": "^6.2.0", "glob": "^8.0.3", "rimraf": "^5.0.0" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.6.0", "@fortawesome/free-brands-svg-icons": "^6.6.0", "@fortawesome/free-regular-svg-icons": "^6.6.0", "@fortawesome/free-solid-svg-icons": "^6.6.0", "@fortawesome/vue-fontawesome": "^3.0.8", "@googlemaps/js-api-loader": "^1.16.8", "@headlessui/vue": "^1.7.21", "@nuxtjs/dotenv": "^1.4.2", "@pinia/nuxt": "^0.5.4", "@tailwindcss/forms": "^0.5.9", "@tailwindcss/typography": "^0.5.15", "@vercel/nft": "^0.27.4", "axios": "^1.7.7", "date-fns": "^4.1.0", "firebase": "^10.14.1", "lru-cache": "^11.0.2", "nitropack": "^2.9.7", "nuxt": "^3.14.159", "pinia": "^2.2.2", "vue": "^3.4.21", "vue-router": "^4.3.0" }, "lint-staged": { "/*.{js,vue,json,css,md}": [ "prettier --write", "eslint --fix" ] }, "devDependencies": { "@eslint/js": "^9.14.0", "@nuxt/eslint": "^0.7.1", "@nuxt/eslint-config": "^0.7.1", "@nuxtjs/tailwindcss": "^6.12.2", "@types/google.maps": "^3.58.1", "@types/node": "^22.9.0", "@typescript-eslint/eslint-plugin": "^8.15.0", "@typescript-eslint/parser": "^8.15.0", "chokidar-cli": "^3.0.0", "eslint": "^9.15.0", "eslint-config-prettier": "^9.1.0", "eslint-define-config": "^2.1.0", "eslint-plugin-import": "2.28.1", "eslint-plugin-n": "16.0.0", "eslint-plugin-nuxt": "^4.0.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-security": "3.0.1", "eslint-plugin-vue": "^9.31.0", "firebase-tools": "^13.22.0", "firebase-tools-extra": "^1.0.0", "globals": "^15.12.0", "husky": "8.0.3", "lint-staged": "^15.2.10", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.8", "rimraf": "^6.0.1", "tailwindcss": "^3.4.1", "typescript": "~5.5.4", "vite": "^5.4.8", "vite-plugin-eslint": "^1.8.1", "vite-plugin-vue-devtools": "^7.5.4", "vue-eslint-parser": "^9.4.3", "webpack": "^5.0.0" } }
Describe the bug
Errors due to the fact that @nuxt/eslint-config@0.7.1 does not export the createConfig or createConfigForNuxt functions:
Additional context
No response
Logs