Skip to content

Commit 1d0ea62

Browse files
ESLint migration
1 parent 5d0fcdd commit 1d0ea62

File tree

5 files changed

+61
-98
lines changed

5 files changed

+61
-98
lines changed

.eslintrc.json

Lines changed: 0 additions & 96 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import path from "node:path";
2+
import {fileURLToPath} from "node:url";
3+
import js from "@eslint/js";
4+
import {FlatCompat} from "@eslint/eslintrc";
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = path.dirname(__filename);
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
recommendedConfig: js.configs.recommended,
11+
allConfig: js.configs.all
12+
});
13+
14+
export default [
15+
...compat.extends("plugin:@angular-eslint/recommended")
16+
.map(config => ({
17+
...config,
18+
files: ["src/**/*.ts"],
19+
})),
20+
{
21+
files: ["src/**/*.ts"],
22+
languageOptions: {
23+
ecmaVersion: 5,
24+
sourceType: "script",
25+
26+
parserOptions: {
27+
project: ["tsconfig.*?.json"],
28+
createDefaultProgram: true,
29+
},
30+
},
31+
rules: {
32+
quotes: ["error", "single", {
33+
allowTemplateLiterals: true,
34+
}],
35+
},
36+
},
37+
...compat.extends("plugin:@angular-eslint/template/recommended")
38+
.map(config => ({
39+
...config,
40+
files: ["src/**/*.component.html"],
41+
})),
42+
{
43+
files: ["src/**/*.component.html"],
44+
rules: {
45+
"max-len": ["error", {
46+
code: 140,
47+
}],
48+
},
49+
},
50+
...compat.extends("plugin:@angular-eslint/template/process-inline-templates")
51+
.map(config => ({
52+
...config,
53+
files: ["src/**/*.component.ts"],
54+
}))
55+
];

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
"@angular/platform-browser": "^18.2.13",
4040
"@angular/platform-browser-dynamic": "^18.2.13",
4141
"@compodoc/compodoc": "^1.1.26",
42+
"@eslint/eslintrc": "^3.2.0",
43+
"@eslint/js": "^9.18.0",
4244
"@segment/analytics-next": "^1.76.1",
4345
"@types/jasmine": "^5.1.5",
4446
"@types/node": "^20.17.12",

src/window-wrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Injectable} from '@angular/core';
2-
import type { AnalyticsSnippet } from "@segment/analytics-next";
2+
import type { AnalyticsSnippet } from '@segment/analytics-next';
33

44
/**
55
* Window Wrapper for Angular AOT

yarn.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ __metadata:
18721872
languageName: node
18731873
linkType: hard
18741874

1875-
"@eslint/js@npm:9.18.0":
1875+
"@eslint/js@npm:9.18.0, @eslint/js@npm:^9.18.0":
18761876
version: 9.18.0
18771877
resolution: "@eslint/js@npm:9.18.0"
18781878
checksum: 10c0/3938344c5ac7feef4b73fcb30f3c3e753570cea74c24904bb5d07e9c42fcd34fcbc40f545b081356a299e11f360c9c274b348c05fb0113fc3d492e5175eee140
@@ -2132,6 +2132,8 @@ __metadata:
21322132
"@angular/platform-browser": "npm:^18.2.13"
21332133
"@angular/platform-browser-dynamic": "npm:^18.2.13"
21342134
"@compodoc/compodoc": "npm:^1.1.26"
2135+
"@eslint/eslintrc": "npm:^3.2.0"
2136+
"@eslint/js": "npm:^9.18.0"
21352137
"@segment/analytics-next": "npm:^1.76.1"
21362138
"@types/jasmine": "npm:^5.1.5"
21372139
"@types/node": "npm:^20.17.12"

0 commit comments

Comments
 (0)