0.2.1 • Published 4 months ago

ember-eslint v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

ember-eslint

The easiest way to get linting going in in your ember project

Setup

install from npm:

npm add ember-eslint eslint

or, from source (by editing your package.json):

"devDependencies": {
  "ember-eslint": "github:NullVoxPopuli/ember-eslint"
}

In eslint.config.mjs,

import { ember } from 'ember-eslint';

export default [
    ...ember.recommended(import.meta.dirname),
];

In package.json:

"scripts": {
    "lint:js": "eslint .",
    "lint:js:fix": "eslint . --fix"
}

And that's it!

The configs

All configs will "do the right thing" when they detect that you're using (or not using) TypeScript, V2 (Vite) projects, etc

recommended aka "official"

This config mirrors the lint config that is specified in ember-cli, and where any significant change has a Request For Comments.

import { ember } from 'ember-eslint';

export default [
    ...ember.recommended(import.meta.dirname),
];

Support Matrix

This config supports a 2x2x2 matrix of features:

  • TypeScript vs JavaScript
  • App vs Addon
  • type=module packages and classic packages

Exported utilities

  • utils.hasBabelConfig - returns true when the host environment has a babel config
  • utils.hasTypescript - returns true when the host environment has typescript
  • utils.hasTypeModule - returns true when the host environment has type=module in the package.json
  • parsers.esm - the parser options for JS (babel) and TS ESM files

Debugging ESLint

Docs: https://eslint.org/docs/latest/use/configure/debug

Print a file's calculated configuration

npx eslint --print-config path/to/file.js

Inspecting the config

npx eslint --inspect-config
0.2.1

4 months ago

0.2.0

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago

0.0.2

4 months ago

0.0.1

4 months ago

0.0.0

4 months ago