1414 */
1515import globals from 'globals' ;
1616import js from '@eslint/js' ;
17+ import { defineConfig , globalIgnores } from 'eslint/config' ;
1718
1819import ember from 'eslint-plugin-ember/recommended' ;
19-
20- import prettierConfig from 'eslint-config-prettier' ;
20+ import eslintConfigPrettier from 'eslint-config-prettier' ;
2121import qunit from 'eslint-plugin-qunit' ;
2222import n from 'eslint-plugin-n' ;
2323
24- import babelParser from '@babel/eslint-parser' ;
24+ import babelParser from '@babel/eslint-parser/experimental-worker ' ;
2525
26- const parserOptions = {
27- esm : {
28- js : {
29- ecmaFeatures : { modules : true } ,
30- ecmaVersion : 'latest' ,
31- requireConfigFile : false ,
32- babelOptions : {
33- plugins : [
34- [
35- '@babel/plugin-proposal-decorators' ,
36- { decoratorsBeforeExport : true } ,
37- ] ,
38- ] ,
39- } ,
40- } ,
41- } ,
26+ const esmParserOptions = {
27+ ecmaFeatures : { modules : true } ,
28+ ecmaVersion : 'latest' ,
4229} ;
4330
44- export default [
31+ export default defineConfig ( [
32+ globalIgnores ( [
33+ 'dist/' ,
34+ 'dist_prev/' ,
35+ 'vendor/' ,
36+ 'coverage/' ,
37+ 'skeletons/' ,
38+ '!**/.*' ,
39+ ] ) ,
4540 js . configs . recommended ,
41+ eslintConfigPrettier ,
4642 ember . configs . base ,
4743 ember . configs . gjs ,
48- prettierConfig ,
49- /**
50- * Ignores must be in their own object
51- * https://eslint.org/docs/latest/use/configure/ignore
52- */
53- {
54- ignores : [
55- 'dist/' ,
56- 'node_modules/' ,
57- 'coverage/' ,
58- '!**/.*' ,
59- 'vendor/' ,
60- 'dist_prev/' ,
61- 'skeletons/' ,
62- ] ,
63- } ,
6444 /**
6545 * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
6646 */
@@ -69,33 +49,26 @@ export default [
6949 reportUnusedDisableDirectives : 'error' ,
7050 } ,
7151 } ,
72- {
73- rules : {
74- 'no-prototype-builtins' : 'off' ,
75- 'no-useless-escape' : 'off' ,
76- 'no-unused-vars' : [ 'error' , { argsIgnorePattern : '^_' } ] ,
77- } ,
78- } ,
7952 {
8053 files : [ '**/*.js' ] ,
8154 languageOptions : {
8255 parser : babelParser ,
8356 } ,
57+ rules : {
58+ 'no-useless-escape' : 'off' ,
59+ } ,
8460 } ,
8561 {
8662 files : [ '**/*.{js,gjs}' ] ,
8763 languageOptions : {
88- parserOptions : parserOptions . esm . js ,
64+ parserOptions : esmParserOptions ,
8965 globals : {
9066 ...globals . browser ,
91- basicContext : false ,
92- requireModule : false ,
93- globalThis : true ,
94- chrome : 'readonly' ,
9567 } ,
9668 } ,
9769 } ,
9870 {
71+ ...qunit . configs . recommended ,
9972 files : [ 'tests/**/*-test.{js,gjs}' ] ,
10073 plugins : {
10174 qunit,
@@ -105,19 +78,16 @@ export default [
10578 * CJS node files
10679 */
10780 {
81+ ...n . configs [ 'flat/recommended-script' ] ,
10882 files : [
10983 '**/*.cjs' ,
110- 'config/**/*.js' ,
111- 'lib/*/index.js' ,
112- 'scripts/**/*.js' ,
113- 'testem.js' ,
114- 'testem*.js' ,
11584 '.prettierrc.js' ,
11685 '.stylelintrc.js' ,
11786 '.template-lintrc.js' ,
11887 'babel.config.js' ,
119- 'ember-cli-build.js' ,
120- 'gulpfile.js' ,
88+ 'config/**/*.js' ,
89+ 'scripts/download-panes.js' ,
90+ 'testem.js' ,
12191 ] ,
12292 plugins : {
12393 n,
@@ -128,15 +98,14 @@ export default [
12898 ecmaVersion : 'latest' ,
12999 globals : {
130100 ...globals . node ,
131- basicContext : false ,
132- requireModule : false ,
133101 } ,
134102 } ,
135103 } ,
136104 /**
137105 * ESM node files
138106 */
139107 {
108+ ...n . configs [ 'flat/recommended-module' ] ,
140109 files : [ '**/*.mjs' ] ,
141110 plugins : {
142111 n,
@@ -145,12 +114,22 @@ export default [
145114 languageOptions : {
146115 sourceType : 'module' ,
147116 ecmaVersion : 'latest' ,
148- parserOptions : parserOptions . esm . js ,
117+ parserOptions : esmParserOptions ,
118+ globals : {
119+ ...globals . node ,
120+ } ,
121+ } ,
122+ } ,
123+ /**
124+ * Gulp files
125+ */
126+ {
127+ files : [ 'gulpfile.js' ] ,
128+ languageOptions : {
149129 globals : {
150130 ...globals . node ,
151- basicContext : false ,
152- requireModule : false ,
131+ gulp : 'readonly' ,
153132 } ,
154133 } ,
155134 } ,
156- ] ;
135+ ] ) ;
0 commit comments