prettier / stylelint-config-prettier

Turns off all rules that are unnecessary or might conflict with prettier.
MIT License
373 stars 23 forks source link

index.js is missing from the root directory #12

Closed sampotts closed 6 years ago

sampotts commented 6 years ago

Hey,

I may have my configuration wrong but updating to the latest version and latest stylelint, I'm seeing the following error:

ENOENT/path/to/file.scss::  no such file or directory, open '/path/to/node_modules/stylelint-config-prettier/index.js'

It's easily fixed by cd'ing to /src and then running cp index.js ../ but I'm not sure this is correct. Any ideas?

I notice other libs have the index.js in the root: https://github.com/stylelint/stylelint-config-recommended https://github.com/hudochenkov/stylelint-order https://github.com/bjankord/stylelint-config-sass-guidelines

Here's my .stylelint config that references stylelint-config-prettier

{
    "plugins": ["stylelint-selector-bem-pattern", "stylelint-scss"],
    "extends": ["stylelint-config-recommended", "stylelint-config-sass-guidelines", "stylelint-config-prettier"]
}
shannonmoeller commented 6 years ago

I created a repository to try and reproduce the issue and couldn't. The src/index.js file is the value of main in the package.json, so this would seem like a bug somewhere else.

https://github.com/shannonmoeller/repro-stylelint-config-prettier-12

What versions of Node.js and stylelint are you using? Any chance you could delete your node_modules dir and package-lock.json file, then run npm i, and try linting again?

sampotts commented 6 years ago

Will give that a try in the AM. As far as I’m aware, latest node, latest stylelint but I’ll confirm in the morning (I’m in Australia).

Cheers Sam

On 15 Mar 2018, at 12:44 am, Shannon Moeller notifications@github.com wrote:

I created a repository to try and reproduce the issue and couldn't. The src/index.js file is the value of main in the package.json, so this would seem like a bug somewhere else.

https://github.com/shannonmoeller/repro-stylelint-config-prettier-12

What versions of Node.js and stylelint are you using? Any chance you could delete your node_modules dir and package-lock.json file, then run npm i, and try linting again?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

sampotts commented 6 years ago

Node is 9.8.0 Stylelint is 9.1.3

Deleted yarn.lock and package-lock.json (I use yarn primarily) and still the same result (had to cp index.js up a level). I deleted node_modules and tried yarn and npm install with the same result. Deleted node_modules both times too. It's fine, I can cp index.js ../ for now

shannonmoeller commented 6 years ago

Thanks for trying all of that. Having to modify the content of node_modules is no good. I'll add the plugins you listed into the repro repo and see if I can replicate. My guess is one of the plugins you're using is doing something weird.

sampotts commented 6 years ago

It wouldn't surprise me 👍

shannonmoeller commented 6 years ago

I updated the repo to include those plugins, but I still can't reproduce the issue:

https://github.com/shannonmoeller/repro-stylelint-config-prettier-12/blob/3f82600212fc2402995101294c9819aad2f8658b/package.json

Is the project your working on open source? Can I see the code?

sampotts commented 6 years ago

Sure - it's here: https://github.com/sampotts/plyr/tree/beta

shannonmoeller commented 6 years ago

Are you using the local install of stylelint, or a global one? I don't see it in your npm scripts or gulpfile.

(Need to head home. Back online later.)

sampotts commented 6 years ago

Local - happy to go on your recommendation though. I was just keen for contributors to be using stylelint. I'm using it with VS Code + Prettier + Stylelint integration. I should probably incorporate it into the scripts though.

sampotts commented 6 years ago

OK I've worked it out - sorry to waste your time. The VS code stylelint plugin had an update which seemed to fix it.

shannonmoeller commented 6 years ago

Not a waste at all! Glad you got it figured out!