Skip to content

Commit

Permalink
Merge pull request #241 from SamuelBradley/AUS-3898
Browse files Browse the repository at this point in the history
AUS 3898: Establish Linting with ESLint
  • Loading branch information
stuartwoodman authored Mar 15, 2023
2 parents e796865 + 7ab1a69 commit c8bcf31
Show file tree
Hide file tree
Showing 30 changed files with 22,476 additions and 18,258 deletions.
50 changes: 50 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json", "e2e/tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/recommended--extra",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"warn",
{
"prefix": "app",
"style": "kebab-case",
"type": ["element", "attribute"]
}
],
"@angular-eslint/directive-selector": [
"error",
{
"prefix": "app",
"style": "camelCase",
"type": "attribute"
}
],
"@typescript-eslint/no-explicit-any": "off", //Too Many, needed to turn off
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"prefer-const": "warn",
"@typescript-eslint/ban-types": "warn",
"no-var": "warn",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/no-inferrable-types": "off"
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
}
]
}
26 changes: 26 additions & 0 deletions .github/workflows/lint-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint Portal UI

on:
push:
branches:
- master
- '**/AUS*'

pull_request:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
24 changes: 19 additions & 5 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
"analytics": false,
"defaultCollection": "@angular-eslint/schematics"
},
"version": 1,
"newProjectRoot": "projects",
Expand All @@ -26,7 +27,11 @@
"src/extension",
"src/favicon-16x16.png",
"src/favicon-32x32.png",
{ "glob": "**/*", "input": "./node_modules/cesium/Build/Cesium", "output": "./assets/cesium" }
{
"glob": "**/*",
"input": "./node_modules/cesium/Build/Cesium",
"output": "./assets/cesium"
}
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
Expand All @@ -36,7 +41,7 @@
"node_modules/nouislider/distribute/nouislider.min.css",
"src/extension/css/d3.css",
"node_modules/@ng-select/ng-select/themes/default.theme.css",
"./node_modules/cesium/Build/Cesium/Widgets/widgets.css"
"./node_modules/cesium/Build/Cesium/Widgets/widgets.css"
],
"scripts": [
"node_modules/d3/d3.min.js",
Expand All @@ -50,7 +55,7 @@
"src/extension/js/no-ie-support.js",
"./node_modules/cesium/Build/Cesium/Cesium.js"
],
"customWebpackConfig": {
"customWebpackConfig": {
"path": "./extra-webpack.config.js"
}
},
Expand Down Expand Up @@ -142,7 +147,7 @@
},
"development": {
"browserTarget": "project:build:development"
}
}
},
"defaultConfiguration": "development"
},
Expand Down Expand Up @@ -184,6 +189,15 @@
"src/favicon-32x32.png"
]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
},
Expand Down
Loading

0 comments on commit c8bcf31

Please sign in to comment.