-
-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Description
My package works when running locally and it include files which are being reported as node/no-unpublished-import.
Looking at the rule details
eslint-plugin-node/docs/rules/no-unpublished-import.md
Lines 9 to 16 in f45c614
| ## 📖 Rule Details | |
| If a source code file satisfies all of the following conditions, the file is \*published\*. | |
| - `"files"` field of `package.json` includes the file or `"files"` field of `package.json` does not exist. | |
| - `.npmignore` does not include the file. | |
| Then this rule warns `import` declarations in \*published\* files if the `import` declaration imports \*unpublished\* files or the packages of `devDependencies`. |
-
"files"field ofpackage.jsondoes not exist. -
.npmignoredoes not include the file. (npm packinclude it)
Here are more details:
$ npm pack
npm notice
npm notice 📦 [email protected]
npm notice === Tarball Contents ===
npm notice 707B README.md
npm notice 2.2kB package.json
npm notice 1.8kB src/app.js
npm notice 441B src/index.js
npm notice 1.2kB src/next/run.js
npm notice 585B src/settings.js
npm notice === Tarball Details ===
npm notice name: foo
npm notice version: 1.0.0
npm notice filename: foo-1.0.0.tgz
npm notice package size: 3.0 kB
npm notice unpacked size: 6.9 kB
npm notice shasum: 40e557584dd512a827d79bffb1ce1e80f112d152
npm notice integrity: sha512-vhLLIZAFkvhyo[...]19wv3Ehyuigeg==
npm notice total files: 6
npm notice
foo-1.0.0.tgz
$ npx eslint --env-info
Environment Info:
Node version: v16.16.0
npm version: v8.14.0
Local ESLint version: v8.21.0 (Currently used)
Global ESLint version: Not found
Operating System: darwin 21.6.0
$ npx eslint .
/foo/bar/prj/src/app.js
5:22 error "./settings.js" is not published node/no-unpublished-import
6:24 error "./next/run.js" is not published node/no-unpublished-import
$ cat /foo/bar/prj/src/app.js | head -n 5 | tail -n 1
import settings from "./settings.js";
$ cat package.json | jq '.files'
nullIt is a bug or am I missing something?
Metadata
Metadata
Assignees
Labels
No labels