Skip to content

Commit c727100

Browse files
authored
Merge pull request #13 from dimeloper/feature/enable-incremental-hydration
Update eslint config, enable incremental hydration.
2 parents 3c03730 + 4f982ff commit c727100

14 files changed

Lines changed: 747 additions & 190 deletions

.eslintrc.json

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

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pnpm run lint || exit 1
2-
pnpm run format:check || exit 1
1+
#!/usr/bin/env sh
2+
pnpm lint-staged

eslint.config.mjs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import angular from '@angular-eslint/eslint-plugin';
2+
import angularTemplate from '@angular-eslint/eslint-plugin-template';
3+
import angularParser from '@angular-eslint/template-parser';
4+
import tsParser from '@typescript-eslint/parser';
5+
6+
export default [
7+
// Ignore patterns
8+
{
9+
ignores: [
10+
'dist/**/*',
11+
'coverage/**/*',
12+
'node_modules/**/*',
13+
'projects/**/*',
14+
],
15+
},
16+
17+
// TypeScript files configuration
18+
{
19+
files: ['**/*.ts'],
20+
languageOptions: {
21+
parser: tsParser,
22+
parserOptions: {
23+
project: ['./tsconfig.json', './e2e/tsconfig.json'],
24+
},
25+
},
26+
plugins: {
27+
'@angular-eslint': angular,
28+
},
29+
rules: {
30+
...angular.configs.recommended.rules,
31+
'@angular-eslint/component-selector': [
32+
'error',
33+
{
34+
prefix: 'app',
35+
style: 'kebab-case',
36+
type: 'element',
37+
},
38+
],
39+
'@angular-eslint/directive-selector': [
40+
'error',
41+
{
42+
prefix: 'app',
43+
style: 'camelCase',
44+
type: 'attribute',
45+
},
46+
],
47+
},
48+
},
49+
50+
// HTML template files configuration
51+
{
52+
files: ['**/*.html'],
53+
languageOptions: {
54+
parser: angularParser,
55+
},
56+
plugins: {
57+
'@angular-eslint/template': angularTemplate,
58+
},
59+
rules: {
60+
...angularTemplate.configs.recommended.rules,
61+
},
62+
},
63+
];

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
7+
"start:defer": "ng serve --no-hmr",
78
"build": "ng build",
89
"watch": "ng build --watch --configuration development",
910
"test": "ng test",
@@ -16,6 +17,18 @@
1617
"bundle-report": "ng build --configuration production --source-map && source-map-explorer dist/*.js",
1718
"prepare": "husky"
1819
},
20+
"lint-staged": {
21+
"*.{js,jsx,ts,tsx}": [
22+
"eslint --fix",
23+
"prettier --write"
24+
],
25+
"*.{html,css,scss}": [
26+
"prettier --write"
27+
],
28+
"*.{json,md}": [
29+
"prettier --write"
30+
]
31+
},
1932
"private": true,
2033
"dependencies": {
2134
"@angular/animations": "^19.2.8",
@@ -59,6 +72,7 @@
5972
"husky": "^9.1.7",
6073
"jasmine-core": "~5.1.0",
6174
"jsdom": "^26.1.0",
75+
"lint-staged": "^16.0.0",
6276
"prettier": "^3.2.5",
6377
"source-map-explorer": "^2.5.3",
6478
"typescript": "~5.6.3",

0 commit comments

Comments
 (0)