Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply the @typescript-eslint/eslint-recommended rules to .gts files #475

Merged
merged 2 commits into from
Mar 11, 2024
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
14 changes: 10 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';

// Copied from https://github.com/ember-cli/eslint-plugin-ember/pull/2107/files
const typescriptEslintRecommendedRules =
require('@typescript-eslint/eslint-plugin').configs['eslint-recommended']
.overrides[0].rules;

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
Expand All @@ -16,11 +21,12 @@ module.exports = {
// ts files
{
files: ['**/*.{gts,ts}'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is already part of the @typescript-eslint/recommended config, and we don't really need it in either case, since we include the rules ourselves now.

'plugin:@typescript-eslint/recommended',
],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
// https://github.com/ember-cli/eslint-plugin-ember/issues/2106
// TODO: remove this when eslint-plugin-ember ships it, or when we switch to the flat config setup
...typescriptEslintRecommendedRules,

// This works around an issue in Glint https://github.com/typed-ember/glint/issues/697
// It also makes adding state to a component easier, since no other code changes would be needed.
'ember/no-empty-glimmer-component-classes': 'off',
Expand Down
4 changes: 2 additions & 2 deletions addon/components/au-alert.gts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class AuAlert extends Component<AuAlertSignature> {
@tracked isVisible = true;

get skin() {
let skin = this.args.skin;
const { skin } = this.args;

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

get size() {
let size = this.args.size;
const { size } = this.args;
if (size === 'tiny') return 'au-c-alert--tiny';
if (size === 'small') return 'au-c-alert--small';
return '';
Expand Down
112 changes: 56 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
"@types/inputmask": "^5.0.7",
"@types/qunit": "^2.19.9",
"@types/rsvp": "^4.0.8",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"broccoli-asset-rev": "^3.0.0",
"chromatic": "^6.5.4",
"concurrently": "^8.2.2",
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/au-main-container-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module('Integration | Component | au-main-container', function (hooks) {
</template>,
);

let containerElement = document.querySelector(
const containerElement = document.querySelector(
MAIN_CONTAINER.CONTENT,
) as HTMLElement;
assert.notStrictEqual(
Expand Down
Loading