Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: Migrate from tslint to eslint in KWA #2042

Merged
merged 4 commits into from
Dec 1, 2022
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
13 changes: 10 additions & 3 deletions .github/workflows/test-node.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Frontend Test

on:
- pull_request
pull_request:
paths:
- pkg/new-ui/v1beta1/frontend/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test
name: Code format and lint
runs-on: ubuntu-latest

steps:
Expand All @@ -21,11 +23,16 @@ jobs:
with:
node-version: 12.18.1

- name: Run Node test
- name: Format katib code
run: |
npm install prettier --prefix ./pkg/new-ui/v1beta1/frontend
make prettier-check

- name: Lint katib code
run: |
cd pkg/new-ui/v1beta1/frontend
npm run lint-check

frontend-unit-tests:
name: Frontend Unit Tests
runs-on: ubuntu-latest
Expand Down
51 changes: 51 additions & 0 deletions pkg/new-ui/v1beta1/frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"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"
],
"rules": {}
}
]
}
39 changes: 24 additions & 15 deletions pkg/new-ui/v1beta1/frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
"output": "assets/monaco-editor"
}
],
"styles": ["src/styles.scss", "src/assets/css/d3.parcoords.css"],
"styles": [
"src/styles.scss",
"src/assets/css/d3.parcoords.css"
],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
Expand Down Expand Up @@ -96,23 +99,17 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": [],
"preserveSymlinks": true
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand All @@ -124,9 +121,21 @@
"devServerTarget": "frontend:serve:production"
}
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"defaultProject": "frontend"
"defaultProject": "frontend",
"cli": {
"defaultCollection": "@angular-eslint/schematics"
}
}
Loading