Skip to content

Commit

Permalink
Merge pull request #9125 from emberjs/test-linting/all-the-eslints
Browse files Browse the repository at this point in the history
  • Loading branch information
gitKrystan authored Nov 20, 2023
2 parents 5a8560a + caf0ad8 commit 7aace31
Show file tree
Hide file tree
Showing 263 changed files with 4,507 additions and 3,782 deletions.
53 changes: 53 additions & 0 deletions config/eslint/diagnostic.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const isolation = require('./isolation.cjs');

function defaults(config = {}) {
return {
files: config.files || ['tests/**/*-test.{js,ts}'],
// HACK: diagnostic API significantly overlaps with the qunit API, so we're
// using the qunit plugin to lint diagnostic files.
extends: ['plugin:qunit/recommended'],
rules: Object.assign(
isolation.rules({
allowedImports: ['@ember/debug', '@ember/test-helpers', ...(config.allowedImports ?? [])],
}),
config?.rules,
{
'qunit/no-assert-equal': 'off',
'qunit/no-assert-logical-expression': 'off',
'qunit/no-conditional-assertions': 'off',
'qunit/no-early-return': 'off',
'qunit/no-ok-equality': 'off',
'qunit/require-expect': 'off',
}
),
};
}

function config() {
return {
files: ['./diagnostic.js'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2022,
},
env: {
browser: false,
node: true,
es6: true,
},
plugins: ['n'],
extends: 'plugin:n/recommended',
rules: {
// It's ok to use unpublished files here since we don't ship these
'n/no-unpublished-require': 'off',
// TODO: '@warp-drive/diagnostic/server/default-setup.js' keeps setting these off
'n/no-missing-import': 'off',
'n/no-unpublished-import': 'off',
},
};
}

module.exports = {
config,
defaults,
};
14 changes: 12 additions & 2 deletions config/eslint/node.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
function defaults(config) {
const result = {
files: !config?.useModules ? ['./index.js', './addon-main.cjs', './addon-main.js'] : [],
files: !config?.useModules
? ['./index.js', './addon-main.cjs', './addon-main.js', './config/environment.js', './config/targets.js']
: [],
parserOptions: {
sourceType: config?.useModules ? 'module' : 'script',
ecmaVersion: 2022,
...(config?.parserOptions ?? {}),
},
env: {
browser: false,
Expand All @@ -24,7 +27,14 @@ function defaults(config) {

function config(config) {
const result = {
files: ['./babel.config.js', './.eslintrc.cjs', './rollup.config.mjs'],
files: [
'./.eslintrc.cjs',
'./babel.config.js',
'./ember-cli-build.js',
'./rollup.config.mjs',
'./testem.js',
'./config/ember-try.js',
],
parserOptions: {
sourceType: config?.useModules ? 'module' : 'script',
ecmaVersion: 2022,
Expand Down
5 changes: 5 additions & 0 deletions config/eslint/qunit.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ function defaults(config = {}) {
allowedImports: [
'@ember/debug',
'@ember/test-helpers',
'@ember/test-waiters',
'ember-qunit',
'qunit',
...(config.allowedImports ?? []),
],
}),
config?.rules,
{
'qunit/no-assert-logical-expression': 'off',
'qunit/no-conditional-assertions': 'off',
'qunit/no-early-return': 'off',
'qunit/no-ok-equality': 'off',
'qunit/require-expect': 'off',
}
),
};
Expand Down
2 changes: 1 addition & 1 deletion packages/holodeck/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"holodeck": "./bin/holodeck.js"
},
"scripts": {
"build:types": "tsc --build",
"build:types": "tsc --build --force",
"build:client": "rollup --config",
"_build": "bun run build:client && bun run build:types",
"start": "rollup --config --watch",
Expand Down
Loading

0 comments on commit 7aace31

Please sign in to comment.