mirror of
https://github.com/fosrl/pangolin.git
synced 2025-09-01 07:20:06 +02:00
enable automated linting
This commit is contained in:
parent
d70396a664
commit
097dafb553
2 changed files with 50 additions and 9 deletions
34
.github/workflows/linting.yml
vendored
Normal file
34
.github/workflows/linting.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
name: ESLint Linting
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**/*.js'
|
||||||
|
- '**/*.jsx'
|
||||||
|
- '**/*.ts'
|
||||||
|
- '**/*.tsx'
|
||||||
|
- '.eslintrc*'
|
||||||
|
- 'package.json'
|
||||||
|
- 'yarn.lock'
|
||||||
|
- 'pnpm-lock.yaml'
|
||||||
|
- 'package-lock.json'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
- name: Run ESLint
|
||||||
|
run: |
|
||||||
|
npx eslint . --ext .js,.jsx,.ts,.tsx
|
|
@ -1,12 +1,19 @@
|
||||||
import tseslint from 'typescript-eslint';
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
export default tseslint.config(
|
export default tseslint.config({
|
||||||
tseslint.configs.recommended,
|
files: ["**/*.{ts,tsx,js,jsx}"],
|
||||||
{
|
languageOptions: {
|
||||||
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
parser: tseslint.parser,
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: "latest",
|
||||||
|
sourceType: "module",
|
||||||
|
ecmaFeatures: {
|
||||||
|
jsx: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
semi: "error",
|
"semi": "error",
|
||||||
"prefer-const": "error"
|
"prefer-const": "warn"
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
Loading…
Add table
Add a link
Reference in a new issue