google / gts

☂️ TypeScript style guide, formatter, and linter.
https://github.com/google/gts
Apache License 2.0
5.09k stars 206 forks source link

no-unpublished-import no longer throws an error by default #887

Open IchordeDionysos opened 5 months ago

IchordeDionysos commented 5 months ago

Steps to reproduce:

  1. Run npx gts init
  2. Use default options
  3. Add the following code at the top of index.ts
    import * as gts from 'gts';
  4. Run npm run lint

Expected behaviour

It throws an error:

1:22  error  "gts" is not published  n/no-unpublished-import

Actual behaviour

There is no error being thrown.

Additional information

When adding src to the files array in the package.json, the behaviour is fixed, though it is debatable whether this is a desirable fix.

  "files": [
    "build/src",
    "src"
  ],
tonycoco commented 5 months ago

I'll look into this.

IchordeDionysos commented 5 months ago

It seems like this is the proper fix: https://stackoverflow.com/questions/67551956/node-no-unpublished-import-chai-is-not-published/78616594#78616594

tonycoco commented 5 months ago

Interesting but in my initial test that doesn't seem to work in our case