Skip to content

Commit ceb68fb

Browse files
committed
Update linting dependencies & fix linting issues
1 parent 178dae7 commit ceb68fb

File tree

13 files changed

+518
-311
lines changed

13 files changed

+518
-311
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
sourceType: 'module',
88
},
99
plugins: ['ember', '@typescript-eslint', 'prettier'],
10-
extends: ['eslint:recommended', 'plugin:ember/recommended', 'prettier/@typescript-eslint'],
10+
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
1111
env: {
1212
browser: true,
1313
},

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
},
5252
"devDependencies": {
5353
"@ember/optional-features": "2.0.0",
54-
"@glimmer/component": "^1.0.0-beta.3",
55-
"@glimmer/tracking": "^1.0.0-beta.3",
54+
"@glimmer/component": "^1.0.4",
55+
"@glimmer/tracking": "^1.0.4",
5656
"@typed-ember/renovate-config": "1.2.1",
5757
"@types/capture-console": "1.0.1",
5858
"@types/chai": "4.3.0",
@@ -71,8 +71,8 @@
7171
"@types/qunit": "2.11.3",
7272
"@types/resolve": "1.20.1",
7373
"@types/semver": "7.3.9",
74-
"@typescript-eslint/eslint-plugin": "4.8.1",
75-
"@typescript-eslint/parser": "4.8.1",
74+
"@typescript-eslint/eslint-plugin": "5.10.1",
75+
"@typescript-eslint/parser": "5.10.1",
7676
"broccoli-asset-rev": "3.0.0",
7777
"broccoli-node-api": "1.7.0",
7878
"broccoli-plugin": "4.0.3",
@@ -97,11 +97,11 @@
9797
"ember-resolver": "8.0.2",
9898
"ember-source": "3.23.0",
9999
"ember-try": "1.4.0",
100-
"eslint": "7.13.0",
101-
"eslint-config-prettier": "6.15.0",
102-
"eslint-plugin-ember": "9.6.0",
100+
"eslint": "8.7.0",
101+
"eslint-config-prettier": "8.3.0",
102+
"eslint-plugin-ember": "10.5.8",
103103
"eslint-plugin-node": "11.1.0",
104-
"eslint-plugin-prettier": "3.1.4",
104+
"eslint-plugin-prettier": "4.0.0",
105105
"esprima": "4.0.1",
106106
"fixturify": "2.1.0",
107107
"got": "11.8.0",
@@ -110,8 +110,8 @@
110110
"in-repo-b": "link:tests/dummy/lib/in-repo-b",
111111
"loader.js": "4.7.0",
112112
"mocha": "8.2.1",
113-
"prettier": "2.1.2",
114-
"prettier-eslint": "11.0.0",
113+
"prettier": "2.5.1",
114+
"prettier-eslint": "13.0.0",
115115
"qunit-dom": "1.6.0",
116116
"rimraf": "3.0.2",
117117
"testdouble": "3.16.1",

tests/dummy/app/app.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import Resolver from './resolver';
33
import loadInitializers from 'ember-load-initializers';
44
import config from './config/environment';
55

6-
const App = Application.extend({
7-
modulePrefix: config.modulePrefix,
8-
podModulePrefix: config.podModulePrefix,
9-
Resolver,
10-
});
6+
class App extends Application {
7+
modulePrefix = config.modulePrefix;
8+
podModulePrefix = config.podModulePrefix;
9+
Resolver = Resolver;
10+
}
1111

1212
loadInitializers(App, config.modulePrefix);
1313

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div style="border: 2px solid black;width: 100%; background-color: azure; margin-top: 20px; padding: 0 0 20px 20px">
22
<p style="margin-top: 0px; border-bottom: chocolate 1px solid">js-importing-ts.hbs</p>
3-
{{poke}}
3+
{{this.poke}}
44
<p>Ts helper: {{typed-help}}</p>
55
<p>Js helper: {{js-help}}</p>
66
</div>
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import Component from '@ember/component';
2-
import { equal } from '@ember/object/computed';
1+
import Component from '@glimmer/component';
32

43
import * as constants from '../lib/some-const';
54

6-
export default Component.extend({
7-
poke: equal('ha', constants.CHANGE),
8-
});
5+
export default class JsImportingTs extends Component {
6+
get poke() {
7+
return constants.CHANGE === 'ha';
8+
}
9+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Component from '@ember/component';
1+
import Component from '@glimmer/component';
22

3-
export default Component.extend({
4-
someValue: 'from component',
5-
});
3+
export default class TestOne extends Component {
4+
someValue = 'from component';
5+
}

tests/dummy/app/templates/components/ts-component.hbs renamed to tests/dummy/app/components/ts-component.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div style="border: 2px solid black;width: 100%; background-color: azure; margin-top: 20px; padding: 0 0 20px 20px">
22
<p style="margin-top: 0px; border-bottom: chocolate 1px solid">ts-component.hbs</p>
3-
{{#if someValue}}
4-
Component defines <b>someValue</b> property as: {{someValue}}
3+
{{#if this.someValue}}
4+
Component defines <b>someValue</b> property as: {{this.someValue}}
55
{{else}}
66
<span style="color:red">Missing <b>someValue</b> property, expected to be defined by the component.</span>
77
{{/if}}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import Component from '@ember/component';
1+
import Component from '@glimmer/component';
22

33
function compute(): { value: string } {
44
return { value: 'from component' };
55
}
66

7-
export default Component.extend({
8-
someValue: compute().value,
9-
});
7+
export default class TsComponent extends Component {
8+
someValue = compute().value;
9+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Controller from '@ember/controller';
22

3-
export default Controller.extend({
3+
export default class ApplicationController extends Controller {
44
// Just a very roundabout way of using some ES6 features
5-
value: ((test = 'Test') => `${test} ${'Value'}`)(),
6-
foo: 'hello',
7-
});
5+
value = ((test = 'Test') => `${test} ${'Value'}`)();
6+
foo = 'hello';
7+
}

tests/dummy/app/router.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import EmberRouter from '@ember/routing/router';
22
import config from './config/environment';
33

4-
const Router = EmberRouter.extend({
5-
location: config.locationType,
6-
rootURL: config.rootURL,
7-
});
4+
class Router extends EmberRouter {
5+
location = config.locationType;
6+
rootURL = config.rootURL;
7+
}
88

99
Router.map(function () {});
1010

tests/dummy/app/templates/components/.gitkeep

Whitespace-only changes.

ts/tests/acceptance/build-test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ function isExpressionStatement(stmt: Statement | ModuleDeclaration): stmt is Exp
160160
return stmt.type === 'ExpressionStatement';
161161
}
162162

163-
function isSpecialCallExpression(
164-
expr: Expression
165-
): expr is CallExpression & {
163+
function isSpecialCallExpression(expr: Expression): expr is CallExpression & {
166164
arguments: [Literal, Expression, ClassExpression];
167165
} {
168166
return (

0 commit comments

Comments
 (0)