Skip to content

Commit

Permalink
Merge pull request #5 from AuScope/AUS-4244
Browse files Browse the repository at this point in the history
AUS 4244 Upgrade to Angular 18
  • Loading branch information
laughing0li authored Nov 5, 2024
2 parents 2029f5c + 377aac8 commit 44f6368
Show file tree
Hide file tree
Showing 21 changed files with 11,027 additions and 5,590 deletions.
6 changes: 3 additions & 3 deletions ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "appstore:build"
"buildTarget": "appstore:build"
},
"configurations": {
"production": {
"browserTarget": "appstore:build:production"
"buildTarget": "appstore:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "appstore:build"
"buildTarget": "appstore:build"
}
},
"test": {
Expand Down
156 changes: 156 additions & 0 deletions ui/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import _import from "eslint-plugin-import";
import angularEslintEslintPlugin from "@angular-eslint/eslint-plugin";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import stylisticJs from '@stylistic/eslint-plugin-js';
import { fixupPluginRules } from "@eslint/compat";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";

export default [{
plugins: {
import: fixupPluginRules(_import),
"@angular-eslint": angularEslintEslintPlugin,
"@typescript-eslint": typescriptEslint,
"@stylistic/js": stylisticJs,
},
files: ["**/*.ts"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: "module",
},

rules: {
"@angular-eslint/component-class-suffix": "error",

"@angular-eslint/component-selector": ["error", {
type: "element",
prefix: "app",
style: "kebab-case",
}],

"@angular-eslint/directive-class-suffix": "error",

"@angular-eslint/directive-selector": ["error", {
type: "attribute",
prefix: "app",
style: "camelCase",
}],

"@angular-eslint/no-host-metadata-property": "error",
"@angular-eslint/no-input-rename": "error",
"@angular-eslint/no-inputs-metadata-property": "error",
"@angular-eslint/no-output-rename": "error",
"@angular-eslint/no-outputs-metadata-property": "error",
"@angular-eslint/use-lifecycle-interface": "error",
"@angular-eslint/use-pipe-transform-interface": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",

"@typescript-eslint/explicit-member-accessibility": ["off", {
accessibility: "explicit",
}],

"@stylistic/js/indent": ["error", 4],

"@typescript-eslint/member-ordering": "error",

"@typescript-eslint/naming-convention": ["error", {
selector: "variable",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "forbid",
trailingUnderscore: "forbid",
}],

"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "error",

"@typescript-eslint/no-inferrable-types": ["error", {
ignoreParameters: true,
}],

"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-non-null-assertion": "error",

"@typescript-eslint/no-shadow": ["error", {
hoist: "all",
}],

"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
"brace-style": ["error", "1tbs"],
"constructor-super": "error",
curly: "error",
"dot-notation": "off",
"eol-last": "error",
eqeqeq: ["error", "smart"],
"guard-for-in": "error",
"id-denylist": "off",
"id-match": "off",
"import/no-deprecated": "warn",
indent: "off",

"max-len": ["error", {
code: 140,
}],

"no-bitwise": "error",
"no-caller": "error",

"no-console": ["error", {
allow: [
"log",
"warn",
"error",
"dir",
"timeLog",
"assert",
"clear",
"count",
"countReset",
"group",
"groupEnd",
"table",
"dirxml",
"groupCollapsed",
"Console",
"profile",
"profileEnd",
"timeStamp",
"context",
"createTask",
],
}],

"no-debugger": "error",
"no-empty": "off",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "error",
"no-new-wrappers": "error",
"no-restricted-imports": "error",
"no-shadow": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unused-expressions": "off",
"no-unused-labels": "error",
"no-var": "error",
"prefer-const": "error",
quotes: "off",
radix: "error",
semi: "off",

"spaced-comment": ["error", "always", {
markers: ["/"],
}],
},
}];
Loading

0 comments on commit 44f6368

Please sign in to comment.