Skip to content

filesRedundancy

Reports package.json files entries that npm already includes.

✅ This rule is included in the package-json logical presets.

This rule reports entries in files that npm includes automatically. npm always includes package.json, root-level README, COPYING, LICENSE, and LICENCE files, the file declared in main, and files declared in bin. It also reports duplicate files entries.

{
"files": ["README.md", "dist/"]
}
{
"main": "./lib/index.js",
"files": ["lib/index.js", "dist/"]
}
{
"files": ["dist/", "dist/"]
}

If a package uses a custom publishing tool that does not follow npm's automatic package-file inclusion rules, this rule might not apply. For example, another tool might require README or entry-point files to be listed explicitly.

Made with ❤️‍🔥 around the world by the Flint team and contributors.