Skip to content

Commit

Permalink
Merge pull request #257 from Northeastern-Electric-Racing/fix-prettie…
Browse files Browse the repository at this point in the history
…r-and-linter

update prettier/linter setup and workflows
  • Loading branch information
RChandler234 authored Dec 19, 2024
2 parents c944d04 + aba4ccc commit 85bee49
Show file tree
Hide file tree
Showing 115 changed files with 4,887 additions and 3,757 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/lint-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- main
- develop
- 'feature/**'
- "feature/**"

jobs:
run-linting-check:
Expand All @@ -17,14 +17,15 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16.17.1
cache: 'npm'
node-version: 20.17.0
cache: "npm"
cache-dependency-path: ./angular-client/package-lock.json
- name: Install modules
working-directory: ./angular-client
run: npm install
- name: Run linting check
working-directory: ./angular-client
run: npm run lint --max-warnings=0
8 changes: 5 additions & 3 deletions .github/workflows/prettier-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:
branches:
- main
- develop
- 'feature/**'

- "feature/**"

jobs:
run-prettier-check:
Expand All @@ -22,8 +21,11 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.17.1
cache: 'npm'
cache: "npm"
cache-dependency-path: ./angular-client/package-lock.json
- name: Install modules
working-directory: ./angular-client
run: npm install
- name: Run prettier check
working-directory: ./angular-client
run: npm run prettier-check
90 changes: 90 additions & 0 deletions angular-client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*",
"**/.github/**",
"build",
"coverage",
"docs",
"lambda",
"node_modules",
"public",
"lib",
"dist",
"generated"
],
"overrides": [
{
"files": [
"*.ts"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"style": "kebab-case"
}
],
"guard-for-in": "error",
"prefer-arrow-callback": "error",
"no-unsafe-negation": [
"error",
{
"enforceForOrderingRelations": true
}
],
"no-unsafe-optional-chaining": [
"error",
{
"disallowArithmeticOperators": true
}
],
"eqeqeq": "error",
"no-else-return": "error",
"no-lonely-if": "error",
"no-throw-literal": "error",
"prefer-promise-reject-errors": "error",
"no-unneeded-ternary": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-const": "error",
"prefer-destructuring": [
"error",
{
"VariableDeclarator": {
"array": true,
"object": true
},
"AssignmentExpression": {
"array": true,
"object": true
}
},
{
"enforceForRenamedProperties": false
}
],
"prefer-exponentiation-operator": "error",
"prefer-object-spread": "error",
"prefer-rest-params": "error",
"prefer-spread": "error"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
72 changes: 72 additions & 0 deletions angular-client/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# Environment variables

# System files
.DS_Store
Thumbs.db

.dockerignore

.gitignore

.editorconfig

.prettierignore
.prettierrc.json
*.json
*.yml
*.js
*.conf
*.md
Dockerfile

.github
.vscode

# ignore docker, etc
*.yml

.eslintrc.js
tsconfig.json

tsconfig.*.json

README.md
7 changes: 7 additions & 0 deletions angular-client/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "none",
"tabWidth": 2,
"singleQuote": true,
"printWidth": 125
}
38 changes: 32 additions & 6 deletions angular-client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
"base": "dist/angular-client"
},
"index": "src/index.html",
"polyfills": ["zone.js"],
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css",
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
Expand Down Expand Up @@ -76,17 +81,38 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": ["zone.js", "zone.js/testing"],
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["@angular/material/prebuilt-themes/deeppurple-amber.css", "src/styles.css"],
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"@angular/material/prebuilt-themes/deeppurple-amber.css",
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"analytics": "21a1f8c6-2f5d-46e0-8ef6-df03c0607381"
"analytics": "21a1f8c6-2f5d-46e0-8ef6-df03c0607381",
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
Loading

0 comments on commit 85bee49

Please sign in to comment.