-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy patheslint.config.mjs
102 lines (93 loc) · 3.16 KB
/
eslint.config.mjs
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// @ts-check
import { globalIgnores } from '@warp-drive/internal-config/eslint/ignore.js';
import * as node from '@warp-drive/internal-config/eslint/node.js';
import * as typescript from '@warp-drive/internal-config/eslint/typescript.js';
import * as qunit from '@warp-drive/internal-config/eslint/qunit.js';
import * as js from '@warp-drive/internal-config/eslint/browser.js';
import * as gts from '@warp-drive/internal-config/eslint/gts.js';
const AllowedImports = [
'@ember/application',
'@ember/array',
'@ember/array/proxy',
'@ember/component',
'@ember/component/helper',
'@ember/controller',
'@ember/object',
'@ember/object/computed',
'@ember/object/mixin',
'@ember/owner',
'@ember/routing/route',
'@ember/runloop',
'@ember/service',
'@ember/test-helpers',
'@ember/test-waiters',
'@glimmer/component',
'@glimmer/tracking',
'qunit',
];
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
// all ================
globalIgnores(),
// browser (js) ================
js.browser({
srcDirs: ['app', 'tests'],
allowedImports: AllowedImports,
globals: { gc: true },
}),
// browser (js/ts) ================
typescript.browser({
srcDirs: ['app', 'tests'],
allowedImports: AllowedImports,
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
},
}),
// gts
gts.browser({
srcDirs: ['app', 'tests'],
allowedImports: AllowedImports,
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
},
}),
// files converted to strict must pass these rules before they can be removed from
// the files list here
// see https://github.com/emberjs/data/issues/6233#issuecomment-849279594
{
files: [
'tests/helpers/accessors.ts',
'tests/integration/identifiers/configuration-test.ts',
'tests/integration/identifiers/new-records-test.ts',
// 'tests/integration/identifiers/polymorphic-scenarios-test.ts',
'tests/integration/identifiers/record-identifier-for-test.ts',
'tests/integration/identifiers/scenarios-test.ts',
'tests/integration/model-errors-test.ts',
'tests/integration/record-data/record-data-errors-test.ts',
'tests/integration/record-data/record-data-state-test.ts',
'tests/integration/record-data/record-data-test.ts',
'tests/integration/record-data/store-wrapper-test.ts',
'tests/integration/relationships/rollback-test.ts',
'tests/integration/request-state-service-test.ts',
'tests/unit/custom-class-support/custom-class-model-test.ts',
],
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
},
},
// node (module) ================
node.esm(),
// node (script) ================
node.cjs(),
// Test Support ================
qunit.ember({
allowedImports: AllowedImports,
}),
];