Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion files/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ export default defineConfig([
...globals.browser,
},
},
extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
extends: [
...ts.configs.recommendedTypeChecked,
// https://github.com/ember-cli/ember-addon-blueprint/issues/119
{
...ts.configs.eslintRecommended,
files: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this hack isn't needed?

eslint/eslint#20351

},
ember.configs.gts,
],
},<% } %>
{
files: ['src/**/*'],
Expand Down
15 changes: 15 additions & 0 deletions tests/fixtures/typescript/src/lint-test-gts.gts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* This file is used to ensure that `eslint.config.mjs` is properly configured
* to apply `typescript-eslint`'s recommended rules to `.gts` files. It ensures
* that:
*
* - `no-undef` is disabled (otherwise the undefined symbol would cause a
* linting error)
* - `@typescript-eslint/no-unsafe-return` is enabled (otherwise the
* `eslint-disable-next-line` comment would cause a linting error)
*/
export default function () {
// @ts-expect-error testing lint
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return notDefined;
}
15 changes: 15 additions & 0 deletions tests/fixtures/typescript/src/lint-test-ts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* This file is used to ensure that `eslint.config.mjs` is properly configured
* to apply `typescript-eslint`'s recommended rules to `.ts` files. It ensures
* that:
*
* - `no-undef` is disabled (otherwise the undefined symbol would cause a
* linting error)
* - `@typescript-eslint/no-unsafe-return` is enabled (otherwise the
* `eslint-disable-next-line` comment would cause a linting error)
*/
export default function () {
// @ts-expect-error testing lint
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return notDefined;
}
10 changes: 10 additions & 0 deletions tests/smoke-tests/--typescript.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
).toMatchInlineSnapshot(`
[
"src/index.ts",
"src/lint-test-gts.gts",
"src/lint-test-ts.ts",
"src/template-registry.ts",
"src/components/another-gts.gts",
"src/components/template-import.gts",
Expand All @@ -111,6 +113,10 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
[
"dist/index.js",
"dist/index.js.map",
"dist/lint-test-gts.js",
"dist/lint-test-gts.js.map",
"dist/lint-test-ts.js",
"dist/lint-test-ts.js.map",
"dist/template-registry.js",
"dist/template-registry.js.map",
"dist/components/another-gts.js",
Expand All @@ -124,6 +130,10 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
"dist/_app_/services/example.js",
"declarations/index.d.ts",
"declarations/index.d.ts.map",
"declarations/lint-test-gts.d.ts",
"declarations/lint-test-gts.d.ts.map",
"declarations/lint-test-ts.d.ts",
"declarations/lint-test-ts.d.ts.map",
"declarations/template-registry.d.ts",
"declarations/template-registry.d.ts.map",
"declarations/components/another-gts.d.ts",
Expand Down