Closed swashata closed 6 years ago
Thanks for the detailed issue @swashata, I think this is a Yarn specific issue to be honest (if it was also npm I'd have expected similar reported issues)
Currently eslint-plugin-wordpress
is only used in devDependencies
so that the codebase here in this eslint-config-wordpress
repo can use some of the planned rule enhancements included in eslint-plugin-wordpress
There is also quite possibly some incompatibility between the versions you are using, the v2.0.0 release of eslint-config-wordpress
is not outdated, it is the current and recommended version to use.
With all that said, later today I'll be releasing some new versions of both the packages in question which will resolve this issue anyway (I believe)
Great. I will be waiting for the release.
Just to clarify, if I use eslint-config-wordpress
from npm,
"devDependencies": {
"eslint": "^4.18.2",
"eslint-config-wordpress": "^2.0.0",
"eslint-plugin-html": "^4.0.2",
"eslint-plugin-react": "^7.7.0"
}
there was some other error, like ~/.rules not found
. I don't remember the error exactly, but I think it was related to WordPress-Coding-Standards/eslint-plugin-wordpress#106
Theoretically the release of eslint-config-wordpress
will be version "2.1.0", so the semver range you have of "^2.0.0"
will cover the release
Great...
@ntwb I just want to let you know that I was wrong with the ~/.rules not found
error. I really messed up before while getting the error. Basically within the project, I had eslint-config-wordpress
and within .eslintrc.js
file, I had wordpress
in the plugins
directive. But I didn't install eslint-plugin-wordpress
so it was yelling at me for (obviously) not finding the eslint-plugin-wordpress
.
I understand why I was wrong. Now I have set things up with VSCode to automatically fix possible errors and formatting on save. Do you think I can send a PR with documentation for the same?
Thanks for the update @swashata... It's pretty easy to do, I've got myself confused a couple of times in the past 24 hours 😏
A PR with those docs would be fanastic 😄
Alright. One last thing. Should the docs go into README
or a separate folder like docs/vscode-setup.md
docs/eslint-setup.md
etc.
This option docs/vscode-setup.md
sounds good for now 👍
I understand that
eslint-config-wordpress
is the only package I need to install foreslint
ing with WordPress standard and not theeslint-plugin-wordpress
as the first should have the second as a dependency.But I think, because the dependency is defined in
devDependencies
and not withindependencies
theeslint-plugin-wordpress
never gets installed.I added
eslint-config-wordpress
like this (because the one in package repo is outdated.But this always complains
So I update the
package.json
and link the dependency manually byand now this works as expected.
Is it the intended behavior or is there something wrong?