Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate relative paths against package.json #2

Merged
merged 1 commit into from
Nov 24, 2017
Merged

Evaluate relative paths against package.json #2

merged 1 commit into from
Nov 24, 2017

Conversation

romanzoller
Copy link
Contributor

Evaluate relative paths against package.json instead of process.cwd().

This fixes an issue when using an eslint IDE plugin (e.g. in vs code),
in a project where the javascript code is not at the project root.

Example structure:

src/.eslintrc
src/package.json
src/static/app/app.js // starts with goog.module('app.app')

with googshift/valid-provide-and-module root option set to 'static'.

Using process.cwd(), the rule would expect the file to be at
static/app/app.js
instead of
src/static/app/app.js

Evaluate relative paths against package.json instead of process.cwd().

This fixes an issue when using an eslint IDE plugin (e.g. in vs code),
in a project where the javascript code is not at the project root.

Example structure:

src/.eslintrc
src/package.json
src/static/app/app.js // starts with goog.module('app.app')

with googshift/valid-provide-and-module root option set to 'static'.

Using process.cwd(), the rule would expect the file to be at
   static/app/app.js
instead of
   src/static/app/app.js
@gberaudo gberaudo merged commit dbd656a into gberaudo:master Nov 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants