Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a4882fb
chore: add linting and type checking setup
sjblurton Mar 19, 2026
cb4d8d4
fix(tests): update JSON string formatting in TodosStorageService tests
sjblurton Mar 19, 2026
ba8f299
chore: set up ESLint configuration and update pre-commit hook
sjblurton Mar 19, 2026
d6736f9
chore: update package-lock.json
sjblurton Mar 19, 2026
021d30b
chore: remove extraneous dependencies from package-lock.json
sjblurton Mar 19, 2026
a5cc08b
Potential fix for pull request finding
sjblurton Mar 19, 2026
01ed339
Potential fix for pull request finding
sjblurton Mar 19, 2026
b49564a
Potential fix for pull request finding
sjblurton Mar 19, 2026
5e4e90c
Potential fix for pull request finding
sjblurton Mar 19, 2026
ad366d1
Potential fix for pull request finding
sjblurton Mar 19, 2026
9a6b2d7
Update default Node.js version to '22.x' in CI setup and workflows
sjblurton Mar 19, 2026
5d652ce
Remove ESLint configuration file
sjblurton Mar 19, 2026
6c06a20
Uncomment npm version alignment step in CI workflows
sjblurton Mar 19, 2026
8583590
Refactor ESLint configuration for TypeScript and HTML files
sjblurton Mar 19, 2026
b88d12b
Refactor CI workflow to simplify Node.js setup and remove redundant s…
sjblurton Mar 19, 2026
f11e1a8
Update @angular-eslint packages to version 21.3.1 and comment out npm…
sjblurton Mar 19, 2026
0aadf7e
Remove commented npm version alignment step from CI setup
sjblurton Mar 19, 2026
bb809fa
Update schematicCollections to use the correct namespace for @angular…
sjblurton Mar 19, 2026
ecd1bc0
Add recommended and accessibility rules for @angular-eslint/template
sjblurton Mar 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
node-version:
description: Node.js version to install.
required: false
default: '22'
default: '22.x'

runs:
using: composite
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/lint-and-typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint & Type Check

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

steps:
- uses: actions/checkout@v4

- name: Setup CI
uses: ./.github/actions/setup-ci
with:
node-version: ${{ matrix.node-version }}

- name: Run ESLint
run: npm run lint

- name: Run TypeScript type check
run: npm run type-check
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.ts": ["eslint --fix", "prettier --write"]
}
11 changes: 10 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{
"printWidth": 100,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"endOfLine": "lf",
"overrides": [
{
"files": "*.html",
"options": {
"parser": "angular"
"parser": "angular",
"printWidth": 100
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": 1,
"cli": {
"packageManager": "npm",
"schematicCollections": ["angular-eslint"]
"schematicCollections": ["@angular-eslint/schematics"]
},
"newProjectRoot": "projects",
"projects": {
Expand Down
83 changes: 67 additions & 16 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
// @ts-check
const eslint = require('@eslint/js');
const { defineConfig } = require('eslint/config');
const tseslint = require('typescript-eslint');
const angular = require('angular-eslint');
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import angularEslintPlugin from '@angular-eslint/eslint-plugin';
import angularEslintTemplatePlugin from '@angular-eslint/eslint-plugin-template';
import angularEslintTemplateParser from '@angular-eslint/template-parser';

module.exports = defineConfig([
export default [
{
ignores: ['node_modules', 'dist', 'coverage', '.angular', 'storybook-static'],
},
js.configs.recommended,
...tseslint.configs.recommended.map((config) => ({
...config,
files: ['**/*.ts'],
})),
...tseslint.configs.stylistic.map((config) => ({
...config,
files: ['**/*.ts'],
})),
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.stylistic,
angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
},
},
plugins: {
'@angular-eslint': angularEslintPlugin,
'@typescript-eslint': tseslint.plugin,
},
rules: {
'@angular-eslint/directive-selector': [
'error',
Expand All @@ -33,9 +48,45 @@ module.exports = defineConfig([
],
},
},
{
files: ['**/*.spec.ts'],
languageOptions: {
globals: {
describe: 'readonly',
it: 'readonly',
beforeEach: 'readonly',
expect: 'readonly',
},
},
},
{
files: ['**/*.html'],
extends: [angular.configs.templateRecommended, angular.configs.templateAccessibility],
rules: {},
languageOptions: {
parser: angularEslintTemplateParser,
},
plugins: {
'@angular-eslint/template': angularEslintTemplatePlugin,
},
rules: {
// recommended
'@angular-eslint/template/banana-in-box': 'error',
'@angular-eslint/template/eqeqeq': 'error',
'@angular-eslint/template/no-negated-async': 'error',
'@angular-eslint/template/prefer-control-flow': 'error',
// accessibility
'@angular-eslint/template/alt-text': 'error',
'@angular-eslint/template/click-events-have-key-events': 'error',
'@angular-eslint/template/elements-content': 'error',
'@angular-eslint/template/interactive-supports-focus': 'error',
'@angular-eslint/template/label-has-associated-control': 'error',
'@angular-eslint/template/mouse-events-have-key-events': 'error',
'@angular-eslint/template/no-autofocus': 'error',
'@angular-eslint/template/no-distracting-elements': 'error',
'@angular-eslint/template/role-has-required-aria': 'error',
'@angular-eslint/template/table-scope': 'error',
'@angular-eslint/template/valid-aria': 'error',
// extra
'@angular-eslint/template/use-track-by-function': 'warn',
},
},
]);
];
Loading
Loading