codeclimate-eslint icon indicating copy to clipboard operation
codeclimate-eslint copied to clipboard

Add support for eslint-plugin-html

Open artn opened this issue 9 years ago • 3 comments

I am using RiotJS with ES6 and using eslint-plugin-html for linting.

When build the code on codeclimate, error was raised.

File `.eslintignore` ignored because of your .eslintignore file.
File `.eslintrc.js` ignored because of your .eslintignore file.
File `.eslintrc` ignored because of your .eslintignore file.
File `.gitignore` ignored because of your .eslintignore file.
File `.codeclimate.yml` ignored because of your .eslintignore file.
/usr/src/app/node_modules/eslint/lib/config/plugins.js:137
                throw err;
                ^

Error: Failed to load plugin html: Cannot find module 'eslint-plugin-html'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.load (/usr/src/app/node_modules/eslint/lib/config/plugins.js:129:26)
    at Array.forEach (native)
    at Object.loadAll (/usr/src/app/node_modules/eslint/lib/config/plugins.js:151:21)
    at Object.load (/usr/src/app/node_modules/eslint/lib/config/config-file.js:504:21)
    at loadConfig (/usr/src/app/node_modules/eslint/lib/config.js:63:33)
    at new Config (/usr/src/app/node_modules/eslint/lib/config.js:226:38)

Could you add support for this please?

artn avatar Feb 03 '17 01:02 artn

We'd be happy to look at a pull request!

https://github.com/codeclimate/codeclimate-eslint/blob/master/CONTRIBUTING.md

dblandin avatar Mar 14 '17 20:03 dblandin

When I executed bin/yarn add eslint-plugin-html below error was raised.

$ bin/yarn add eslint-plugin-html
yarn add v0.21.3
[1/4] Resolving packages...
[2/4] Fetching packages...
error Could not write file "/usr/src/app/yarn-error.log": "EACCES: permission denied, open '/usr/src/app/yarn-error.log'"
error An unexpected error occurred: "EACCES: permission denied, unlink '/usr/src/app/node_modules/.yarn-integrity'".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

So I executed below command and found that in my docker environment(MacOS host and using docker-machine with VirtualBox driver), login user is app but mounted volume's owner is node.

$ bin/yarn add "eslint-plugin-html; ls -la ; id"
yarn add v0.21.3
[1/4] Resolving packages...
[2/4] Fetching packages...
error Could not write file "/usr/src/app/yarn-error.log": "EACCES: permission denied, open '/usr/src/app/yarn-error.log'"
error An unexpected error occurred: "EACCES: permission denied, unlink '/usr/src/app/node_modules/.yarn-integrity'".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
total 116
drwxr-xr-x 1 node staff   714 Mar 16 05:30 .
drwxr-xr-x 7 root root   4096 Mar 15 21:07 ..
-rw-r--r-- 1 node staff   214 Mar 16 04:56 .codeclimate.yml
-rw-r--r-- 1 node staff    13 Mar 16 04:56 .dockerignore
-rw-r--r-- 1 node staff   722 Mar 16 04:56 .eslintrc
drwxr-xr-x 1 node staff   442 Mar 16 05:34 .git
-rw-r--r-- 1 node staff    13 Mar 16 04:56 .gitignore
drwxr-xr-x 1 node staff   374 Mar 16 04:59 .idea
-rw-r--r-- 1 node staff   829 Mar 16 04:56 CONTRIBUTING.md
-rw-r--r-- 1 node staff  1036 Mar 16 04:56 Dockerfile
-rw-r--r-- 1 node staff  1062 Mar 16 04:56 LICENSE
-rw-r--r-- 1 node staff   352 Mar 16 04:56 Makefile
-rw-r--r-- 1 node staff  1779 Mar 16 04:56 README.md
-rw-r--r-- 1 node staff   260 Mar 16 04:56 WERE_HIRING.md
drwxr-xr-x 1 node staff   170 Mar 16 04:56 bin
-rw-r--r-- 1 node staff   721 Mar 16 04:56 circle.yml
drwxr-xr-x 1 node staff   374 Mar 16 04:56 lib
drwxr-xr-x 1 node staff  9690 Mar 16 05:33 node_modules
-rw-r--r-- 1 node staff  2383 Mar 16 05:33 package.json
drwxr-xr-x 1 node staff   306 Mar 16 04:56 test
-rw-r--r-- 1 node staff 64351 Mar 16 04:56 yarn.lock
uid=9000(app) gid=9000(app) groups=9000(app)

I'd like to know how to fix the issue.

artn avatar Mar 16 '17 06:03 artn

Sorry! Looks like eslint-plugin-html was already added in https://github.com/codeclimate/codeclimate-eslint/pull/195.

You should be able to use that plugin either on codeclimate.com or via the CLI now.

There is an issue with the bin/yarn executable which I'll fix in a separate PR.

Thanks!

dblandin avatar Mar 16 '17 23:03 dblandin