fluid-project / fluid-lint-all

Consolidated linting logic free from any particular build technology
BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

lintspaces.jsonindentation includes package-lock.json by default #38

Closed greatislander closed 3 years ago

greatislander commented 3 years ago

Describe the bug

By default, the lintspaces.jsonindentation check has no excludes:

https://github.com/fluid-project/fluid-lint-all/blob/7b4b73db567cf48aa4ce6417ca8668d40444f32a/src/js/lint-all.js#L246-L254

As a result, a project's package-lock.json file will be linted by default, producing thousands of indentation errors.

To reproduce

Review the GitHub Actions output for a repository I've created to demonstrate the issue, greatislander/lintspaces-test.

Or:

  1. Clone greatislander/lintspaces-test.
  2. Install dependencies: npm install
  3. Run the linter: npm test
  4. See lengthy error output for lintspaces.jsonindentation.

Expected behavior

package-lock.json be excluded from this check by default. I expect this may be as simple as adding it to the excludes list as seen in lintspaces.newlines:

https://github.com/fluid-project/fluid-lint-all/blob/7b4b73db567cf48aa4ce6417ca8668d40444f32a/src/js/lint-all.js#L255-L280

the-t-in-rtf commented 3 years ago

Many of our projects explicitly add .package-lock.json to .gitignore, and it's certainly possible to exclude it from specific checks, so it's not a bug exactly. I agree it would be a nice improvement to include it explicitly in the defaults.