Skip to content

Commit

Permalink
chore: remove redundant eslint rules (#6235)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Dec 12, 2023
1 parent df24fac commit 57ef26b
Show file tree
Hide file tree
Showing 11 changed files with 394 additions and 164 deletions.
543 changes: 391 additions & 152 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"@taiga-ui/browserslist-config": "0.4.0",
"@taiga-ui/commitlint-config": "0.5.0",
"@taiga-ui/cspell-config": "0.25.0",
"@taiga-ui/eslint-plugin-experience": "0.41.1",
"@taiga-ui/eslint-plugin-experience": "0.42.0",
"@taiga-ui/prettier-config": "0.7.0",
"@taiga-ui/stylelint-config": "0.12.2",
"@taiga-ui/tsconfig": "0.11.0",
Expand Down
2 changes: 0 additions & 2 deletions projects/cdk/coercion/coerce-boolean-property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
export function tuiCoerceBooleanProperty(
value: Record<string, any> | boolean | number | string | null | undefined,
): boolean {
// If you don't mind "[object Object]" in your strings, then you will not need this rule.
// eslint-disable-next-line @typescript-eslint/no-base-to-string
return value !== null && typeof value !== `undefined` && `${value}` !== `false`;
}
1 change: 0 additions & 1 deletion projects/cdk/schematics/ng-update/v3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ function addTaigaStyles(options: TuiSchema): Rule {
taigaStyles,
existingStyles =>
!!existingStyles?.some(
// eslint-disable-next-line @taiga-ui/experience/no-typeof
style => typeof style === `string` && style.includes(`tinkoff-theme`),
),
stylesToReplace,
Expand Down
1 change: 0 additions & 1 deletion projects/cdk/schematics/utils/get-projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export function getProjects(
.map(([_, project]) => project);

const nameFromContext =
// eslint-disable-next-line @typescript-eslint/no-base-to-string
options.project || workspace.extensions.defaultProject?.toString() || ``;
const projectFromContext = workspace.projects.get(nameFromContext);

Expand Down
1 change: 0 additions & 1 deletion projects/cdk/schematics/utils/push-to-array-property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export function pushToObjectArrayProperty(
return;
}

// eslint-disable-next-line @taiga-ui/experience/no-typeof
if (typeof index === `number`) {
importsInitializer.insertElement(index, initializer);
} else {
Expand Down
1 change: 0 additions & 1 deletion projects/cdk/utils/miscellaneous/is-number.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export function tuiIsNumber(value: unknown): value is number {
// eslint-disable-next-line @taiga-ui/experience/no-typeof
return typeof value === `number`;
}
1 change: 0 additions & 1 deletion projects/cdk/utils/miscellaneous/is-object.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export function tuiIsObject<T extends Record<string, any>>(
value: unknown,
): value is NonNullable<T> {
// eslint-disable-next-line @taiga-ui/experience/no-typeof
return typeof value === `object` && !!value;
}
1 change: 0 additions & 1 deletion projects/cdk/utils/miscellaneous/is-string.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export function tuiIsString(value: unknown): value is string {
// eslint-disable-next-line @taiga-ui/experience/no-typeof
return typeof value === `string`;
}
4 changes: 2 additions & 2 deletions projects/demo/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {GLOBAL_DEFS_FOR_TERSER_WITH_AOT} from '@angular/compiler-cli';
import {tuiIsObject} from '@taiga-ui/cdk';
import TerserPlugin from 'terser-webpack-plugin';
import {Configuration, RuleSetRule} from 'webpack';
import {merge} from 'webpack-merge';
Expand Down Expand Up @@ -79,7 +78,8 @@ export function makeWebpackConfig({server}: Options): WebpackConf {

return (ngConfigs: Configuration): Configuration => {
const ngRules = [...(ngConfigs.module?.rules || [])].map(rule =>
tuiIsObject(rule) &&
typeof rule === `object` &&
!!rule &&
DO_NOT_MUTATE_RAW_FILE_CONTENTS.some(
pattern => rule.test instanceof RegExp && rule.test?.test(pattern),
)
Expand Down
1 change: 0 additions & 1 deletion projects/icons/scripts/process-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export function tuiProcessIcons(files: string[], interceptor?: ContentIntercepto
const wrapped = wrapIcon(src, name);

const final =
// eslint-disable-next-line @taiga-ui/experience/no-typeof
typeof wrapped === `string`
? `${wrapped.replace(
START,
Expand Down

0 comments on commit 57ef26b

Please sign in to comment.