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

#43: Upgrade to latest eslint-plugin-ember, remove eslint-disable, and make --fix work again #181

Merged
merged 1 commit into from
Jun 14, 2023
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
2 changes: 1 addition & 1 deletion docs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"ember-template-lint": "^5.8.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^11.4.3",
"eslint-plugin-ember": "^11.8.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-qunit": "^7.3.1",
Expand Down
7 changes: 2 additions & 5 deletions docs-app/tests/acceptance/button-test.gts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/* eslint-disable no-undef -- Until https://github.com/ember-cli/eslint-plugin-ember/issues/1747 is resolved... */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I can also get rid of this now due to glimmerjs/glimmer-vm#1406 being merged, but I'll test that out and put up a separate PR for those changes to keep these focused on the --fix path

/* eslint-disable simple-import-sort/imports,padding-line-between-statements,decorator-position/decorator-position -- Can't fix these manually, without --fix working in .gts */
import { currentURL, visit } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';

module('Acceptance | Button', function (hooks) {
setupApplicationTest(hooks);

test('visiting the button page', async function (assert) {

await visit('/docs/components/button')
await visit('/docs/components/button');
assert.strictEqual(currentURL(), '/docs/components/button');
});

});
2 changes: 1 addition & 1 deletion packages/ember-toucan-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"ember-template-lint": "^5.8.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^11.4.3",
"eslint-plugin-ember": "^11.8.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ember-toucan-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"ember-template-lint": "^5.8.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^11.4.3",
"eslint-plugin-ember": "^11.8.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
Expand Down
80 changes: 32 additions & 48 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"ember-try": "^2.0.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^11.4.3",
"eslint-plugin-ember": "^11.8.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-undef -- Until https://github.com/ember-cli/eslint-plugin-ember/issues/1747 is resolved... */
/* eslint-disable simple-import-sort/imports,padding-line-between-statements,decorator-position/decorator-position -- Can't fix these manually, without --fix working in .gts */

import { click, find, render, setupOnerror } from '@ember/test-helpers';
import { module, test } from 'qunit';
Expand Down Expand Up @@ -73,6 +72,7 @@ module('Integration | Component | Fields | CheckboxField', function (hooks) {
assert.dom(error).hasAttribute('id');

let errorId = error?.getAttribute('id') || '';

assert.ok(errorId, 'Expected errorId to be truthy');

// For the checkbox-field component, the only aria-describedby
Expand All @@ -81,6 +81,7 @@ module('Integration | Component | Fields | CheckboxField', function (hooks) {
// wrapping <label> element
let describedby =
find('[data-checkbox]')?.getAttribute('aria-describedby') || '';

assert.ok(
describedby.includes(errorId),
'Expected errorId to be included in the aria-describedby'
Expand All @@ -99,6 +100,7 @@ module('Integration | Component | Fields | CheckboxField', function (hooks) {
</template>);

let labelFor = find('[data-control] > label')?.getAttribute('for') || '';

assert.ok(labelFor, 'Expected the id attribute of the label to be truthy');

assert
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-undef -- Until https://github.com/ember-cli/eslint-plugin-ember/issues/1747 is resolved... */
/* eslint-disable simple-import-sort/imports,padding-line-between-statements,decorator-position/decorator-position -- Can't fix these manually, without --fix working in .gts */

import { click, render, setupOnerror } from '@ember/test-helpers';
import { module, test } from 'qunit';
Expand Down
2 changes: 0 additions & 2 deletions test-app/tests/integration/components/checkbox-test.gts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-disable no-undef -- Until https://github.com/ember-cli/eslint-plugin-ember/issues/1747 is resolved... */
/* eslint-disable simple-import-sort/imports,padding-line-between-statements,decorator-position/decorator-position -- Can't fix these manually, without --fix working in .gts */

import { click, render } from '@ember/test-helpers';
import { module, test } from 'qunit';

Expand Down
3 changes: 1 addition & 2 deletions test-app/tests/integration/components/field-test.gts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-disable no-undef -- Until https://github.com/ember-cli/eslint-plugin-ember/issues/1747 is resolved... */
/* eslint-disable simple-import-sort/imports,padding-line-between-statements,decorator-position/decorator-position -- Can't fix these manually, without --fix working in .gts */

import { findAll, render } from '@ember/test-helpers';
import { module, test } from 'qunit';

Expand Down Expand Up @@ -65,6 +63,7 @@ module('Integration | Component | Field', function (hooks) {
assert.dom(label).hasText('label', 'Expected to have label text "label"');

const children = findAll('[data-test-field] > div');

assert.strictEqual(
children.length,
2,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable no-undef -- Until https://github.com/ember-cli/eslint-plugin-ember/issues/1747 is resolved... */
/* eslint-disable simple-import-sort/imports,padding-line-between-statements,decorator-position/decorator-position -- Can't fix these manually, without --fix working in .gts */
import { find, render, setupOnerror, triggerEvent } from '@ember/test-helpers';
import { tracked } from '@glimmer/tracking';
import { find, render, setupOnerror, triggerEvent } from '@ember/test-helpers';
import { module, test } from 'qunit';

import FileInputField from '@crowdstrike/ember-toucan-core/components/form/fields/file-input';
Expand Down Expand Up @@ -129,6 +128,7 @@ module('Integration | Component | Fields | FileInput', function (hooks) {
assert.dom(error).hasAttribute('id');

let errorId = error?.getAttribute('id') ?? '';

assert.ok(errorId, 'Expected errorId to be truthy');

// For the file input field component, the only aria-describedby
Expand All @@ -137,6 +137,7 @@ module('Integration | Component | Fields | FileInput', function (hooks) {
// wrapping <label> element
let describedby =
find('[data-file-input-field]')?.getAttribute('aria-describedby') ?? '';

assert.ok(
describedby.includes(errorId),
'Expected errorId to be included in the aria-describedby'
Expand All @@ -161,6 +162,7 @@ module('Integration | Component | Fields | FileInput', function (hooks) {
</template>);

let labelFor = find('label')?.getAttribute('for') ?? '';

assert.ok(labelFor, 'Expected the id attribute of the label to be truthy');

assert
Expand Down Expand Up @@ -336,10 +338,12 @@ module('Integration | Component | Fields | FileInput', function (hooks) {
}

let ctx = new Context();

ctx.triggerText = 'Browse Files';

const realOnChange = (files: File[]) => {
ctx.currentFiles = files;

if (ctx.currentFiles.length > 0) {
ctx.triggerText = 'Replace files';
}
Expand Down
Loading