Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@clark/eslint-config-ember

Package Overview
Dependencies
Maintainers
4
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clark/eslint-config-ember

Clark's eslint-config for Ember.js

  • 1.17.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
174
increased by27.94%
Maintainers
4
Weekly downloads
 
Created
Source

@clark/eslint-config-ember

BuildStatus 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 indefinetly, becaue it tries to lint your huge bundled dist files.

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
/* eslint-env node */
module.exports = {
  root: true,
  extends: '@clark/ember-typescript'
};
// addon-test-support/.eslintrc.js
/* eslint-env node */
module.exports = {
  root: true,
  extends: '@clark/ember-typescript'
};
// app/.eslintrc.js
/* eslint-env node */
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
/* eslint-env node */
module.exports = {
  root: true,
  extends: '@clark/ember-typescript'
};
// 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
/* eslint-env node */
module.exports = {
  root: true,
  extends: '@clark/ember-typescript'
};
// tests/.eslintrc.js
/* eslint-env node */
module.exports = {
  root: true,
  extends: '@clark/ember-typescript'
};
// tests/dummy/config/.eslintrc.js
module.exports = {
  root: true,
  extends: '@clark/node'
};

Keywords

FAQs

Package last updated on 05 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc