Skip to content

Commit 0eec25b

Browse files
committed
fix(lint): updating eslint config
1 parent c3098e7 commit 0eec25b

File tree

98 files changed

+504
-640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+504
-640
lines changed

.eslintignore

-6
This file was deleted.

.eslintrc.json

-89
This file was deleted.

eslint.config.mjs

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import js from "@eslint/js";
5+
import { FlatCompat } from "@eslint/eslintrc";
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all
13+
});
14+
15+
export default [{
16+
ignores: [
17+
"**/dist/",
18+
"projects/igniteui-angular/migrations/",
19+
"projects/igniteui-angular/schematics/",
20+
"projects/igniteui-angular/cypress/",
21+
"**/cypress/",
22+
"**/cypress.config.ts",
23+
],
24+
}, ...compat.extends(
25+
"plugin:@angular-eslint/recommended",
26+
"plugin:@angular-eslint/template/process-inline-templates",
27+
).map(config => ({
28+
...config,
29+
files: ["**/*.ts"],
30+
})), {
31+
files: ["**/*.ts"],
32+
33+
plugins: {
34+
"@typescript-eslint": typescriptEslint,
35+
},
36+
37+
languageOptions: {
38+
ecmaVersion: 5,
39+
sourceType: "script",
40+
41+
parserOptions: {
42+
project: ["tsconfig.json"],
43+
createDefaultProgram: true,
44+
},
45+
},
46+
47+
rules: {
48+
"no-shadow": "off",
49+
"no-prototype-builtins": "off",
50+
"no-case-declarations": "warn",
51+
"prefer-spread": "warn",
52+
"no-async-promise-executor": "warn",
53+
"prefer-const": "warn",
54+
"no-useless-escape": "warn",
55+
"@typescript-eslint/no-var-requires": "off",
56+
"@typescript-eslint/no-shadow": "error",
57+
"no-unused-vars": "off",
58+
59+
"@typescript-eslint/no-unused-vars": ["warn", {
60+
args: "all",
61+
argsIgnorePattern: "^_",
62+
caughtErrors: "all",
63+
caughtErrorsIgnorePattern: "^_",
64+
destructuredArrayIgnorePattern: "^_",
65+
varsIgnorePattern: "^_",
66+
ignoreRestSiblings: true,
67+
}],
68+
69+
"@typescript-eslint/consistent-type-definitions": "error",
70+
"@typescript-eslint/dot-notation": "off",
71+
72+
"@typescript-eslint/explicit-member-accessibility": ["error", {
73+
accessibility: "explicit",
74+
75+
overrides: {
76+
constructors: "no-public",
77+
},
78+
}],
79+
80+
"@typescript-eslint/naming-convention": ["error", {
81+
selector: "enumMember",
82+
format: ["PascalCase"],
83+
}],
84+
85+
"@angular-eslint/no-input-rename": "off",
86+
87+
"brace-style": ["error", "1tbs"],
88+
"id-blacklist": "off",
89+
"id-match": "off",
90+
"no-underscore-dangle": "off",
91+
"@typescript-eslint/no-explicit-any": "off",
92+
"@typescript-eslint/no-empty-function": "off",
93+
"@typescript-eslint/no-restricted-types": "warn",
94+
},
95+
}, ...compat.extends("plugin:@angular-eslint/template/recommended").map(config => ({
96+
...config,
97+
files: ["**/*.html"],
98+
})), {
99+
files: ["**/*.html"],
100+
rules: {},
101+
}];

projects/igniteui-angular/src/lib/accordion/public_api.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ export * from './accordion.component';
55
/* Imports that cannot be resolved from IGX_EXPANSION_PANEL_DIRECTIVES spread
66
NOTE: Do not remove! Issue: https://github.com/IgniteUI/igniteui-angular/issues/13310
77
*/
8-
/* eslint-disable @typescript-eslint/no-unused-vars */
9-
import {
8+
import {
109
IgxExpansionPanelComponent,
1110
IgxExpansionPanelHeaderComponent,
1211
IgxExpansionPanelBodyComponent,

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.spec.ts

-2
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ class IgxActionStripTestingComponent implements OnInit {
429429
];
430430

431431
this.data = [
432-
/* eslint-disable max-len */
433432
{ ID: 'ALFKI', CompanyName: 'Alfreds Futterkiste', ContactName: 'Maria Anders', ContactTitle: 'Sales Representative', Address: 'Obere Str. 57', City: 'Berlin', Region: null, PostalCode: '12209', Country: 'Germany', Phone: '030-0074321', Fax: '030-0076545' },
434433
{ ID: 'ANATR', CompanyName: 'Ana Trujillo Emparedados y helados', ContactName: 'Ana Trujillo', ContactTitle: 'Owner', Address: 'Avda. de la Constitución 2222', City: 'México D.F.', Region: null, PostalCode: '05021', Country: 'Mexico', Phone: '(5) 555-4729', Fax: '(5) 555-3745' },
435434
{ ID: 'ANTON', CompanyName: 'Antonio Moreno Taquería', ContactName: 'Antonio Moreno', ContactTitle: 'Owner', Address: 'Mataderos 2312', City: 'México D.F.', Region: null, PostalCode: '05023', Country: 'Mexico', Phone: '(5) 555-3932', Fax: null },
@@ -458,7 +457,6 @@ class IgxActionStripTestingComponent implements OnInit {
458457
{ ID: 'FRANR', CompanyName: 'France restauration', ContactName: 'Carine Schmitt', ContactTitle: 'Marketing Manager', Address: '54, rue Royale', City: 'Nantes', Region: null, PostalCode: '44000', Country: 'France', Phone: '40.32.21.21', Fax: '40.32.21.20' },
459458
{ ID: 'FRANS', CompanyName: 'Franchi S.p.A.', ContactName: 'Paolo Accorti', ContactTitle: 'Sales Representative', Address: 'Via Monte Bianco 34', City: 'Torino', Region: null, PostalCode: '10100', Country: 'Italy', Phone: '011-4988260', Fax: '011-4988261' }
460459
];
461-
/* eslint-enable max-len */
462460

463461
this.dataOneRow = [
464462
{ ID: 'ALFKI', CompanyName: 'Alfreds Futterkiste', ContactName: 'Maria Anders', ContactTitle: 'Sales Representative', Address: 'Obere Str. 57', City: 'Berlin', Region: null, PostalCode: '12209', Country: 'Germany', Phone: '030-0074321', Fax: '030-0076545' },

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component.spec.ts

-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ class IgxActionStripTestingComponent implements OnInit {
140140
];
141141

142142
this.data = [
143-
/* eslint-disable max-len */
144143
{ ID: 'ALFKI', CompanyName: 'Alfreds Futterkiste', ContactName: 'Maria Anders', ContactTitle: 'Sales Representative', Address: 'Obere Str. 57', City: 'Berlin', Region: null, PostalCode: '12209', Country: 'Germany', Phone: '030-0074321', Fax: '030-0076545' },
145144
{ ID: 'ANATR', CompanyName: 'Ana Trujillo Emparedados y helados', ContactName: 'Ana Trujillo', ContactTitle: 'Owner', Address: 'Avda. de la Constitución 2222', City: 'México D.F.', Region: null, PostalCode: '05021', Country: 'Mexico', Phone: '(5) 555-4729', Fax: '(5) 555-3745' },
146145
{ ID: 'ANTON', CompanyName: 'Antonio Moreno Taquería', ContactName: 'Antonio Moreno', ContactTitle: 'Owner', Address: 'Mataderos 2312', City: 'México D.F.', Region: null, PostalCode: '05023', Country: 'Mexico', Phone: '(5) 555-3932', Fax: null },
@@ -169,7 +168,6 @@ class IgxActionStripTestingComponent implements OnInit {
169168
{ ID: 'FRANR', CompanyName: 'France restauration', ContactName: 'Carine Schmitt', ContactTitle: 'Marketing Manager', Address: '54, rue Royale', City: 'Nantes', Region: null, PostalCode: '44000', Country: 'France', Phone: '40.32.21.21', Fax: '40.32.21.20' },
170169
{ ID: 'FRANS', CompanyName: 'Franchi S.p.A.', ContactName: 'Paolo Accorti', ContactTitle: 'Sales Representative', Address: 'Via Monte Bianco 34', City: 'Torino', Region: null, PostalCode: '10100', Country: 'Italy', Phone: '011-4988260', Fax: '011-4988261' }
171170
];
172-
/* eslint-enable max-len */
173171
}
174172
}
175173

projects/igniteui-angular/src/lib/avatar/avatar.component.spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,5 @@ class InitIconAvatarComponent {
195195
class InitImageAvatarComponent {
196196
@ViewChild(IgxAvatarComponent, { static: true }) public avatar: IgxAvatarComponent;
197197

198-
// eslint-disable-next-line max-len
199198
public source = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxQTEhUUExQWFR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3aXOaosXIXNjZS6iLpnWlwrmxbkQU7PiQ66rza6h9b0Z0x0BUUepr5FxnoGbEqzZmIu6TVaW+DLczJG3P5jFPRzml1jEua7Ao2GRyYUJbLNJGJxehGRUmKU+RcrGctV31uA++C5GedocJGtWzGvfgdCQcZ7yZe+/1GqZJpaprPlPIrvYAUy5sllmq5qsyFCZkUmWrOY1EjEbLJC3YIVhVmxFKziZNVdyF22b+ZmjJh9/KLqWlNpeLHxmTviURMmqa0nuzJWRLkU5l1TXaFIpyExb6lSmNU1zLXnDAQtTySTNavyY1r8TZT2KmLcyKeixTZia7md4WwJyKNxDE1JOYu2RU5AW9DcQ41VAILafiQ62efW/p//9k=';
200199
}

projects/igniteui-angular/src/lib/calendar/calendar.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ export class IgxCalendarComponent extends IgxCalendarBaseDirective implements Af
399399
* @hidden
400400
* @internal
401401
*/
402-
// eslint-disable-next-line max-len
403402
@ContentChild(forwardRef(() => IgxCalendarSubheaderTemplateDirective), { read: IgxCalendarSubheaderTemplateDirective, static: true })
404403
private subheaderTemplateDirective: IgxCalendarSubheaderTemplateDirective;
405404

projects/igniteui-angular/src/lib/card/card.component.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ let NEXT_ID = 0;
2020
* Use it to wrap images and videos.
2121
*/
2222
@Directive({
23-
// eslint-disable-next-line @angular-eslint/directive-selector
2423
selector: 'igx-card-media',
2524
standalone: true
2625
})
@@ -132,7 +131,7 @@ export class IgxCardHeaderSubtitleDirective {
132131
* IgxCardContent is container for the card content.
133132
*/
134133
@Directive({
135-
// eslint-disable-next-line @angular-eslint/directive-selector
134+
136135
selector: 'igx-card-content',
137136
standalone: true
138137
})
@@ -146,7 +145,7 @@ export class IgxCardContentDirective {
146145
* IgxCardFooter is container for the card footer
147146
*/
148147
@Directive({
149-
// eslint-disable-next-line @angular-eslint/directive-selector
148+
150149
selector: 'igx-card-footer',
151150
standalone: true
152151
})
@@ -280,7 +279,7 @@ export type IgxCardActionsLayout = (typeof IgxCardActionsLayout)[keyof typeof Ig
280279
* IgxCardActions is container for the card actions.
281280
*/
282281
@Component({
283-
// eslint-disable-next-line @angular-eslint/directive-selector
282+
284283
selector: 'igx-card-actions',
285284
templateUrl: 'card-actions.component.html',
286285
standalone: true

projects/igniteui-angular/src/lib/date-range-picker/date-range-picker.component.spec.ts

-5
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,12 @@ describe('IgxDateRangePicker', () => {
8080
};
8181
mockElement.parent = mockElement;
8282
mockElement.parentElement = mockElement;
83-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8483
mockApplicationRef = { attachView: (h: any) => { }, detachView: (h: any) => { } };
8584
mockInjector = jasmine.createSpyObj('Injector', {
8685
get: mockNgControl
8786
});
8887
mockAnimationBuilder = {
89-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
9088
build: (a: AnimationMetadata | AnimationMetadata[]) => ({
91-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
9289
create: (e: any, opt?: AnimationOptions) => ({
9390
onDone: (fn: any) => { },
9491
onStart: (fn: any) => { },
@@ -122,9 +119,7 @@ describe('IgxDateRangePicker', () => {
122119
documentElement: document.documentElement,
123120
createElement: () => mockElement,
124121
appendChild: () => { },
125-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
126122
addEventListener: (type: string, listener: (this: HTMLElement, ev: MouseEvent) => any) => { },
127-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
128123
removeEventListener: (type: string, listener: (this: HTMLElement, ev: MouseEvent) => any) => { }
129124
};
130125
mockNgZone = {};

0 commit comments

Comments
 (0)