Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add sonar #5569

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,227 changes: 1,892 additions & 1,335 deletions package-lock.json

Large diffs are not rendered by default.

29 changes: 6 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,10 @@
"eslintConfig": {
"extends": [
"plugin:@taiga-ui/experience/all",
"plugin:@taiga-ui/experience/taiga-naming-convention"
],
"overrides": [
{
"files": [
"**/*.spec.ts"
],
"plugins": [
"jest"
],
"extends": [
"plugin:jest/recommended"
],
"rules": {
"jest/expect-expect": "off",
"jest/no-disabled-tests": "off",
"jest/no-done-callback": "off",
"jest/no-test-prefixes": "off"
}
}
"plugin:@taiga-ui/experience/taiga-naming-convention",
"plugin:@taiga-ui/experience/jest",
"plugin:@taiga-ui/experience/cypress",
"plugin:@taiga-ui/experience/playwright"
]
},
"stylelint": {
Expand All @@ -126,7 +110,6 @@
"@angular/platform-server": "12.2.17",
"@angular/router": "12.2.17",
"core-js": "2.6.12",
"eslint-plugin-jest": "27.4.2",
"parse5": "6.0.1",
"rxjs": "6.6.7",
"zone.js": "0.11.8"
Expand All @@ -145,8 +128,8 @@
"@playwright/test": "1.38.1",
"@taiga-ui/browserslist-config": "0.2.0",
"@taiga-ui/commitlint-config": "0.2.1",
"@taiga-ui/cspell-config": "0.13.0",
"@taiga-ui/eslint-plugin-experience": "0.8.1",
"@taiga-ui/cspell-config": "0.14.0",
"@taiga-ui/eslint-plugin-experience": "0.9.0",
"@taiga-ui/prettier-config": "0.3.1",
"@taiga-ui/stylelint-config": "0.5.1",
"@testing-library/cypress": "9.0.0",
Expand Down
1 change: 0 additions & 1 deletion projects/addon-commerce/utils/get-currency-symbol.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums';
import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';

// eslint-disable-next-line complexity
export function tuiGetCurrencySymbol(currency: TuiCurrencyVariants): string | null {
switch (currency) {
case TuiCurrency.Ruble:
Expand Down
8 changes: 2 additions & 6 deletions projects/cdk/schematics/ng-add/steps/wrap-with-tui-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ function getAppTemplatePath(mainPath: string): string | undefined {
const appIdentifier = mainInitializer.getElements()[0] as Identifier;
const appComponent = appIdentifier.getDefinitionNodes()[0] as ClassDeclaration;

const templateUrlPath = getTemplatePathFromComponent(appComponent);

return templateUrlPath;
return getTemplatePathFromComponent(appComponent);
}

function getTemplatePathFromComponent(component: ClassDeclaration): string {
Expand All @@ -126,11 +124,9 @@ function getTemplatePathFromComponent(component: ClassDeclaration): string {

const appComponentPath = component.getSourceFile().getFilePath().split(`/`);

const templateUrlPath = `${appComponentPath
return `${appComponentPath
.splice(0, appComponentPath.length - 1)
.join(`/`)}/${templateInitializer?.getText().replace(/['"]/g, ``)}`;

return templateUrlPath;
}

function getTemplateInitializer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export class TuiPrimitiveYearPickerComponent {
return null;
}

// eslint-disable-next-line complexity
getItemRange(item: number): TuiRangeState | null {
const {value, hoveredItem} = this;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ export class TuiBadgedContentExample2 {
return this.contentTop === 50 ? 'tuiIconCheck' : 'var(--tui-error-fill)';
}

get contentBottom(): string {
return this.contentTop === 50 ? '' : '';
splincode marked this conversation as resolved.
Show resolved Hide resolved
}

onClick(): void {
this.contentTop++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import {Component} from '@angular/core';
import {FormControl} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {
TuiContextWithImplicit,
TuiIdentityMatcher,
TuiStringHandler,
} from '@taiga-ui/cdk';
import {TuiContextWithImplicit} from '@taiga-ui/cdk';
import {tuiItemsHandlersProvider} from '@taiga-ui/kit';

interface Employee {
Expand All @@ -18,27 +14,18 @@ interface Employee {
readonly name: string;
}

const STRINGIFY_EMPLOYEE: TuiStringHandler<
Employee | TuiContextWithImplicit<Employee>
> = (item: Employee | TuiContextWithImplicit<Employee>) =>
'name' in item
? `${item.name} (${item.dept.title})`
: `${item.$implicit.name} (${item.$implicit.dept.title})`;

const ID_MATCHER_EMPLOYEE: TuiIdentityMatcher<Employee> = (
item1: Employee,
item2: Employee,
) => item1.id === item2.id;

@Component({
selector: 'tui-multi-select-example-8',
templateUrl: './index.html',
changeDetection,
encapsulation,
providers: [
tuiItemsHandlersProvider({
stringify: STRINGIFY_EMPLOYEE,
identityMatcher: ID_MATCHER_EMPLOYEE,
identityMatcher: (item1: Employee, item2: Employee) => item1.id === item2.id,
stringify: (item: Employee | TuiContextWithImplicit<Employee>) =>
'name' in item
? `${item.name} (${item.dept.title})`
: `${item.$implicit.name} (${item.$implicit.dept.title})`,
}),
],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {Component} from '@angular/core';
import {FormControl} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiStringHandler} from '@taiga-ui/cdk';
import {tuiItemsHandlersProvider} from '@taiga-ui/kit';

interface Employee {
Expand All @@ -14,15 +13,16 @@ interface Employee {
readonly name: string;
}

const STRINGIFY_EMPLOYEE: TuiStringHandler<Employee> = (item: Employee) =>
`${item.name} (${item.dept.title})`;

@Component({
selector: 'tui-select-example-10',
templateUrl: './index.html',
changeDetection,
encapsulation,
providers: [tuiItemsHandlersProvider({stringify: STRINGIFY_EMPLOYEE})],
providers: [
tuiItemsHandlersProvider({
stringify: (item: Employee) => `${item.name} (${item.dept.title})`,
}),
],
})
export class TuiSelectExample10 {
readonly testValue = new FormControl(null);
Expand Down
2 changes: 0 additions & 2 deletions projects/kit/utils/math/test/key-steps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe(`KeySteps utils`, () => {

describe(`tuiPercentageToKeyStepValue`, () => {
for (const {percentage, value} of testContexts) {
// eslint-disable-next-line no-loop-func
it(`${percentage}% => ${value}`, () => {
expect(tuiPercentageToKeyStepValue(percentage, keySteps)).toBe(value);
});
Expand All @@ -35,7 +34,6 @@ describe(`KeySteps utils`, () => {

describe(`tuiKeyStepValueToPercentage`, () => {
for (const {value, percentage} of testContexts) {
// eslint-disable-next-line no-loop-func
splincode marked this conversation as resolved.
Show resolved Hide resolved
it(`${value} => ${percentage}%`, () => {
expect(tuiKeyStepValueToPercentage(value, keySteps)).toBe(percentage);
});
Expand Down
Loading