Skip to content

Commit 4054604

Browse files
Ember 3.26 (#855)
* Ember 3.26 * Fix lint * Update ember-try.js
1 parent fd8efcb commit 4054604

File tree

115 files changed

+2013
-1374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2013
-1374
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# misc
1414
/coverage/
1515
!.*
16+
.eslintcache
1617

1718
# ember-try
1819
/.node_modules.ember-try/

.eslintrc.js

+26-21
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,44 @@
22

33
module.exports = {
44
globals: {
5-
server: true
5+
server: true,
66
},
77
root: true,
88
parser: 'babel-eslint',
99
parserOptions: {
1010
ecmaVersion: 2018,
1111
sourceType: 'module',
1212
ecmaFeatures: {
13-
legacyDecorators: true
14-
}
13+
legacyDecorators: true,
14+
},
1515
},
16-
plugins: [
17-
'ember'
18-
],
16+
plugins: ['ember'],
1917
extends: [
2018
'eslint:recommended',
21-
'plugin:ember/recommended'
19+
'plugin:ember/recommended',
20+
'plugin:prettier/recommended',
2221
],
2322
env: {
24-
browser: true
23+
browser: true,
2524
},
2625
rules: {
2726
'no-unused-vars': ['error', { args: 'none' }],
2827
'no-console': ['error', { allow: ['warn', 'error'] }],
2928
'ember/no-incorrect-calls-with-inline-anonymous-functions': 'off',
3029
'ember/require-return-from-computed': 'off',
3130
'ember/no-jquery': 'error',
32-
// ember-keyboard uses events
33-
'ember/no-on-calls-in-components': 'off',
3431

3532
// TODO: enable these rules
33+
'ember/classic-decorator-no-classic-methods': 'off',
34+
'ember/no-actions-hash': 'off',
35+
'ember/no-classic-classes': 'off',
36+
'ember/no-classic-components': 'off',
37+
'ember/no-component-lifecycle-hooks': 'off',
38+
'ember/no-computed-properties-in-native-classes': 'off',
3639
'ember/no-get': 'off',
37-
'ember/no-private-routing-service': 'off'
40+
'ember/no-private-routing-service': 'off',
41+
'ember/no-string-prototype-extensions': 'off',
42+
'ember/require-tagless-components': 'off',
3843
},
3944
overrides: [
4045
// node files
@@ -51,23 +56,23 @@ module.exports = {
5156
'config/**/*.js',
5257
'lib/**/*.js',
5358
'tests/dummy/config/**/*.js',
54-
'tests-node/**/*.js'
59+
'tests-node/**/*.js',
5560
],
5661
excludedFiles: [
5762
'addon/**',
5863
'addon-test-support/**',
5964
'app/**',
60-
'tests/dummy/app/**'
65+
'tests/dummy/app/**',
6166
],
6267
parserOptions: {
63-
sourceType: 'script'
68+
sourceType: 'script',
6469
},
6570
env: {
6671
browser: false,
67-
node: true
72+
node: true,
6873
},
6974
plugins: ['node'],
70-
extends: ['plugin:node/recommended']
75+
extends: ['plugin:node/recommended'],
7176
},
7277

7378
// node test files
@@ -76,12 +81,12 @@ module.exports = {
7681
describe: true,
7782
it: true,
7883
beforeEach: true,
79-
afterEach: true
84+
afterEach: true,
8085
},
8186
files: ['tests-node/**/*.js'],
8287
rules: {
83-
'node/no-unpublished-require': 'off'
84-
}
85-
}
86-
]
88+
'node/no-unpublished-require': 'off',
89+
},
90+
},
91+
],
8792
};

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/.env*
1313
/.pnp*
1414
/.sass-cache
15+
/.eslintcache
1516
/connect.lock
1617
/coverage/
1718
/libpeerconnection.log

.npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
/.editorconfig
1111
/.ember-cli
1212
/.env*
13+
/.eslintcache
1314
/.eslintignore
1415
/.eslintrc.js
1516
/.git/
1617
/.gitignore
18+
/.prettierignore
19+
/.prettierrc.js
1720
/.template-lintrc.js
1821
/.watchmanconfig
1922
/bower.json

.prettierignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
/vendor/
4+
5+
# compiled output
6+
/dist/
7+
/tmp/
8+
9+
# dependencies
10+
/bower_components/
11+
/node_modules/
12+
13+
# misc
14+
/coverage/
15+
!.*
16+
.eslintcache
17+
18+
# ember-try
19+
/.node_modules.ember-try/
20+
/bower.json.ember-try
21+
/package.json.ember-try

.prettierrc.js

-10
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,4 @@
22

33
module.exports = {
44
singleQuote: true,
5-
trailingComma: 'none',
6-
overrides: [
7-
{
8-
files: '**/*.hbs',
9-
options: {
10-
parser: 'glimmer',
11-
singleQuote: false
12-
}
13-
}
14-
]
155
};

.template-lintrc.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ module.exports = {
44
extends: 'recommended',
55
rules: {
66
// TODO: fix these and enable octane
7+
'no-action': false,
8+
'no-curly-component-invocation': false,
9+
'no-duplicate-id': false,
710
'no-extra-mut-helper-argument': false,
11+
'no-implicit-this': false,
812
'no-inline-styles': false,
913
'no-invalid-interactive': false,
1014
'no-negated-condition': false,
1115
'no-triple-curlies': false,
12-
'require-button-type': false
13-
}
16+
'no-yield-only': false,
17+
'require-button-type': false,
18+
'require-input-label': false,
19+
},
1420
};

CONTRIBUTING.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
## Linting
1010

11-
* `yarn lint:hbs`
12-
* `yarn lint:js`
13-
* `yarn lint:js --fix`
11+
* `yarn lint`
12+
* `yarn lint:fix`
1413

1514
## Running tests
1615

addon/adapters/-addon-docs.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ export default Adapter.extend({
1616

1717
findRecord(store, modelClass, id, snapshot) {
1818
if (modelClass.modelName === 'project') {
19-
return fetch(`${this.namespace}/${id}.json`).then((response) => response.json());
19+
return fetch(`${this.namespace}/${id}.json`).then((response) =>
20+
response.json()
21+
);
2022
} else {
2123
return store.peekRecord(modelClass.modelName, id);
2224
}
23-
}
25+
},
2426
});

addon/breakpoints.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default {
2-
mobile: '(max-width: 767px)',
3-
tablet: '(min-width: 768px) and (max-width: 991px)',
4-
desktop: '(min-width: 992px) and (max-width: 1200px)'
2+
mobile: '(max-width: 767px)',
3+
tablet: '(min-width: 768px) and (max-width: 991px)',
4+
desktop: '(min-width: 992px) and (max-width: 1200px)',
55
};

addon/components/api/x-class/component.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Component from '@ember/component';
22
import { computed } from '@ember/object';
33
import { or } from '@ember/object/computed';
44
import { capitalize } from '@ember/string';
5-
import { memberFilter } from '../../../utils/computed';
5+
import { memberFilter } from '../../../utils/computed';
66
import config from 'ember-get-config';
77

88
const { showImportPaths } = config['ember-cli-addon-docs'];
@@ -28,22 +28,24 @@ export default Component.extend({
2828
'component.hasInherited',
2929
'component.hasProtected',
3030
'component.hasPrivate',
31-
'component.hasDeprecated',
31+
'component.hasDeprecated'
3232
),
3333

3434
hasContents: computed('class', {
3535
get() {
3636
let klass = this.class;
3737

38-
return klass.get('allFields.length') > 0
39-
|| klass.get('allAccessors.length') > 0
40-
|| klass.get('allMethods.length') > 0;
41-
}
38+
return (
39+
klass.get('allFields.length') > 0 ||
40+
klass.get('allAccessors.length') > 0 ||
41+
klass.get('allMethods.length') > 0
42+
);
43+
},
4244
}),
4345

4446
actions: {
4547
updateFilter(filter, { target: { checked } }) {
4648
this.set(`show${capitalize(filter)}`, checked);
47-
}
48-
}
49+
},
50+
},
4951
});

addon/components/api/x-component/component.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Component from '@ember/component';
22
import { computed } from '@ember/object';
33
import { alias, or } from '@ember/object/computed';
44
import { capitalize } from '@ember/string';
5-
import { memberFilter } from '../../../utils/computed';
5+
import { memberFilter } from '../../../utils/computed';
66

77
import layout from './template';
88

@@ -28,24 +28,26 @@ export default Component.extend({
2828
'component.hasInternal',
2929
'component.hasProtected',
3030
'component.hasPrivate',
31-
'component.hasDeprecated',
31+
'component.hasDeprecated'
3232
),
3333

3434
hasContents: computed('component', {
3535
get() {
3636
let component = this.component;
3737

38-
return component.get('overloadedYields.length') > 0
39-
|| component.get('arguments.length') > 0
40-
|| component.get('fields.length') > 0
41-
|| component.get('accessors.length') > 0
42-
|| component.get('methods.length') > 0;
43-
}
38+
return (
39+
component.get('overloadedYields.length') > 0 ||
40+
component.get('arguments.length') > 0 ||
41+
component.get('fields.length') > 0 ||
42+
component.get('accessors.length') > 0 ||
43+
component.get('methods.length') > 0
44+
);
45+
},
4446
}),
4547

4648
actions: {
4749
updateFilter(filter, { target: { checked } }) {
4850
this.set(`show${capitalize(filter)}`, checked);
49-
}
50-
}
51+
},
52+
},
5153
});

addon/components/api/x-section/component.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export default Component.extend({
2222
* @function
2323
* @hide
2424
*/
25-
shouldDisplayParams: computed('item.params.[]', function() {
25+
shouldDisplayParams: computed('item.params.[]', function () {
2626
let params = this.get('item.params') || [];
2727

28-
return params.some(p => p.description || p.name.includes('.'));
28+
return params.some((p) => p.description || p.name.includes('.'));
2929
}),
3030
});

addon/components/api/x-toggles/component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import layout from './template';
33

44
export default Component.extend({
55
layout,
6-
tagName: ''
6+
tagName: '',
77
});

addon/components/docs-code-highlight/component.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import classic from 'ember-classic-decorator';
2-
import { classNameBindings, tagName, layout as templateLayout } from '@ember-decorators/component';
2+
import {
3+
classNameBindings,
4+
tagName,
5+
layout as templateLayout,
6+
} from '@ember-decorators/component';
37
import Component from '@ember/component';
48
import layout from './template';
59
import hljs from 'highlight.js/lib/core';

addon/components/docs-demo/component.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,15 @@ export default class DocsDemo extends Component {
6060
get snippets() {
6161
let activeSnippet = this.activeSnippet;
6262

63-
return this.snippetRegistrations
64-
.map(({ name, label, language }) => {
65-
let defaults = this.defaultsFromName(name);
66-
return {
67-
name,
68-
isActive: activeSnippet === name,
69-
label: label || defaults.label,
70-
language: language || defaults.language
71-
};
72-
})
63+
return this.snippetRegistrations.map(({ name, label, language }) => {
64+
let defaults = this.defaultsFromName(name);
65+
return {
66+
name,
67+
isActive: activeSnippet === name,
68+
label: label || defaults.label,
69+
language: language || defaults.language,
70+
};
71+
});
7372
}
7473

7574
/**

addon/components/docs-demo/x-example/component.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import classic from 'ember-classic-decorator';
2-
import { classNames, layout as templateLayout } from '@ember-decorators/component';
2+
import {
3+
classNames,
4+
layout as templateLayout,
5+
} from '@ember-decorators/component';
36
import Component from '@ember/component';
47
import layout from './template';
58

addon/components/docs-demo/x-snippet/component.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@ import { scheduleOnce } from '@ember/runloop';
22
import Component from '@ember/component';
33

44
export default Component.extend({
5-
65
init() {
76
this._super(...arguments);
87

98
scheduleOnce('afterRender', () => {
10-
this.get('did-init')(this.getProperties('name', 'label', 'language'))
9+
this.get('did-init')(this.getProperties('name', 'label', 'language'));
1110
});
12-
}
13-
11+
},
1412
}).reopenClass({
15-
16-
positionalParams: ['name']
17-
13+
positionalParams: ['name'],
1814
});

0 commit comments

Comments
 (0)