Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
k-genov committed Dec 20, 2024
1 parent c8b2561 commit 09b8c33
Show file tree
Hide file tree
Showing 63 changed files with 4,520 additions and 6,038 deletions.
139 changes: 0 additions & 139 deletions .eslintrc.json

This file was deleted.

15 changes: 10 additions & 5 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"lintFilePatterns": [
"projects/scion/components/**/*.ts",
"projects/scion/components/**/*.html"
]
],
"eslintConfig": "projects/scion/components/eslint.config.js"
}
}
}
Expand All @@ -105,7 +106,8 @@
"lintFilePatterns": [
"projects/scion/components.e2e/**/*.ts",
"projects/scion/components.e2e/**/*.html"
]
],
"eslintConfig": "projects/scion/components.e2e/eslint.config.js"
}
}
}
Expand Down Expand Up @@ -155,7 +157,8 @@
"lintFilePatterns": [
"projects/scion/components.internal/**/*.ts",
"projects/scion/components.internal/**/*.html"
]
],
"eslintConfig": "projects/scion/components.internal/eslint.config.js"
}
}
}
Expand Down Expand Up @@ -249,7 +252,8 @@
"lintFilePatterns": [
"apps/components/**/*.ts",
"apps/components/**/*.html"
]
],
"eslintConfig": "apps/components/eslint.config.js"
}
}
}
Expand Down Expand Up @@ -338,7 +342,8 @@
"lintFilePatterns": [
"apps/components-testing-app/**/*.ts",
"apps/components-testing-app/**/*.html"
]
],
"eslintConfig": "apps/components-testing-app/eslint.config.js"
}
}
}
Expand Down
44 changes: 0 additions & 44 deletions apps/components-testing-app/.eslintrc.json

This file was deleted.

32 changes: 32 additions & 0 deletions apps/components-testing-app/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// @ts-check
const tseslint = require("typescript-eslint");
const rootConfig = require("../../eslint.config.js");

module.exports = tseslint.config(
...rootConfig,
{
files: ["**/*.ts"],
rules: {
"@angular-eslint/directive-selector": [
"error",
{
type: "attribute",
prefix: ["app"],
style: "camelCase",
},
],
"@angular-eslint/component-selector": [
"error",
{
type: "element",
prefix: ["app"],
style: "kebab-case",
},
],
},
},
{
files: ["**/*.html"],
rules: {},
},
);
46 changes: 0 additions & 46 deletions apps/components/.eslintrc.json

This file was deleted.

32 changes: 32 additions & 0 deletions apps/components/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// @ts-check
const tseslint = require("typescript-eslint");
const rootConfig = require("../../eslint.config.js");

module.exports = tseslint.config(
...rootConfig,
{
files: ["**/*.ts"],
rules: {
"@angular-eslint/directive-selector": [
"error",
{
type: "attribute",
prefix: ["app", "sci"],
style: "camelCase",
},
],
"@angular-eslint/component-selector": [
"error",
{
type: "element",
prefix: ["app", "sci"],
style: "kebab-case",
},
],
},
},
{
files: ["**/*.html"],
rules: {},
},
);
2 changes: 1 addition & 1 deletion apps/components/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class AppComponent {
return tools.concat({
routerPath: `/${route.path}`,
name: route.path!,
internal: route.data?.['internal'] ?? false,
internal: route.data?.['internal'] as boolean ?? false,
});
}, new Array<Tool>())),
sortArray((tool1, tool2) => Number(tool1.internal) - Number(tool2.internal)),

Check failure on line 68 in apps/components/src/app/app.component.ts

View workflow job for this annotation

GitHub Actions / Linting

Unsafe argument of type error typed assigned to a parameter of type `OperatorFunction<Tool[], Tool[]>`

Check failure on line 68 in apps/components/src/app/app.component.ts

View workflow job for this annotation

GitHub Actions / Linting

Unsafe member access .internal on an `any` value

Check failure on line 68 in apps/components/src/app/app.component.ts

View workflow job for this annotation

GitHub Actions / Linting

Unsafe member access .internal on an `any` value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
import {Component} from '@angular/core';
import {FormArray, FormBuilder} from '@angular/forms';
import {SciKeyValueFieldComponent} from '@scion/components.internal/key-value-field';
import {Component, inject} from '@angular/core';
import {FormGroup, NonNullableFormBuilder} from '@angular/forms';
import {KeyValueEntry, SciKeyValueFieldComponent} from '@scion/components.internal/key-value-field';
import {Dictionary} from '@scion/toolkit/util';
import {JsonPipe} from '@angular/common';

Expand All @@ -24,13 +24,9 @@ import {JsonPipe} from '@angular/common';
})
export default class SciKeyValueFieldPageComponent {

public formArray: FormArray;
public formArray = inject(NonNullableFormBuilder).array<FormGroup<KeyValueEntry>>([]);
public output: Dictionary | null = null;

Check failure on line 28 in apps/components/src/app/sci-key-value-field-page/sci-key-value-field-page.component.ts

View workflow job for this annotation

GitHub Actions / Linting

'Dictionary' is an 'error' type that acts as 'any' and overrides all other types in this union type

constructor(fb: FormBuilder) {
this.formArray = fb.array([]);
}

public onPrint(): void {
this.output = SciKeyValueFieldComponent.toDictionary(this.formArray);

Check failure on line 31 in apps/components/src/app/sci-key-value-field-page/sci-key-value-field-page.component.ts

View workflow job for this annotation

GitHub Actions / Linting

Unsafe assignment of an error typed value

Check failure on line 31 in apps/components/src/app/sci-key-value-field-page/sci-key-value-field-page.component.ts

View workflow job for this annotation

GitHub Actions / Linting

Unsafe member access .toDictionary on an `error` typed value
}
Expand Down
Loading

0 comments on commit 09b8c33

Please sign in to comment.