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
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ jobs:
npx playwright install chromium
npx playwright install-deps chromium || true

- name: Lint with ESLint
run: |
npm run lint

- name: Type check
run: |
npm run type-check

- name: Format check
run: |
npm run format-check

- name: Build package
run: |
npm run build
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.ts": ["eslint --fix --max-warnings=-1", "prettier --write"],
"*.{json,md}": ["prettier --write"]
}
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist/
node_modules/
*.js
src/extension/
examples/
coverage/
*.min.js
package-lock.json

9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"arrowParens": "avoid"
}
57 changes: 57 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// @ts-check
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
const prettier = require('eslint-plugin-prettier');
const prettierConfig = require('eslint-config-prettier');

module.exports = tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2020,
sourceType: 'module',
},
},
plugins: {
prettier: prettier,
},
rules: {
...prettierConfig.rules,
'@typescript-eslint/no-explicit-any': 'off', // Many any types in codebase, will fix incrementally
'@typescript-eslint/no-unsafe-assignment': 'off', // Will fix incrementally
'@typescript-eslint/no-unsafe-member-access': 'off', // Will fix incrementally
'@typescript-eslint/no-unsafe-call': 'off', // Will fix incrementally
'@typescript-eslint/no-unsafe-return': 'off', // Will fix incrementally
'@typescript-eslint/no-unsafe-argument': 'off', // Will fix incrementally
'@typescript-eslint/restrict-template-expressions': 'off', // Will fix incrementally
'@typescript-eslint/unbound-method': 'off', // Will fix incrementally
'@typescript-eslint/require-await': 'warn', // Allow async without await
'@typescript-eslint/no-misused-promises': 'warn', // Allow promises in callbacks
'@typescript-eslint/explicit-function-return-type': 'off',
'no-case-declarations': 'off', // Allow declarations in case blocks
'@typescript-eslint/no-unused-vars': [
'warn', // Changed to warn for now
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'prettier/prettier': 'error',
},
},
{
ignores: [
'dist/**',
'node_modules/**',
'*.js',
'src/extension/**',
'examples/**',
'tests/**',
],
}
);

Loading