Linting for Ember.js Projects
Run the following command to add SwiftWC to your project:
bash
ember install @swiftwc/eslint-plugin@latestbash
npm i -D @swiftwc/eslint-plugin@latestbash
bun add --exact @swiftwc/eslint-plugin@latest --devAdd this to your ESLint configuration file:
Modify eslint.config.js like this:
eslint.config.js
js
import globals from 'globals'
import js from '@eslint/js'
import ts from 'typescript-eslint'
import ember from 'eslint-plugin-ember/recommended'
import eslintConfigPrettier from 'eslint-config-prettier'
import qunit from 'eslint-plugin-qunit'
import n from 'eslint-plugin-n'
import babelParser from '@babel/eslint-parser'
import swiftwc from '@swiftwc/eslint-plugin/emberjs/en'
export default [
// 👇🏻 add this block at the bottom of the array
{
files: ['**/*.{gjs,gts}'],
languageOptions: {
parser: ember.parser,
},
plugins: {
swiftwc,
},
extends: [...swiftwc.configs.recommended],
},
]