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

Add /config/addon-docs.js to npmignore automatically #103

Closed
bravo-kernel opened this issue Mar 15, 2018 · 7 comments
Closed

Add /config/addon-docs.js to npmignore automatically #103

bravo-kernel opened this issue Mar 15, 2018 · 7 comments

Comments

@bravo-kernel
Copy link
Contributor

bravo-kernel commented Mar 15, 2018

Any ideas what could be causing this.

When running yarn run lint:js in my addon, eslint throws the following error on /config/addon-docs.js:

4:33  error  "ember-cli-addon-docs" is not published  node/no-unpublished-require
  • ember-cli: 3.1.0-beta.1
  • node: 8.9.0
  • os: linux x64
  • ember-cli-addon-docs as a devDependency

error occured on non-beta as well before

@bravo-kernel
Copy link
Contributor Author

/config/addon-docs.js

/* eslint-env node */
'use strict';

const AddonDocsConfig = require('ember-cli-addon-docs/lib/config');

module.exports = class extends AddonDocsConfig {
  // See https://ember-learn.github.io/ember-cli-addon-docs/latest/docs/deploying
  // for details on configuration you can override here.
};

@pzuraq
Copy link
Contributor

pzuraq commented Mar 15, 2018

So this throws when you have a dev dependency and eslint thinks it's not a dev dependency I'm pretty sure, so you'll have to manually mark that file as being dev only

@bravo-kernel
Copy link
Contributor Author

Thanks for replying, I will see if I can somehow mark it. I have absolutely zero JS/Ember skills but I do wonder why this is being done this way (and if I am really the first one encountering this).

There's a whole thread advertising against it here mysticatea/eslint-plugin-node#47 but if this is the way to go I will try to add a note to the docs.

Some quotes:

That rule disallows imports of unpublished files/modules from published files. (Because such imports may cause severe problems after npm publish)

I would definitely not want to publish code that has require('lodash') if "lodash" is only a devDependency. That would be broken. So I totally appreciate the way this rule currently operates.

@bravo-kernel
Copy link
Contributor Author

@pzuraq not the first I see. Seems mr. @elwayman02 had the same, he simply disabled it.

https://github.com/elwayman02/ember-interactivity/blob/master/config/addon-docs.js

Would this be welcomed as a PR?

@ro0gr
Copy link
Contributor

ro0gr commented Mar 15, 2018

@bravo-kernel you have to add your "/config/addon-docs.js" to the ".npmignore".

@pzuraq I think it's a job for blueprint?

@bravo-kernel
Copy link
Contributor Author

Wrong button, totally works. Do you folk want me to close the ticket?

@pzuraq
Copy link
Contributor

pzuraq commented Mar 15, 2018

@ro0gr I agree that adding it to the .npmignore would be the best way to do this, and as part of the blueprint. Will change the issue name to track that, let's keep it open for now

@pzuraq pzuraq changed the title ESLint error breaks CI: node/no-unpublished-require Add /config/addon-docs.js to npmignore automatically Mar 15, 2018
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

No branches or pull requests

3 participants