-
-
Notifications
You must be signed in to change notification settings - Fork 204
/
eslint-remote-tester.config.js
67 lines (61 loc) · 2.03 KB
/
eslint-remote-tester.config.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
/* eslint filenames/match-regex:off */
const fs = require('fs');
/** @type {import('eslint-remote-tester').Config} */
module.exports = {
/** Repositories to scan */
repositories: [
// Several dozen top Ember apps, addons, and engines.
'DockYard/ember-composable-helpers',
'adopted-ember-addons/ember-cli-flash',
'adopted-ember-addons/ember-cli-sass',
'adopted-ember-addons/ember-cp-validations',
'adopted-ember-addons/ember-data-model-fragments',
'adopted-ember-addons/ember-electron',
'adopted-ember-addons/ember-moment',
'babel/ember-cli-babel',
'cibernox/ember-power-select',
'ef4/ember-auto-import',
'ember-cli/ember-cli',
'ember-cli/ember-cli-htmlbars',
'ember-decorators/ember-decorators',
'emberjs/data',
'emberjs/ember-qunit',
'emberjs/ember.js',
'jmurphyau/ember-truth-helpers',
'machty/ember-concurrency',
'miragejs/ember-cli-mirage',
'typed-ember/ember-cli-typescript',
],
/** Extensions of files under scanning */
extensions: ['js', 'ts'],
/** Optional boolean flag used to enable caching of cloned repositories. For CIs it's ideal to disable caching. Defaults to true. */
cache: false,
/** ESLint configuration */
eslintrc: {
plugins: ['ember'],
// Enable all of our rules.
rules: Object.fromEntries(
fs
.readdirSync(`${__dirname}/lib/rules`)
.map((filename) => `ember/${filename.replace(/\.js$/, '')}`)
.map((ruleName) => {
let value;
// A few rules require additional configuration.
if (ruleName === 'ember/no-restricted-property-modifications') {
value = ['error', { properties: ['myProp'] }];
} else if (ruleName === 'ember/no-restricted-service-injections') {
value = ['error', { services: ['my-service'] }];
} else {
value = 'error';
}
return [ruleName, value];
})
),
overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
},
],
},
};