Skip to content

Commit

Permalink
feat(Test workflow): Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Alirezaja1384 committed Aug 19, 2024
1 parent e15c25d commit 94bc4ee
Show file tree
Hide file tree
Showing 5 changed files with 1,436 additions and 153 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests
name: Lint and run tests
on:
pull_request:
types: [opened, synchronize, reopened]
Expand Down Expand Up @@ -27,6 +27,9 @@ jobs:
- name: Install dependencies
run: npm install

- name: Lint code
run: npm run lint

- name: Run tests
env:
CHROME_BIN: ${{ steps.chromedriver.outputs.chrome-path }}
Expand Down
14 changes: 13 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,23 @@
"scripts": [],
"karmaConfig": "karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"analytics": false
"analytics": false,
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
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: "app",
style: "camelCase",
},
],
"@angular-eslint/component-selector": [
"error",
{
type: "element",
prefix: "app",
style: "kebab-case",
},
],
},
},
{
files: ["**/*.html"],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
],
rules: {},
}
);
Loading

0 comments on commit 94bc4ee

Please sign in to comment.