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

Create linter.yml #440

Closed
wants to merge 11 commits into from
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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

[*]
Expand All @@ -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

Expand Down
78 changes: 78 additions & 0 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -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
66 changes: 66 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -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]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to include "release" branch as well, but I can add that later

# 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 }}