Skip to content

Commit

Permalink
Got linting to working and added GitHub action "lint" (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
REDDERD authored Sep 28, 2023
1 parent f1ea01f commit a129517
Show file tree
Hide file tree
Showing 5 changed files with 2,427 additions and 863 deletions.
47 changes: 47 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
],
"rules": {}
}
]
}
25 changes: 25 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Linting

on:
push:
branches:
- '**' # Wird für jeden Push auf einen Branch durchgeführt

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install Dependencies
run: npm install

- name: Run ng lint
run: npx ng lint
14 changes: 13 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,23 @@
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"analytics": "877cf958-4b8f-4755-bc70-9895434252db"
"analytics": "877cf958-4b8f-4755-bc70-9895434252db",
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
Loading

0 comments on commit a129517

Please sign in to comment.