Skip to content

Commit

Permalink
setup: add eslint configs, include eslint and prettier in github work…
Browse files Browse the repository at this point in the history
…flow
  • Loading branch information
jinkang-0 committed Jan 4, 2024
1 parent 7dd430a commit 2bd767c
Show file tree
Hide file tree
Showing 4 changed files with 3,830 additions and 754 deletions.
35 changes: 35 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:astro/recommended",
"plugin:astro/jsx-a11y-recommended"
],
overrides: [
{
files: ["*.astro"],
parser: "astro-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"]
}
},
{
files: [".jsx", ".tsx"],
extends: ["plugin:react/recommended"],
plugins: ["react"],
rules: {
"react/react-in-jsx-scope": "off",
"react/jsx-uses-react": "off"
}
}
],
settings: {
"import/resolver": {
typescript: {}
}
},
rules: {
"import/prefer-default-export": ["off"]
},
plugins: ["@typescript-eslint", "import"]
};
20 changes: 15 additions & 5 deletions .github/workflows/compiler.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Compiler
name: Lint

#############################
# Start the job on push #
# Start the job on push #
#############################
on:
push:
Expand All @@ -16,7 +16,7 @@ on:
jobs:
build:
# Name the Job
name: Run TypeScript compiler
name: Run ESLint, Prettier, and TypeScript compiler
# Set the agent to run on
runs-on: ubuntu-latest

Expand All @@ -35,12 +35,22 @@ jobs:
fetch-depth: 0

################################
# Install packages #
# Install packages #
################################
- name: Install packages
run: npm ci
################################
# Check for TypeScript errors #
# Lint codebase #
################################
- name: Run ESLint
run: npx eslint .
################################
# Check Prettier on codebase #
################################
- name: Run Prettier
run: npx prettier --check .
################################
# Check for TypeScript errors #
################################
- name: Run TypeScript compiler (tsc)
run: npx tsc --noEmit
Loading

0 comments on commit 2bd767c

Please sign in to comment.