-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathember.js
88 lines (82 loc) · 2.54 KB
/
ember.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
'use strict';
// This configuration is intended for use in Ember applications.
const ASYNC_EMBER_TEST_HELPERS = require('../utils/async-ember-test-helpers');
module.exports = {
extends: [
require.resolve('./base'),
'plugin:ember/recommended',
'plugin:qunit/recommended',
],
plugins: ['ember', 'qunit'],
rules: {
// Optional eslint rules:
'no-console': 'error',
// Optional Ember rules:
'ember/no-empty-attrs': 'error',
'ember/no-proxies': 'error',
'ember/no-replace-test-comments': 'error',
'ember/no-unnecessary-service-injection-argument': 'error',
'ember/route-path-style': 'error',
// QUnit rules:
'qunit/require-expect': ['error', 'never-except-zero'],
// Our custom rules:
'square/no-assert-ok-find': 'error',
'square/no-test-return-value': 'error',
'square/no-translation-key-interpolation': 'error',
'square/use-call-count-test-assert': 'error',
'square/use-ember-find': 'error',
},
overrides: [
{
files: ['app/router.{js,ts}', 'tests/dummy/app/router.{js,ts}'],
rules: {
'array-callback-return': 'off', // This trips on `Router.map(...)` in Ember routers so just disable it for that file.
},
},
{
// Test files:
files: ['addon-test-support/**/*.{js,ts}', 'tests/**/*.{js,ts}'],
rules: {
'square/require-await-function': [
'error',
{ functions: ASYNC_EMBER_TEST_HELPERS },
],
},
},
{
files: [
'**/{app,addon}/{components,controllers,routes,services}/**/*.{js,ts}',
],
rules: {
/**
* Turn this rule off for these file types because it does not support Ember's blueprint generator naming convention.
*
* Example:
*
* Running this command:
* ember generate component hello-world
* Produces a file with:
* export default class HelloWorldComponent extends Component {}
* But this rule expects the class to be named "HelloWorld".
*/
'filenames/match-exported': 'off',
},
},
{
files: ['**/dummy/app/config/environment.d.ts'],
rules: {
/**
* environment.d.ts is generated from the ember-cli-typescript blueprint
*/
'filenames/match-exported': 'off',
},
},
{
files: ['**/types/dummy/index.d.ts'],
rules: {
// Allow placeholder addon dummy app types file generated by ember-cli-typescript blueprint.
'unicorn/no-empty-file': 'off',
},
},
],
};