Upgrade eslint (#3175)
* chore: 🤖 Upgrade eslint config for admin ui * chore: 🤖 Fix eslint issues for admin * chore: 🤖 Upgrade eslint config for desktop * chore: 🤖 Fix linting errors in desktop * chore: 🤖 Upgrade eslint for api addon * chore: 🤖 Fix eslint issues in api addon * chore: 🤖 Upgrade eslint for auth addon * chore: 🤖 Fix eslint issues in auth addon * chore: 🤖 Upgrade core eslint config * chore: 🤖 Fix eslint issue for core addon * chore: 🤖 Upgrade eslint config for rose addon * chore: 🤖 Fix eslint issue for rose addon * chore: 🤖 Upgrade e2e eslint config * chore: 🤖 Fix eslint issues in e2e * chore: 🤖 Fix CI linting issues * chore: 🤖 Add back linting server files for the future * chore: 🤖 Update qunit rules to use extends
This commit is contained in:
1 parent
d6e8e58ca1
commit
999c21c66a
73 files changed
+1081
-922
No files matched your search
@@ -1,14 +0,0 @@
|
||||
# unconventional js
|
||||
/blueprints/*/files/
|
||||
|
||||
# compiled output
|
||||
/declarations/
|
||||
/dist/
|
||||
|
||||
# misc
|
||||
/coverage/
|
||||
!.*
|
||||
.*/
|
||||
|
||||
# ember-try
|
||||
/.node_modules.ember-try/
|
||||
@@ -1,69 +0,0 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: '@babel/eslint-parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
// This is specific babel-config. If grows consider creating a babel config file
|
||||
requireConfigFile: false,
|
||||
babelOptions: {
|
||||
plugins: [
|
||||
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
|
||||
],
|
||||
},
|
||||
// end of babel-config
|
||||
},
|
||||
plugins: ['ember'],
|
||||
extends: ['eslint:recommended', 'plugin:ember/recommended', 'prettier'],
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
rules: {
|
||||
curly: ['error', 'multi-line', 'consistent'],
|
||||
'ember/no-get': 'off',
|
||||
'ember/no-get-with-default': 'off',
|
||||
'ember/no-computed-properties-in-native-classes': 'off',
|
||||
'ember/no-assignment-of-untracked-properties-used-in-tracking-contexts':
|
||||
'off',
|
||||
},
|
||||
overrides: [
|
||||
// node files
|
||||
{
|
||||
files: [
|
||||
'./.eslintrc.js',
|
||||
'./.prettierrc.js',
|
||||
'./.stylelintrc.js',
|
||||
'./.template-lintrc.js',
|
||||
'./ember-cli-build.js',
|
||||
'./testem.js',
|
||||
'./blueprints/*/index.js',
|
||||
'./config/**/*.js',
|
||||
'./lib/*/index.js',
|
||||
'./server/**/*.js',
|
||||
],
|
||||
parserOptions: {
|
||||
sourceType: 'script',
|
||||
},
|
||||
env: {
|
||||
browser: false,
|
||||
node: true,
|
||||
},
|
||||
extends: ['plugin:n/recommended'],
|
||||
},
|
||||
{
|
||||
// test files
|
||||
files: ['tests/**/*-test.{js,ts}'],
|
||||
extends: ['plugin:qunit/recommended'],
|
||||
rules: {
|
||||
'qunit/require-expect': [2, 'except-simple'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -81,7 +81,7 @@ export default class FormTargetAddHostSetsComponent extends Component {
|
||||
confirm: 'resources.target.actions.remove-address',
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// if the user denies, do nothing and return
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export default class AccountChangePasswordController extends Controller {
|
||||
// TransitionAborted error, which we do not want to show to the user.
|
||||
try {
|
||||
await this.router.replaceWith('index');
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ class DevelopmentCanHelper extends CanHelper {
|
||||
|
||||
removeAllFlags() {
|
||||
this.features.flags.forEach((flag) =>
|
||||
/* eslint-disable-next-line ember/no-observers */
|
||||
this.features.removeObserver(flag, this, 'recompute'),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ async function autoInitializeFeatureEdition(owner) {
|
||||
|
||||
edition = json?.license?.edition;
|
||||
features = json?.license?.features;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// if the request fails, the service will initialize the default edition
|
||||
// as specified in the config
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export default class ApplicationRoute extends Route {
|
||||
});
|
||||
maybeModel?.rollbackAttributes();
|
||||
transition.retry();
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// if user denies, do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ export default class ScopesScopeSessionRecordingsIndexRoute extends Route {
|
||||
recursive: true,
|
||||
});
|
||||
return Boolean(storageBuckets.length);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// no op
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConne
|
||||
storage_bucket_id,
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// no op
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ export default class ScopesScopeWorkersWorkerCreateTagsRoute extends Route {
|
||||
});
|
||||
controller.set('apiTags', new TrackedArray([]));
|
||||
transition.retry();
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// if user denies, do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Copyright IBM Corp. 2021, 2026
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const { defineConfig, globalIgnores } = require('eslint/config');
|
||||
const babelParser = require('@babel/eslint-parser');
|
||||
const js = require('@eslint/js');
|
||||
const eslintPluginEmberRecommended = require('eslint-plugin-ember/configs/recommended');
|
||||
const nPlugin = require('eslint-plugin-n');
|
||||
const qunitPlugin = require('eslint-plugin-qunit');
|
||||
const eslintConfigPrettier = require('eslint-config-prettier/flat');
|
||||
const globals = require('globals');
|
||||
|
||||
module.exports = defineConfig([
|
||||
js.configs.recommended,
|
||||
...eslintPluginEmberRecommended,
|
||||
{
|
||||
languageOptions: {
|
||||
parser: babelParser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
requireConfigFile: false,
|
||||
// This is specific babel-config. If it grows consider creating a babel config file
|
||||
babelOptions: {
|
||||
plugins: [
|
||||
[
|
||||
'@babel/plugin-proposal-decorators',
|
||||
{ decoratorsBeforeExport: true },
|
||||
],
|
||||
],
|
||||
},
|
||||
// end of babel-config
|
||||
},
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
curly: ['error', 'multi-line', 'consistent'],
|
||||
'ember/no-get': 'off',
|
||||
'ember/no-get-with-default': 'off',
|
||||
'ember/no-computed-properties-in-native-classes': 'off',
|
||||
'ember/no-assignment-of-untracked-properties-used-in-tracking-contexts':
|
||||
'off',
|
||||
},
|
||||
},
|
||||
|
||||
// Node files configuration
|
||||
{
|
||||
files: [
|
||||
'eslint.config.js',
|
||||
'.prettierrc.js',
|
||||
'.stylelintrc.js',
|
||||
'.template-lintrc.js',
|
||||
'ember-cli-build.js',
|
||||
'testem.js',
|
||||
'config/**/*.js',
|
||||
'server/**/*.js',
|
||||
],
|
||||
plugins: { n: nPlugin },
|
||||
extends: [nPlugin.configs['flat/recommended-script']],
|
||||
},
|
||||
|
||||
// Test files configuration
|
||||
{
|
||||
files: ['tests/**/*-test.{js,ts}'],
|
||||
extends: [
|
||||
{ ...qunitPlugin.configs.recommended, plugins: { qunit: qunitPlugin } },
|
||||
],
|
||||
rules: {
|
||||
'qunit/require-expect': [2, 'except-simple'],
|
||||
},
|
||||
},
|
||||
// Prettier should be last
|
||||
eslintConfigPrettier,
|
||||
globalIgnores([
|
||||
'blueprints/*/files/',
|
||||
'declarations/',
|
||||
'dist/',
|
||||
'coverage/',
|
||||
'**/.*/',
|
||||
'.node_modules.ember-try/',
|
||||
]),
|
||||
]);
|
||||
@@ -88,11 +88,13 @@
|
||||
"ember-source": "~5.12.0",
|
||||
"ember-template-lint": "^6.0.0",
|
||||
"ember-template-lint-plugin-prettier": "^5.0.0",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-ember": "^12.2.1",
|
||||
"eslint-plugin-n": "^16.6.2",
|
||||
"eslint-plugin-qunit": "^8.1.2",
|
||||
"eslint": "^9.18.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-ember": "^12.7.5",
|
||||
"eslint-plugin-n": "^17.24.0",
|
||||
"eslint-plugin-qunit": "^8.2.6",
|
||||
"@eslint/js": "^9.18.0",
|
||||
"globals": "^17.3.0",
|
||||
"js-bexpr": "hashicorp/js-bexpr#9b4a4b54d85eba67fdfc0990133d1518d890b1e1",
|
||||
"loader.js": "^4.7.0",
|
||||
"miragejs": "^0.1.48",
|
||||
|
||||
@@ -251,7 +251,7 @@ module('Acceptance | credential-libraries | update', function (hooks) {
|
||||
|
||||
try {
|
||||
await visit(urls.credentialLibraries);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN);
|
||||
|
||||
@@ -552,7 +552,7 @@ module(
|
||||
assert.strictEqual(currentURL(), urls.usernamePasswordCredential);
|
||||
try {
|
||||
await visit(urls.credentials);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN, 'Click Discard');
|
||||
@@ -595,7 +595,7 @@ module(
|
||||
|
||||
try {
|
||||
await visit(urls.credentials);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN, 'Click Discard');
|
||||
@@ -637,7 +637,7 @@ module(
|
||||
|
||||
try {
|
||||
await visit(urls.credentials);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN, 'Click Discard');
|
||||
@@ -677,7 +677,7 @@ module(
|
||||
assert.strictEqual(currentURL(), urls.passwordCredential);
|
||||
try {
|
||||
await visit(urls.credentials);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN, 'Click Discard');
|
||||
@@ -722,7 +722,7 @@ module(
|
||||
|
||||
try {
|
||||
await visit(urls.credentials);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN, 'Click Cancel');
|
||||
@@ -769,7 +769,7 @@ module(
|
||||
|
||||
try {
|
||||
await visit(urls.credentials);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN, 'Click Cancel');
|
||||
@@ -827,7 +827,7 @@ module(
|
||||
assert.strictEqual(currentURL(), urls.jsonCredential);
|
||||
try {
|
||||
await visit(urls.credentials);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN, 'Click Cancel');
|
||||
assert.strictEqual(currentURL(), urls.jsonCredential);
|
||||
@@ -871,7 +871,7 @@ module(
|
||||
|
||||
try {
|
||||
await visit(urls.credentials);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN, 'Click Cancel');
|
||||
|
||||
@@ -259,7 +259,7 @@ module('Acceptance | credential-stores | update', function (hooks) {
|
||||
|
||||
try {
|
||||
await visit(urls.credentialStores);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN, 'Click Discard');
|
||||
@@ -297,7 +297,7 @@ module('Acceptance | credential-stores | update', function (hooks) {
|
||||
|
||||
try {
|
||||
await visit(urls.credentialStores);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN, 'Click Discard');
|
||||
@@ -327,7 +327,7 @@ module('Acceptance | credential-stores | update', function (hooks) {
|
||||
|
||||
try {
|
||||
await visit(urls.credentialStores);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN);
|
||||
@@ -366,7 +366,7 @@ module('Acceptance | credential-stores | update', function (hooks) {
|
||||
|
||||
try {
|
||||
await visit(urls.credentialStores);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).isVisible();
|
||||
|
||||
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN);
|
||||
|
||||
@@ -346,7 +346,7 @@ module('Acceptance | host-catalogs | host sets | update', function (hooks) {
|
||||
assert.strictEqual(currentURL(), urls.hostSet);
|
||||
try {
|
||||
await visit(urls.hostSets);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.ok(find(commonSelectors.MODAL_WARNING));
|
||||
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN);
|
||||
assert.strictEqual(currentURL(), urls.hostSets);
|
||||
|
||||
@@ -197,7 +197,7 @@ module('Acceptance | host-catalogs | hosts | update', function (hooks) {
|
||||
// Wrap on a try/catch because transitioning while editing returns error
|
||||
try {
|
||||
await visit(urls.hosts);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).exists();
|
||||
await click(commonSelectors.MODAL_WARNING_CONFIRM_BTN);
|
||||
assert.strictEqual(currentURL(), urls.hosts);
|
||||
@@ -235,7 +235,7 @@ module('Acceptance | host-catalogs | hosts | update', function (hooks) {
|
||||
// Wrap on a try/catch because transitioning while editing returns error
|
||||
try {
|
||||
await visit(urls.hosts);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
assert.dom(commonSelectors.MODAL_WARNING).exists();
|
||||
await click(commonSelectors.MODAL_WARNING_CANCEL_BTN);
|
||||
|
||||
|
||||
Reference in new issue
Block a user