Skip to content

Commit

Permalink
feat(simulator-ui): angular 19 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
bbortt committed Jan 7, 2025
1 parent 6e532ac commit 019a754
Show file tree
Hide file tree
Showing 118 changed files with 11,697 additions and 11,951 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
node --version
npm --version
- name: Install dependencies
run: npm ci --cache .npm
run: npm ci --cache .npm --force
working-directory: simulator-ui
- name: Prettier
run: npm run prettier:check
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<!-- see https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-logging/3.3.5 -->
<logback.classic.version>1.5.11</logback.classic.version>

<node.version>v22.4.1</node.version>
<npm.version>10.8.1</npm.version>
<node.version>v22.12.0</node.version>
<npm.version>10.9.0</npm.version>

<skip.gpg>false</skip.gpg>
<reuseForks>true</reuseForks>
Expand Down
9 changes: 0 additions & 9 deletions simulator-ui/.eslintignore

This file was deleted.

99 changes: 0 additions & 99 deletions simulator-ui/.eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion simulator-ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "320kb"
"maximumError": "500kb"
}
]
},
Expand Down
148 changes: 148 additions & 0 deletions simulator-ui/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
/*
* Copyright the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// @ts-check

import globals from 'globals';
import prettier from 'eslint-plugin-prettier/recommended';
import tseslint from 'typescript-eslint';
import eslint from '@eslint/js';
// For a detailed explanation, visit: https://github.com/angular-eslint/angular-eslint/blob/main/docs/CONFIGURING_FLAT_CONFIG.md
import angular from 'angular-eslint';
// jhipster-needle-eslint-add-import - JHipster will add additional import here

export default tseslint.config(
{
languageOptions: {
globals: {
...globals.node,
},
},
},
{ ignores: ['src/main/docker/'] },
{ ignores: ['target/classes/static/', 'target/'] },
eslint.configs.recommended,
{
files: ['**/*.{js,cjs,mjs}'],
rules: {
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
},
{
files: ['src/main/webapp/**/*.ts'],
extends: [...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylistic, ...angular.configs.tsRecommended],
languageOptions: {
globals: {
...globals.browser,
},
parserOptions: {
project: ['./tsconfig.app.json', './tsconfig.spec.json'],
},
},
processor: angular.processInlineTemplates,
rules: {
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'app',
style: 'kebab-case',
},
],
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'jhi',
style: 'camelCase',
},
],
'@angular-eslint/relative-url-prefix': 'error',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/member-ordering': [
'error',
{
default: [
'public-static-field',
'protected-static-field',
'private-static-field',
'public-instance-field',
'protected-instance-field',
'private-instance-field',
'constructor',
'public-static-method',
'protected-static-method',
'private-static-method',
'public-instance-method',
'protected-instance-method',
'private-instance-method',
],
},
],
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
'@typescript-eslint/unbound-method': 'off',
'arrow-body-style': 'error',
curly: 'error',
eqeqeq: ['error', 'always', { null: 'ignore' }],
'guard-for-in': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-eval': 'error',
'no-labels': 'error',
'no-new': 'error',
'no-new-wrappers': 'error',
'object-shorthand': ['error', 'always', { avoidExplicitReturnArrows: true }],
radix: 'error',
'spaced-comment': ['warn', 'always'],
},
},
{
files: ['src/main/webapp/**/*.spec.ts'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
},
},
{
files: ['**/*.html'],
extends: [...angular.configs.templateRecommended, ...angular.configs.templateAccessibility],
rules: {},
},
{
// Html templates requires some work
ignores: ['**/*.html'],
extends: [prettier],
},
// jhipster-needle-eslint-add-config - JHipster will add additional config here
prettier,
);
Loading

0 comments on commit 019a754

Please sign in to comment.