1+ import { defineConfig , globalIgnores } from "eslint/config" ;
2+ import prettier from "eslint-plugin-prettier" ;
3+ import path from "node:path" ;
4+ import { fileURLToPath } from "node:url" ;
5+ import js from "@eslint/js" ;
6+ import { FlatCompat } from "@eslint/eslintrc" ;
7+
8+ const __filename = fileURLToPath ( import . meta. url ) ;
9+ const __dirname = path . dirname ( __filename ) ;
10+ const compat = new FlatCompat ( {
11+ baseDirectory : __dirname ,
12+ recommendedConfig : js . configs . recommended ,
13+ allConfig : js . configs . all
14+ } ) ;
15+
16+ export default defineConfig ( [ globalIgnores ( [
17+ ".angular/*" ,
18+ "projects/**/*" ,
19+ "dist/*" ,
20+ "coverage/*" ,
21+ "e2e/*" ,
22+ "**/*.d.ts" ,
23+ "**/main.ts"
24+ ] ) , {
25+ extends : compat . extends ( "eslint:recommended" , "plugin:@typescript-eslint/recommended" ) ,
26+ } , {
27+ files : [ "**/*.ts" ] ,
28+
29+ extends : compat . extends (
30+ "plugin:@angular-eslint/recommended" ,
31+ "plugin:@angular-eslint/template/process-inline-templates" ,
32+ "eslint:recommended" ,
33+ "plugin:@typescript-eslint/recommended" ,
34+ "plugin:@typescript-eslint/recommended-requiring-type-checking" ,
35+ "plugin:prettier/recommended" ,
36+ "prettier" ,
37+ ) ,
38+
39+ plugins : {
40+ prettier,
41+ } ,
42+
43+ languageOptions : {
44+ ecmaVersion : 5 ,
45+ sourceType : "script" ,
46+
47+ parserOptions : {
48+ project : [ "tsconfig.json" , "e2e/tsconfig.json" ] ,
49+ createDefaultProgram : true ,
50+ } ,
51+ } ,
52+
53+ rules : {
54+ "array-bracket-spacing" : [ "error" , "never" ] ,
55+ "arrow-body-style" : [ "error" , "as-needed" ] ,
56+ "arrow-parens" : [ "error" , "as-needed" ] ,
57+
58+ "brace-style" : [ "error" , "1tbs" , {
59+ allowSingleLine : true ,
60+ } ] ,
61+
62+ "comma-dangle" : [ "error" , "never" ] ,
63+ curly : [ 2 ] ,
64+ "eol-last" : [ "error" , "always" ] ,
65+ eqeqeq : "error" ,
66+ "guard-for-in" : "error" ,
67+
68+ // Removing indent rule as it's handled by Prettier
69+ // indent: ["error", 2, {
70+ // SwitchCase: 1,
71+ // FunctionExpression: {
72+ // parameters: "first",
73+ // },
74+ // }],
75+
76+ "no-caller" : "error" ,
77+ "no-bitwise" : "error" ,
78+
79+ "no-console" : [ "error" , {
80+ allow : [ "warn" , "error" ] ,
81+ } ] ,
82+
83+ "no-empty" : "error" ,
84+ "no-fallthrough" : "error" ,
85+ "no-labels" : "error" ,
86+ "no-multi-spaces" : "error" ,
87+ "no-multiple-empty-lines" : "error" ,
88+
89+ "no-restricted-imports" : [ "error" , {
90+ paths : [ "rxjs/Rx" ] ,
91+ } ] ,
92+
93+ "no-trailing-spaces" : "error" ,
94+ "no-throw-literal" : "error" ,
95+ "no-whitespace-before-property" : "error" ,
96+ "quote-props" : [ "error" , "as-needed" ] ,
97+ quotes : [ "error" , "single" ] ,
98+ semi : [ "error" , "always" ] ,
99+ "space-before-blocks" : "error" ,
100+ "space-infix-ops" : "error" ,
101+ "@angular-eslint/component-class-suffix" : "error" ,
102+
103+ "@angular-eslint/component-selector" : [ "error" , {
104+ prefix : [ "app" , "widget" , "rz" ] ,
105+ style : "kebab-case" ,
106+ type : "element" ,
107+ } ] ,
108+
109+ "@angular-eslint/directive-class-suffix" : "error" ,
110+
111+ "@angular-eslint/directive-selector" : [ "error" , {
112+ prefix : [ "app" , "widget" , "rz" ] ,
113+ style : "camelCase" ,
114+ type : "attribute" ,
115+ } ] ,
116+
117+ "@angular-eslint/no-empty-lifecycle-method" : "error" ,
118+ //"@angular-eslint/no-host-metadata-property": "error",
119+ "@angular-eslint/no-input-rename" : "error" ,
120+ "@angular-eslint/no-inputs-metadata-property" : "error" ,
121+ "@angular-eslint/no-output-on-prefix" : "error" ,
122+ "@angular-eslint/no-output-rename" : "error" ,
123+ "@angular-eslint/no-outputs-metadata-property" : "error" ,
124+ "@angular-eslint/prefer-standalone" : "off" ,
125+ "@angular-eslint/use-lifecycle-interface" : "error" ,
126+ "@angular-eslint/use-pipe-transform-interface" : "error" ,
127+
128+ "@typescript-eslint/array-type" : [ "error" , {
129+ default : "array" ,
130+ } ] ,
131+
132+ "@typescript-eslint/consistent-type-definitions" : [ "error" , "interface" ] ,
133+ /*
134+ "@typescript-eslint/member-delimiter-style": ["error", {
135+ multiline: {
136+ delimiter: "semi",
137+ requireLast: true,
138+ },
139+
140+ singleline: {
141+ delimiter: "semi",
142+ requireLast: false,
143+ },
144+ }],*/
145+
146+ "@typescript-eslint/member-ordering" : [ "error" , {
147+ default : {
148+ memberTypes : [ "static-field" , "instance-field" , "static-method" , "instance-method" ] ,
149+ } ,
150+ } ] ,
151+
152+ "@typescript-eslint/naming-convention" : [ "error" , {
153+ selector : "variableLike" ,
154+ format : [ "camelCase" , "UPPER_CASE" ] ,
155+ leadingUnderscore : "allow" ,
156+ trailingUnderscore : "allow" ,
157+ } , {
158+ selector : "enumMember" ,
159+ format : [ "UPPER_CASE" ] ,
160+ } , {
161+ selector : "typeLike" ,
162+ format : [ "PascalCase" ] ,
163+ } ] ,
164+
165+ "@typescript-eslint/no-empty-interface" : [ "error" , {
166+ allowSingleExtends : true ,
167+ } ] ,
168+
169+ "@typescript-eslint/no-inferrable-types" : [ "error" , {
170+ ignoreParameters : true ,
171+ } ] ,
172+
173+ "@typescript-eslint/no-non-null-assertion" : "error" ,
174+ "@typescript-eslint/prefer-for-of" : "error" ,
175+ "@typescript-eslint/prefer-function-type" : "error" ,
176+ //"@typescript-eslint/type-annotation-spacing": "error",
177+
178+ "@typescript-eslint/unbound-method" : [ "error" , {
179+ ignoreStatic : true ,
180+ } ] ,
181+
182+ "prettier/prettier" : "error" ,
183+ } ,
184+ } , {
185+ files : [ "**/*.html" ] ,
186+
187+ extends : compat . extends (
188+ "plugin:@angular-eslint/template/recommended" ,
189+ "plugin:prettier/recommended" ,
190+ "prettier" ,
191+ ) ,
192+
193+ rules : {
194+ "@angular-eslint/template/eqeqeq" : [ "error" ] ,
195+ "@angular-eslint/template/no-negated-async" : "error" ,
196+ "prettier/prettier" : "error" ,
197+ } ,
198+ } ] ) ;
0 commit comments