Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on:
push:
branches: ['**']
pull_request:
branches: ['**']
workflow_dispatch:

jobs:
eslint:
name: Run ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint -- --max-warnings=0
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
66 changes: 66 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { defineConfig, globalIgnores } from 'eslint/config'

Check failure on line 1 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 1 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'
import globals from 'globals'

Check failure on line 2 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 2 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'
import path from 'node:path'

Check failure on line 3 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 3 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'
import { fileURLToPath } from 'node:url'

Check failure on line 4 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 4 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'
import js from '@eslint/js'

Check failure on line 5 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 5 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'
import { FlatCompat } from '@eslint/eslintrc'

Check failure on line 6 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 6 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 7 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 7 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'
const __filename = fileURLToPath(import.meta.url)

Check failure on line 8 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 8 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'
const __dirname = path.dirname(__filename)

Check failure on line 9 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 9 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'
const compat = new FlatCompat({

Check failure on line 10 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'

Check failure on line 10 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected linebreaks to be 'CRLF' but found 'LF'
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

export default defineConfig([
globalIgnores([
'**/dist',
'**/node_modules/**',
'**/build/**',
'./eslint.config.mjs',
]),
{
extends: compat.extends('eslint:recommended'),

languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: 2022,
sourceType: 'module',
},

rules: {
indent: [
'error',
4,
{
SwitchCase: 1,
},
],

'linebreak-style': ['error', 'windows'],
quotes: ['error', 'single'],
semi: ['error', 'never'],
'no-var': ['error'],
'no-console': [0],
'no-control-regex': [0],

'no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
ignoreRestSiblings: false,
argsIgnorePattern: 'reject',
},
],

'no-async-promise-executor': [0],
'no-undef': 0,
},
},
{},
])
Loading