npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@clark/eslint-config-ember

v2.2.0

Published

CLARK's eslint-config for Ember.js

Downloads

1,241

Readme

@clark/eslint-config-ember

Node CI code style: prettier dependencies devDependencies lerna CLARK Open Source

CLARK's eslint-config for Ember.js

Installation

# With TypeScript
yarn add -D eslint @clark/eslint-config-ember @clark/eslint-config-node typescript @clark/eslint-config-ember-typescript

# Without TypeScript
yarn add -D eslint @clark/eslint-config-ember @clark/eslint-config-node

Setup

Ember projects consist of up to three different types of JS source files:

Apps

  • Files in the app tree or src tree (Module Unification) and tests tree / dummy app
  • Node.js source files, like ember-cli-build.js or config/environment.js

Addons

  • Files in the addon tree or src tree (Module Unification) and tests tree / dummy app
  • Files in the app tree, which usually re-export files from addon
  • Node.js source files, like index.js

Node.js and Ember source files obviously have fundamentally different linting requirements. The official Ember blueprint currently solves this by adding overrides for Node files and just using a single .eslintrc.js.

We have found this to be very brittle and hard to maintain on the long run. A detailed argument can be found in this Pre-RFC #450 "change eslint blueprint".

While the world is still waiting for eslint/rfcs#9 to bring a new and better config system to the table, we have found it much more feasible to create multiple root: true .eslintrc.js files instead of using overrides.

Remember to create .eslintignore files! Otherwise eslint might seemingly hang indefinitely, because it tries to lint your huge bundled dist files or node_modules.

Furthermore, we recommend to remove any linting integration from ember-cli. So this means uninstalling ember-cli-eslint and installing eslint instead. The default lint:js task (eslint .) is sufficient. When you want to use TypeScript, e.g. via @clark/eslint-config-ember-typescript you have to update it to eslint --ext ts,js ..

You can also remove any other pre-installed eslint dependencies, like eslint-plugin-ember and eslint-plugin-node. They are included in our configs.

Addons

.
├── .eslintrc.js
├── addon
│   └── .eslintrc.js
├── app
│   └── .eslintrc.js
└── tests
    ├── .eslintrc.js
    └── dummy
        └── config
            └── .eslintrc.js
// .eslintrc.js
module.exports = {
  root: true,
  extends: "@clark/node",
};
// addon/.eslintrc.js
module.exports = {
  root: true,
  extends: "@clark/ember-typescript",
};
// addon-test-support/.eslintrc.js
module.exports = {
  root: true,
  extends: "@clark/ember-typescript",
};
// app/.eslintrc.js
module.exports = {
  root: true,
  // Since `app` is merged with the parent app, which is not guaranteed to have
  // TypeScript installed, we need to restrict ourselves to JavaScript only.
  extends: "@clark/ember",
};
// tests/.eslintrc.js
module.exports = {
  root: true,
  extends: "@clark/ember-typescript/test",
};
// tests/dummy/config/.eslintrc.js
module.exports = {
  root: true,
  extends: "@clark/node",
};

Live Examples

Apps

.
├── .eslintrc.js
├── app
│   └── .eslintrc.js
└── tests
    ├── .eslintrc.js
    └── dummy
        └── config
            └── .eslintrc.js
// .eslintrc.js
module.exports = {
  root: true,
  extends: "@clark/node",
};
// app/.eslintrc.js
module.exports = {
  root: true,
  extends: "@clark/ember-typescript",
};
// tests/.eslintrc.js
module.exports = {
  root: true,
  extends: "@clark/ember-typescript/test",
};
// tests/dummy/config/.eslintrc.js
module.exports = {
  root: true,
  extends: "@clark/node",
};