From 6642de889fb036db5212f75a4638d90d6cc318b8 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Fri, 24 Nov 2023 19:04:31 -0700 Subject: [PATCH 1/7] Create linter.yml Let github lint everything. --- .github/workflows/linter.yml | 66 ++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 000000000..6bffe3035 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,66 @@ +--- +################################# +################################# +## Super Linter GitHub Actions ## +################################# +################################# +name: Lint Code Base + +# +# Documentation: +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions +# + +############################# +# Start the job on all push # +############################# +on: + push: + branches-ignore: [master, main] + # Remove the line above to run when pushing to master + pull_request: + branches: [master, main] + +############### +# Set the Job # +############### +jobs: + build: + # Name the Job + name: Lint Code Base + # Set the agent to run on + runs-on: ubuntu-latest + + ############################################ + # Grant status permission for MULTI_STATUS # + ############################################ + permissions: + contents: read + packages: read + statuses: write + + ################## + # Load all steps # + ################## + steps: + ########################## + # Checkout the code base # + ########################## + - name: Checkout Code + uses: actions/checkout@v3 + with: + # Full git history is needed to get a proper + # list of changed files within `super-linter` + fetch-depth: 0 + + ################################ + # Run Linter against code base # + ################################ + - name: Lint Code Base + uses: super-linter/super-linter@v5 + env: + VALIDATE_ALL_CODEBASE: false + # Change to 'master' if your main branch differs + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From 6bae4d608aeeb8cfe00e029cbd0eef5bad256e3d Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Fri, 24 Nov 2023 19:27:44 -0700 Subject: [PATCH 2/7] Update .editorconfig Super linter said lines too long. --- .editorconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 0689ead91..136378e0b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,6 @@ # EditorConfig is awesome: https://EditorConfig.org -# Stop the editor from looking for ".editorconfig" files in the parent directories. +# Stop editor looking for ".editorconfig" in parent directories. root = true [*] @@ -9,7 +9,7 @@ root = true charset = utf-8 insert_final_newline = true -# Caveat: Prettier won’t trim trailing whitespace inside template strings, +# Caveat: Prettier won’t trim whitespace inside template strings, # but your editor might. trim_trailing_whitespace = true From da706b3fdacd65ac8931c4521365b80b6ee60dba Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Fri, 24 Nov 2023 23:44:27 -0700 Subject: [PATCH 3/7] Create test.txt Need the folder for the reports. --- .github/workflows/super-linter.report/test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/workflows/super-linter.report/test.txt diff --git a/.github/workflows/super-linter.report/test.txt b/.github/workflows/super-linter.report/test.txt new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/.github/workflows/super-linter.report/test.txt @@ -0,0 +1 @@ + From eba99009d2facdcf24beb601d052e537aba3c86e Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Sat, 25 Nov 2023 00:02:06 -0700 Subject: [PATCH 4/7] Create .eslintrc.yml We will need to set up the rules for each language. --- .github/linters/.eslintrc.yml | 78 +++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/linters/.eslintrc.yml diff --git a/.github/linters/.eslintrc.yml b/.github/linters/.eslintrc.yml new file mode 100644 index 000000000..c933e1d0f --- /dev/null +++ b/.github/linters/.eslintrc.yml @@ -0,0 +1,78 @@ +--- +############################# +############################# +## JavaScript Linter rules ## +############################# +############################# + +############ +# Env Vars # +############ +env: + browser: true + es6: true + jest: true + +############### +# Global Vars # +############### +globals: + Atomics: readonly + SharedArrayBuffer: readonly + +ignorePatterns: + - "!.*" + - "**/node_modules/.*" + +############### +# Parser vars # +############### +parser: '@typescript-eslint/parser' +parserOptions: + ecmaVersion: 2018 + sourceType: module + +########### +# Plugins # +########### +plugins: + - '@typescript-eslint' + +######### +# Rules # +######### +rules: { + eqeqeq: ["error", "smart"] +} + +############################## +# Overrides for JSON parsing # +############################## +overrides: + + # JSON files + - files: + - "*.json" + extends: + - plugin:jsonc/recommended-with-json + parser: jsonc-eslint-parser + parserOptions: + jsonSyntax: JSON + + # JSONC files + - files: + - "*.jsonc" + extends: + - plugin:jsonc/recommended-with-jsonc + parser: jsonc-eslint-parser + parserOptions: + jsonSyntax: JSONC + + # JSON5 files + - files: + - "*.json5" + extends: + - plugin:jsonc/recommended-with-json5 + parser: jsonc-eslint-parser + parserOptions: + jsonSyntax: JSON5 From ed2d9460cd48a43c5edac1f85405a32b6f818ac6 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Sat, 25 Nov 2023 00:11:52 -0700 Subject: [PATCH 5/7] Delete .github/workflows/super-linter.report/test.txt Didn't actually need this. --- .github/workflows/super-linter.report/test.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/workflows/super-linter.report/test.txt diff --git a/.github/workflows/super-linter.report/test.txt b/.github/workflows/super-linter.report/test.txt deleted file mode 100644 index 8d1c8b69c..000000000 --- a/.github/workflows/super-linter.report/test.txt +++ /dev/null @@ -1 +0,0 @@ - From 8680f7ad024b74344cb919014ab72327b7027541 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Sat, 25 Nov 2023 00:22:54 -0700 Subject: [PATCH 6/7] Update linter.yml Line too long and trailing whitespace. --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 6bffe3035..9c9308d1d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -8,7 +8,8 @@ name: Lint Code Base # # Documentation: -# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions +# https://docs.github.com/en/actions/learn-github-actions/ +# workflow-syntax-for-github-actions # ############################# @@ -63,4 +64,3 @@ jobs: # Change to 'master' if your main branch differs DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - From dbe917e447ef58798bdcea4570760bf84c220145 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Thu, 30 Nov 2023 03:56:02 -0700 Subject: [PATCH 7/7] Update .eslintrc.yml Program didn't like extra whitespace. --- .github/linters/.eslintrc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/linters/.eslintrc.yml b/.github/linters/.eslintrc.yml index c933e1d0f..7495d3e0a 100644 --- a/.github/linters/.eslintrc.yml +++ b/.github/linters/.eslintrc.yml @@ -41,7 +41,7 @@ plugins: ######### # Rules # ######### -rules: { +rules: { eqeqeq: ["error", "smart"] }