Skip to content

Commit d5cf529

Browse files
committed
fix: bump dependencies, fix comment vote issue, update linters
1 parent 4a3c3a3 commit d5cf529

File tree

64 files changed

+933
-902
lines changed

Some content is hidden

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

64 files changed

+933
-902
lines changed

eslint.config.mjs

Lines changed: 64 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,70 @@
1-
import {FlatCompat} from '@eslint/eslintrc';
2-
import js from '@eslint/js';
1+
import eslint from '@eslint/js';
2+
import angular from 'angular-eslint';
3+
import depend from 'eslint-plugin-depend';
34
import perfectionist from 'eslint-plugin-perfectionist';
45
import {default as eslintPluginPrettierRecommended} from 'eslint-plugin-prettier/recommended';
56
import sonarjs from 'eslint-plugin-sonarjs';
6-
import path from 'node:path';
7-
import {fileURLToPath} from 'node:url';
7+
import {defineConfig} from 'eslint/config';
8+
import tseslint from 'typescript-eslint';
89

9-
const __filename = fileURLToPath(import.meta.url);
10-
const __dirname = path.dirname(__filename);
11-
const compat = new FlatCompat({
12-
allConfig: js.configs.all,
13-
baseDirectory: __dirname,
14-
recommendedConfig: js.configs.recommended,
15-
});
16-
17-
export default [
10+
export default defineConfig([
11+
{
12+
extends: [
13+
// Apply the recommended core rules
14+
eslint.configs.recommended,
15+
// Apply the recommended TypeScript rules
16+
...tseslint.configs.recommended,
17+
// Optionally apply stylistic rules from typescript-eslint that improve code consistency
18+
...tseslint.configs.stylistic,
19+
// Apply the recommended Angular rules
20+
...angular.configs.tsRecommended,
21+
],
22+
// Everything in this config object targets our TypeScript files (Components, Directives, Pipes etc)
23+
files: ['**/*.ts'],
24+
// Set the custom processor which will allow us to have our inline Component templates extracted
25+
// and treated as if they are HTML files (and therefore have the .html config below applied to them)
26+
processor: angular.processInlineTemplates,
27+
// Override specific rules for TypeScript files (these will take priority over the extended configs above)
28+
rules: {
29+
'@angular-eslint/component-selector': [
30+
'error',
31+
{
32+
prefix: 'app',
33+
style: 'kebab-case',
34+
type: 'element',
35+
},
36+
],
37+
'@angular-eslint/directive-selector': [
38+
'error',
39+
{
40+
prefix: 'app',
41+
style: 'camelCase',
42+
type: 'attribute',
43+
},
44+
],
45+
},
46+
},
47+
{
48+
extends: [
49+
// Apply the recommended Angular template rules
50+
...angular.configs.templateRecommended,
51+
// Apply the Angular template rules which focus on accessibility of our apps
52+
...angular.configs.templateAccessibility,
53+
],
54+
// Everything in this config object targets our HTML files (external templates,
55+
// and inline templates as long as we have the `processor` set on our TypeScript config above)
56+
files: ['**/*.html'],
57+
rules: {
58+
'@angular-eslint/template/elements-content': 'off',
59+
},
60+
},
61+
{
62+
extends: ['depend/flat/recommended'],
63+
files: ['**/*.ts'],
64+
plugins: {
65+
depend,
66+
},
67+
},
1868
{
1969
...perfectionist.configs['recommended-natural'],
2070
rules: {
@@ -30,18 +80,6 @@ export default [
3080
{
3181
ignores: ['src/grpc/**/*'],
3282
},
33-
...compat
34-
.extends(
35-
'eslint:recommended',
36-
'plugin:@typescript-eslint/recommended',
37-
'plugin:@angular-eslint/recommended',
38-
'plugin:@angular-eslint/template/process-inline-templates',
39-
'plugin:depend/recommended',
40-
)
41-
.map((config) => ({
42-
...config,
43-
files: ['**/*.ts'],
44-
})),
4583
{
4684
files: ['**/*.ts'],
4785
languageOptions: {
@@ -71,19 +109,6 @@ export default [
71109
],
72110
},
73111
},
74-
...compat.extends('plugin:@angular-eslint/template/recommended').map((config) => ({
75-
...config,
76-
files: ['**/*.html'],
77-
})),
78-
{
79-
files: ['**/*.html'],
80-
rules: {},
81-
},
82-
...compat.extends('plugin:prettier/recommended').map((config) => ({
83-
...config,
84-
files: ['**/*.html'],
85-
ignores: ['**/*inline-template-*.component.html'],
86-
})),
87112
{
88113
files: ['**/*.html'],
89114
ignores: ['**/*inline-template-*.component.html'],
@@ -96,4 +121,4 @@ export default [
96121
],
97122
},
98123
},
99-
];
124+
]);

0 commit comments

Comments
 (0)