Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 46 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Code Quality Checks

on:
pull_request:
branches:
- '**'

jobs:
code-quality:
name: Run Code Quality Checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.15.0'

- name: Restore node_modules cache
id: cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-

- name: Install dependencies
run: npm ci

- name: Save node_modules cache
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}

- name: Run lint
run: npm run lint

- name: Run test
run: npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI

15 changes: 14 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
"tsConfig": "projects/common-form-elements/tsconfig.spec.json",
"karmaConfig": "projects/common-form-elements/karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/common-form-elements/**/*.ts",
"projects/common-form-elements/**/*.html"
],
"eslintConfig": "projects/common-form-elements/eslint.config.js"
}
}
}
},
Expand Down Expand Up @@ -128,6 +138,9 @@
}
},
"cli": {
"analytics": false
"analytics": false,
"schematicCollections": [
"angular-eslint"
]
}
}
43 changes: 43 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// @ts-check
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
const angular = require("angular-eslint");

module.exports = tseslint.config(
{
files: ["**/*.ts"],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
...angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
"@angular-eslint/directive-selector": [
"error",
{
type: "attribute",
prefix: "sb",
style: "camelCase",
},
],
"@angular-eslint/component-selector": [
"warn",
{
type: "element",
prefix: "sb",
style: "kebab-case",
},
],
},
},
{
files: ["**/*.html"],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
],
rules: {},
}
);
Loading
Loading