Skip to content

Commit 907f966

Browse files
committed
Minimal reproduction config
This strips everything that isn't needed while still showing the error.
1 parent 469ad6e commit 907f966

File tree

1 file changed

+9
-135
lines changed

1 file changed

+9
-135
lines changed

eslint.config.mjs

+9-135
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,8 @@
1-
/**
2-
* Debugging:
3-
* https://eslint.org/docs/latest/use/configure/debug
4-
* ----------------------------------------------------
5-
*
6-
* Print a file's calculated configuration
7-
*
8-
* npx eslint --print-config path/to/file.js
9-
*
10-
* Inspecting the config
11-
*
12-
* npx eslint --inspect-config
13-
*
14-
*/
15-
16-
import globals from 'globals';
17-
import js from '@eslint/js';
18-
191
import ts from 'typescript-eslint';
20-
212
import ember from 'eslint-plugin-ember/recommended';
223

23-
import qunit from 'eslint-plugin-qunit';
24-
import n from 'eslint-plugin-n';
25-
26-
import babelParser from '@babel/eslint-parser';
27-
284
const parserOptions = {
295
esm: {
30-
js: {
31-
ecmaFeatures: { modules: true },
32-
ecmaVersion: 'latest',
33-
requireConfigFile: false,
34-
babelOptions: {
35-
plugins: [
36-
[
37-
'@babel/plugin-proposal-decorators',
38-
{ decoratorsBeforeExport: true },
39-
],
40-
],
41-
},
42-
},
436
ts: {
447
projectService: true,
458
tsconfigRootDir: import.meta.dirname,
@@ -48,117 +11,28 @@ const parserOptions = {
4811
};
4912

5013
export default ts.config(
51-
js.configs.recommended,
52-
ember.configs.base,
53-
ember.configs.gjs,
54-
ember.configs.gts,
55-
/**
56-
* Ignores must be in their own object
57-
* https://eslint.org/docs/latest/use/configure/ignore
58-
*/
59-
{
60-
ignores: [
61-
'declarations/',
62-
'dist/',
63-
'.node_modules.ember-try/',
64-
'coverage/',
65-
'storybook-static/',
66-
],
67-
},
68-
/**
69-
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
70-
*/
7114
{
72-
linterOptions: {
73-
reportUnusedDisableDirectives: 'error',
74-
},
75-
},
76-
{
77-
files: ['**/*.js'],
78-
languageOptions: {
79-
parser: babelParser,
80-
},
81-
},
82-
{
83-
files: ['**/*.{js,gjs}'],
84-
languageOptions: {
85-
parserOptions: parserOptions.esm.js,
86-
globals: {
87-
...globals.browser,
88-
},
89-
},
15+
ignores: ['**/*.js', '**/*.mjs'],
9016
},
9117
{
18+
name: 'ts',
9219
files: ['**/*.ts'],
9320
languageOptions: {
21+
// Uncommenting this fixes the issue so it seems to be related to switching parsers for different kinds of typed files?
22+
// parser: ember.parser,
9423
parserOptions: parserOptions.esm.ts,
9524
},
96-
extends: [ember.configs.base, ...ts.configs.recommendedTypeChecked],
25+
extends: [...ts.configs.recommendedTypeChecked],
26+
// extends: [...ts.configs.recommended], // also fails
9727
},
9828
{
29+
name: 'gts',
9930
files: ['**/*.gts'],
10031
languageOptions: {
10132
parser: ember.parser,
10233
parserOptions: parserOptions.esm.ts,
10334
},
104-
extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
105-
rules: {
106-
// This works around an issue in Glint https://github.com/typed-ember/glint/issues/697
107-
// It also makes adding state to a component easier, since no other code changes would be needed.
108-
'ember/no-empty-glimmer-component-classes': 'off',
109-
},
110-
},
111-
{
112-
files: ['tests/**/*-test.{js,gjs,ts,gts}'],
113-
plugins: {
114-
qunit,
115-
},
116-
},
117-
/**
118-
* CJS node files
119-
*/
120-
{
121-
files: [
122-
'index.js',
123-
'**/*.cjs',
124-
'config/**/*.js',
125-
'testem.js',
126-
'testem*.js',
127-
'.prettierrc.js',
128-
'.stylelintrc.js',
129-
'.template-lintrc.js',
130-
'ember-cli-build.js',
131-
'tests/dummy/config/**/*.js',
132-
'.storybook/main.js',
133-
],
134-
plugins: {
135-
n,
136-
},
137-
138-
languageOptions: {
139-
sourceType: 'script',
140-
ecmaVersion: 'latest',
141-
globals: {
142-
...globals.node,
143-
},
144-
},
145-
},
146-
/**
147-
* ESM node files
148-
*/
149-
{
150-
files: ['**/*.mjs'],
151-
plugins: {
152-
n,
153-
},
154-
155-
languageOptions: {
156-
sourceType: 'module',
157-
ecmaVersion: 'latest',
158-
parserOptions: parserOptions.esm.js,
159-
globals: {
160-
...globals.node,
161-
},
162-
},
35+
// These don't really matter, commented or not, it fails
36+
// extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
16337
},
16438
);

0 commit comments

Comments
 (0)