question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lint package.json requirements with eslint-plugin-json-files

See original GitHub issue

With @kellyselden’s PR here: https://github.com/kellyselden/eslint-plugin-json-files

I think it now makes sense to add some very important, yet presently missing lints for:

  • package.json
    • for all addons
      • keywords must have ember-addon
    • v2 addons
      • require an addon-main entry and the file must exist
      • ember-addon (or ember) entry must exist
        • version must be set to 2
        • addon-main must be present in exports
        • app-js is optional, but must point at files present in the exports
      • a the output / dist folder must include at least one entry in exports (name of dist should be configurable)
      • if a v2 addon is “browser-only”, we don’t need an engines entry
      • forbid dependencies (things common in v1 addons)
        • ember-cli-htmlbars
        • ember-cli-babel
      • recommend peerDependencies (+ devDeps):
        • ember-source

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bmishcommented, Dec 30, 2022

The ember-cli blueprint already includes various JavaScript linters including eslint-plugin-ember, handlebars linting via ember-template-lint, and there’s a proposal to add stylelint. I’m not sure why package.json linting necessarily belongs in the Ember-JavaScript-focused linting package. Just to suggest an alternative, package.json linting might deserve to be an additional type of linting added to the ember-cli blueprint, once there’s a stable and worthwhile package available for that.

0reactions
NullVoxPopulicommented, Dec 30, 2022

I started a thread in discord, if you want to help work out some details 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-json - npm
eslint plugin for JSON files. Latest version: 3.1.0, ... Start using eslint-plugin-json in your project by running `npm i eslint-plugin-json`.
Read more >
azeemba/eslint-plugin-json: Lint your JSON files - GitHub
eslint 's parser is a JavaScript parser. JSON is a stricter subset and things that are valid JavaScript are not valid JSON. This...
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Introduction | eslint-plugin-jsonc
ESLint is a great linter for JavaScript. Since JSON (opens new window) is a subset of JavaScript, the same parser and rules can ......
Read more >
How can I make eslint detect rule violations in JSON files?
If I understand correctly, JSON files have not valid JavaScript syntax in most cases: outer curly brackets {} are parsed as a block...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found