Skip to content

Commit 7aace31

Browse files
authored
Merge pull request #9125 from emberjs/test-linting/all-the-eslints
2 parents 5a8560a + caf0ad8 commit 7aace31

File tree

263 files changed

+4507
-3782
lines changed

Some content is hidden

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

263 files changed

+4507
-3782
lines changed

config/eslint/diagnostic.cjs

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const isolation = require('./isolation.cjs');
2+
3+
function defaults(config = {}) {
4+
return {
5+
files: config.files || ['tests/**/*-test.{js,ts}'],
6+
// HACK: diagnostic API significantly overlaps with the qunit API, so we're
7+
// using the qunit plugin to lint diagnostic files.
8+
extends: ['plugin:qunit/recommended'],
9+
rules: Object.assign(
10+
isolation.rules({
11+
allowedImports: ['@ember/debug', '@ember/test-helpers', ...(config.allowedImports ?? [])],
12+
}),
13+
config?.rules,
14+
{
15+
'qunit/no-assert-equal': 'off',
16+
'qunit/no-assert-logical-expression': 'off',
17+
'qunit/no-conditional-assertions': 'off',
18+
'qunit/no-early-return': 'off',
19+
'qunit/no-ok-equality': 'off',
20+
'qunit/require-expect': 'off',
21+
}
22+
),
23+
};
24+
}
25+
26+
function config() {
27+
return {
28+
files: ['./diagnostic.js'],
29+
parserOptions: {
30+
sourceType: 'module',
31+
ecmaVersion: 2022,
32+
},
33+
env: {
34+
browser: false,
35+
node: true,
36+
es6: true,
37+
},
38+
plugins: ['n'],
39+
extends: 'plugin:n/recommended',
40+
rules: {
41+
// It's ok to use unpublished files here since we don't ship these
42+
'n/no-unpublished-require': 'off',
43+
// TODO: '@warp-drive/diagnostic/server/default-setup.js' keeps setting these off
44+
'n/no-missing-import': 'off',
45+
'n/no-unpublished-import': 'off',
46+
},
47+
};
48+
}
49+
50+
module.exports = {
51+
config,
52+
defaults,
53+
};

config/eslint/node.cjs

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
function defaults(config) {
22
const result = {
3-
files: !config?.useModules ? ['./index.js', './addon-main.cjs', './addon-main.js'] : [],
3+
files: !config?.useModules
4+
? ['./index.js', './addon-main.cjs', './addon-main.js', './config/environment.js', './config/targets.js']
5+
: [],
46
parserOptions: {
57
sourceType: config?.useModules ? 'module' : 'script',
68
ecmaVersion: 2022,
9+
...(config?.parserOptions ?? {}),
710
},
811
env: {
912
browser: false,
@@ -24,7 +27,14 @@ function defaults(config) {
2427

2528
function config(config) {
2629
const result = {
27-
files: ['./babel.config.js', './.eslintrc.cjs', './rollup.config.mjs'],
30+
files: [
31+
'./.eslintrc.cjs',
32+
'./babel.config.js',
33+
'./ember-cli-build.js',
34+
'./rollup.config.mjs',
35+
'./testem.js',
36+
'./config/ember-try.js',
37+
],
2838
parserOptions: {
2939
sourceType: config?.useModules ? 'module' : 'script',
3040
ecmaVersion: 2022,

config/eslint/qunit.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ function defaults(config = {}) {
99
allowedImports: [
1010
'@ember/debug',
1111
'@ember/test-helpers',
12+
'@ember/test-waiters',
1213
'ember-qunit',
1314
'qunit',
1415
...(config.allowedImports ?? []),
1516
],
1617
}),
1718
config?.rules,
1819
{
20+
'qunit/no-assert-logical-expression': 'off',
21+
'qunit/no-conditional-assertions': 'off',
22+
'qunit/no-early-return': 'off',
1923
'qunit/no-ok-equality': 'off',
24+
'qunit/require-expect': 'off',
2025
}
2126
),
2227
};

packages/holodeck/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"holodeck": "./bin/holodeck.js"
4242
},
4343
"scripts": {
44-
"build:types": "tsc --build",
44+
"build:types": "tsc --build --force",
4545
"build:client": "rollup --config",
4646
"_build": "bun run build:client && bun run build:types",
4747
"start": "rollup --config --watch",

0 commit comments

Comments
 (0)