Files
marco/eslint.config.mjs
T
raucao 4cb8c94c9c Upgrade to Babel 8, Vite 8, and babel-plugin-ember-template-compilation 4
Bump @babel/core, @babel/eslint-parser, @babel/plugin-transform-runtime,
and @babel/runtime to ^8.x. Remove useESModules and regenerator options
from @babel/plugin-transform-runtime config (both removed in Babel 8).
Switch @babel/eslint-parser import from the removed /experimental-worker
entry point to the main entry point.

Bump vite to ^8.0.0 (now using Rolldown/Oxc instead of esbuild/Rollup).
Bump @rollup/plugin-babel to ^7.1.0 and
babel-plugin-ember-template-compilation to ^4.0.0.

Patch ember-concurrency@5.2.0 to remove the api.assertVersion(7) call
that is incompatible with Babel 8 (ember-concurrency has not yet
released a Babel 8-compatible version).
2026-08-06 16:26:23 -05:00

104 lines
2.1 KiB
JavaScript

/**
* Debugging:
* 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
*
*/
import globals from 'globals';
import js from '@eslint/js';
import { defineConfig, globalIgnores } from 'eslint/config';
import ember from 'eslint-plugin-ember/recommended';
import WarpDrive from 'eslint-plugin-warp-drive/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';
const esmParserOptions = {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
};
export default defineConfig([
globalIgnores(['dist/', 'coverage/', 'release/', '!**/.*']),
js.configs.recommended,
eslintConfigPrettier,
ember.configs.base,
ember.configs.gjs,
...WarpDrive,
/**
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
*/
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},
{
files: ['**/*.js'],
languageOptions: {
parser: babelParser,
},
},
{
files: ['**/*.{js,gjs}'],
languageOptions: {
parserOptions: esmParserOptions,
globals: {
...globals.browser,
},
},
},
{
files: ['tests/**/*-test.{js,gjs}'],
plugins: {
qunit,
},
},
/**
* CJS node files
*/
{
files: ['**/*.cjs', 'config/**/*.js', 'ember-cli-build.js'],
plugins: {
n,
},
languageOptions: {
sourceType: 'script',
ecmaVersion: 'latest',
globals: {
...globals.node,
},
},
},
/**
* ESM node files
*/
{
files: ['**/*.mjs'],
plugins: {
n,
},
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: esmParserOptions,
globals: {
...globals.node,
},
},
},
]);