Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

.eslintrc plugin not working #6

Open
pkristoff opened this issue Jun 15, 2016 · 2 comments
Open

.eslintrc plugin not working #6

pkristoff opened this issue Jun 15, 2016 · 2 comments

Comments

@pkristoff
Copy link

I created a local plugin and included it in the .eslintrc file. See below.

When I run Eslintrb.lint(source, :eslintrc) i get

{"ruleId"=>"pattern/return-object-only",
"severity"=>2,
"message"=>"Definition for rule 'pattern/return-object-only' was not found",
"line"=>1,
"column"=>1, "nodeType"=>"Program", "source"=>"'use strict';"}

{ "extends": [ "eslint:recommended" ], "plugins": [ "pattern" ], "env": { "browser": true, "node": true }, "globals": { "angular": true, "$": true }, "rules": { "pattern/return-object-only" : 2, "comma-dangle": [ "error", "never" ], "no-console": "off", "no-unused-vars": ["error", { "vars": "all", "args": "none" }], "quote-props": ["error", "as-needed"], "quotes": [ 2, "single", {"avoidEscape": true, "allowTemplateLiterals": true} ], "semi": [ "error", "always" ] } }

@ocke
Copy link
Contributor

ocke commented Jun 21, 2016

I just commented on #5 about this. The reason is similar. Eslint is a npm package. What it normally would do is require('return-object-ruby').

However, this is some 'standalone' version of eslint running in the ruby environment, which doesn't know about node_modules and all of that.

See the first FAQ question at https://github.com/sstephenson/execjs

@pkristoff
Copy link
Author

Olaf,

I finally just wrote my own version, which just called eslint directly from ruby and it worked. This assumed Eslint is globally defined which is the recommended way.

Thanks,

Paul

On Jun 21, 2016, at 3:16 AM, Olaf Kwant [email protected] wrote:

I just commented on #5 #5. The reason is similar. Eslint is a npm package. What it normally would do is require('eslint-config-airbnb'), which you probably have installed using npm.

However, this is some 'standalone' version of eslint running in the ruby environment, which doesn't know about node_modules and all of that.

See the first FAQ question at https://github.com/sstephenson/execjs https://github.com/sstephenson/execjs

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #6 (comment), or mute the thread https://github.com/notifications/unsubscribe/AAIna4APZu5lGfmRe6POWoWDxcXul36Sks5qN4_fgaJpZM4I23Up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants