Skip to content

Commit a513a4c

Browse files
authored
Merge pull request #475 from appuniversum/chore/fix-eslint-gts-setup
Apply the `@typescript-eslint/eslint-recommended` rules to .gts files
2 parents 3595665 + 2052b74 commit a513a4c

File tree

5 files changed

+71
-65
lines changed

5 files changed

+71
-65
lines changed

.eslintrc.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
'use strict';
22

3+
// Copied from https://github.com/ember-cli/eslint-plugin-ember/pull/2107/files
4+
const typescriptEslintRecommendedRules =
5+
require('@typescript-eslint/eslint-plugin').configs['eslint-recommended']
6+
.overrides[0].rules;
7+
38
module.exports = {
49
root: true,
510
parser: '@typescript-eslint/parser',
@@ -16,11 +21,12 @@ module.exports = {
1621
// ts files
1722
{
1823
files: ['**/*.{gts,ts}'],
19-
extends: [
20-
'plugin:@typescript-eslint/eslint-recommended',
21-
'plugin:@typescript-eslint/recommended',
22-
],
24+
extends: ['plugin:@typescript-eslint/recommended'],
2325
rules: {
26+
// https://github.com/ember-cli/eslint-plugin-ember/issues/2106
27+
// TODO: remove this when eslint-plugin-ember ships it, or when we switch to the flat config setup
28+
...typescriptEslintRecommendedRules,
29+
2430
// This works around an issue in Glint https://github.com/typed-ember/glint/issues/697
2531
// It also makes adding state to a component easier, since no other code changes would be needed.
2632
'ember/no-empty-glimmer-component-classes': 'off',

addon/components/au-alert.gts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class AuAlert extends Component<AuAlertSignature> {
2424
@tracked isVisible = true;
2525

2626
get skin() {
27-
let skin = this.args.skin;
27+
const { skin } = this.args;
2828

2929
if (skin === 'info') return 'au-c-alert--info';
3030
if (skin === 'success') return 'au-c-alert--success';
@@ -34,7 +34,7 @@ export default class AuAlert extends Component<AuAlertSignature> {
3434
}
3535

3636
get size() {
37-
let size = this.args.size;
37+
const { size } = this.args;
3838
if (size === 'tiny') return 'au-c-alert--tiny';
3939
if (size === 'small') return 'au-c-alert--small';
4040
return '';

package-lock.json

+56-56
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@
132132
"@types/inputmask": "^5.0.7",
133133
"@types/qunit": "^2.19.9",
134134
"@types/rsvp": "^4.0.8",
135-
"@typescript-eslint/eslint-plugin": "^6.14.0",
136-
"@typescript-eslint/parser": "^6.14.0",
135+
"@typescript-eslint/eslint-plugin": "^7.1.1",
136+
"@typescript-eslint/parser": "^7.1.1",
137137
"broccoli-asset-rev": "^3.0.0",
138138
"chromatic": "^6.5.4",
139139
"concurrently": "^8.2.2",

tests/integration/components/au-main-container-test.gts

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module('Integration | Component | au-main-container', function (hooks) {
8989
</template>,
9090
);
9191

92-
let containerElement = document.querySelector(
92+
const containerElement = document.querySelector(
9393
MAIN_CONTAINER.CONTENT,
9494
) as HTMLElement;
9595
assert.notStrictEqual(

0 commit comments

Comments
 (0)