Skip to content

Commit

Permalink
yaml?
Browse files Browse the repository at this point in the history
  • Loading branch information
lolitaroz committed Oct 22, 2024
1 parent cafd269 commit 94d46d2
Show file tree
Hide file tree
Showing 11 changed files with 8,881 additions and 1,066 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint and Format

on: [push, pull_request]

jobs:
lint_and_format:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install dependencies
run: npm install

- name: Run Prettier
run: npm run format
5 changes: 5 additions & 0 deletions app/.gitignore → .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# dependencies
/node_modules
/api/node_modules
/app/node_modules
/.pnp
.pnp.js

Expand All @@ -11,6 +13,9 @@
# production
/build

# IDE
/.idea

# misc
.DS_Store
.env.local
Expand Down
95 changes: 95 additions & 0 deletions api/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// eslint.config.js
import { Linter } from "eslint";
import reactRecommended from "eslint-plugin-react/configs/recommended";

const eslintRecommended = {
rules: {
"for-direction": "error",
"getter-return": ["error", { allowImplicit: true }],
"no-async-promise-executor": "error",
"no-await-in-loop": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": ["error", "always"],
"no-constant-condition": "warn",
"no-control-regex": "error",
"no-debugger": "error",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty": ["error", { allowEmptyCatch: true }],
"no-empty-character-class": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-extra-semi": "error",
"no-func-assign": "error",
"no-import-assign": "error",
"no-inner-declarations": ["error", "functions"],
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-obj-calls": "error",
"no-promise-executor-return": "error",
"no-prototype-builtins": "error",
"no-regex-spaces": "error",
"no-setter-return": "error",
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-unexpected-multiline": "error",
"no-unreachable": "error",
"no-unreachable-loop": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unsafe-optional-chaining": "error",
"no-useless-backreference": "error",
"require-atomic-updates": "error",
"use-isnan": "error",
"valid-typeof": ["error", { requireStringLiterals: true }],
},
};

const typescriptEslintRecommended = {
rules: {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/triple-slash-reference": "error",
},
};

export default [
{
languageOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2020,
sourceType: "module",
globals: {
browser: true,
es2021: true,
},
},
...eslintRecommended,
...typescriptEslintRecommended,
...reactRecommended,
settings: {
react: {
version: "detect",
},
},
rules: {
// Add your custom rules here
},
},
];
Loading

0 comments on commit 94d46d2

Please sign in to comment.