Coder Social home page Coder Social logo

Comments (6)

wesbos avatar wesbos commented on May 20, 2024

So it turns out, now that npm installs things as flat as possible - ie the package will be in $projectRoot/node_modules/eslint-plugin-html, most configs will "just work" with plugins and configs installed.

This is not guaranteed though. A great solution from @kentcdodds is to use bundleDependencies

https://twitter.com/kentcdodds/status/1605938112701419520

from eslint-config-wesbos.

wesbos avatar wesbos commented on May 20, 2024

The other option here, is in npm 8+, peerDeps are installed in node_modules, but flat. So I could just remove the peerDep install step entirely and go on with life.

https://twitter.com/remcohaszing/status/1605948345834508289

npm 7 was last shipped with Node.js 16.7.0, so probably a bit early for this

Also yarn 1, doesnt do this either.

from eslint-config-wesbos.

wesbos avatar wesbos commented on May 20, 2024

The bundleDependencies solution does not work because it puts the plugins in node_modules/eslint-config-wesbos/node_modules/*

ESLint requires plugins to be resolved from the root as proejct/node_modules/plugin-name. This is not true for parsers, like this;

Another option is to use the new Eslint config files:

https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new

from eslint-config-wesbos.

wesbos avatar wesbos commented on May 20, 2024

SCrapping everything. The new eslint config worked great, but I'm not ready to release that to the wild and it's experimental.

Turns out Im not the only purpose with this issue - many people one twitter said to just install and require('@rushstack/eslint-patch/modern-module-resolution'); at the top of your eslint file.

That fixes everything - I can now deploy a single install command. Will publish in january

from eslint-config-wesbos.

wesbos avatar wesbos commented on May 20, 2024

fixed in 3.2.0

from eslint-config-wesbos.

wesbos avatar wesbos commented on May 20, 2024

The command to remove peerDeps:

npm uninstall eslint-config-airbnb-typescript eslint-config-prettier eslint-plugin-html eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks @typescript-eslint/eslint-plugin @typescript-eslint/parser

from eslint-config-wesbos.

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.