-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added github action to verify linting and formatting
- Loading branch information
Showing
11 changed files
with
822 additions
and
34 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Check Linting and Formatting (JS) | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**/*.js' | ||
- '**/*.ts' | ||
pull_request: | ||
paths: | ||
- '**/*.js' | ||
- '**/*.ts' | ||
|
||
jobs: | ||
lint-and-prettify: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
|
||
- name: Install packages in js folder | ||
run: cd js && pnpm install --frozen-lockfile | ||
|
||
- name: Run ESLint | ||
run: pnpm run lint --config | ||
continue-on-error: false | ||
|
||
- name: Run Prettier | ||
run: pnpm run prettier:check | ||
continue-on-error: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import globals from "globals"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
{files: ["**/*.{js,mjs,cjs,ts}"]}, | ||
{languageOptions: { globals: globals.browser }}, | ||
...tseslint.configs.recommended, | ||
{ | ||
rules: { | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/no-require-imports": "warn", | ||
"no-prototype-builtins": "off", | ||
"max-lines-per-function": ["error", 250], | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"no-constant-condition": "off", | ||
"no-ex-assign": "off", | ||
"no-constant-binary-expression": "off", | ||
"@typescript-eslint/no-non-null-asserted-optional-chain": "off", | ||
"no-unsafe-optional-chaining": "off", | ||
"no-extra-boolean-cast": "off", | ||
"no-console": "warn", | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", // or "error" | ||
{ | ||
"argsIgnorePattern": "^_", | ||
"varsIgnorePattern": "^_", | ||
"caughtErrorsIgnorePattern": "^_" | ||
} | ||
] | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.