GithubHelp home page GithubHelp logo

Nuxt 3 globals reporting errors about eslint HOT 5 CLOSED

nuxt avatar nuxt commented on September 26, 2024 6
Nuxt 3 globals reporting errors

from eslint.

Comments (5)

sigtm avatar sigtm commented on September 26, 2024 13

I'm also confused by this. In the readme, it says to install @nuxt/eslint-config, and then under "Usage" it says to install @nuxtjs/eslint-config instead...?

From digging around I saw that the latter is the legacy package. Although the new one is better, it doesn't pick up no-undefย errors at all in .vue files on my end. Am I doing it wrong?

const foo = thisDoesntExist();

๐Ÿ‘† I was hoping to find a way for ESLint to still pick that one up, while allowing auto-imported stuff like composables.

from eslint.

gregmulvaney avatar gregmulvaney commented on September 26, 2024 1

Nuxt 3 needs @nuxtjs/eslint-config-typescript for magic functions to resolve in ESlint.

from eslint.

edumudu avatar edumudu commented on September 26, 2024 1

I will describe what I got from this trip that can maybe help someone.

This one is the go-to for nuxt 3 and works for typescript also, but seems to be incomplete
@nuxt/eslint-config

Those two are legacy ones
@nuxtjs/eslint-config
@nuxtjs/eslint-config-typescript

For typescript conflict with no-undef you don't even need this package, you just need to disable 'no-undef' rule since this will be handled by the ts itself.

For js I don't tested but maybe this line was supposed to do the trick https://github.com/nuxt/eslint-config/blob/84202f317657eb1dae8e287d74708c4fc4240e28/packages/eslint-config/index.js#L1 but I am not shure.

Also if you are extending some other config after this one, maybe the other config is conflicting and making it not work, for example if you are extending eslint-config-airbnb-base after this one.

And since the @nuxt/eslint-config also extends some others configs https://github.com/nuxt/eslint-config/blob/84202f317657eb1dae8e287d74708c4fc4240e28/packages/eslint-config/index.js#L22, putting this one in the end of your extend array may override your previous configs and since the @nuxt/eslint-config does not add any new rule, you may be better only copy pasting some configs from the file referenced above and pasting in your config, this was the best for me

from eslint.

Dodje avatar Dodje commented on September 26, 2024

Also if you are extending some other config after this one, maybe the other config is conflicting and making it not work, for example if you are extending eslint-config-airbnb-base after this one.

Yeah, airbnb-base really does conflict with nuxt config...

from eslint.

Revadike avatar Revadike commented on September 26, 2024

Dupe of #309

from eslint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.