Skip to content

Commit 4bd6f78

Browse files
authored
Merge pull request #161 from okwn/contrib/understand-anything/eslint-tooling
chore: add ESLint tooling with TypeScript support
2 parents f517275 + a1261b4 commit 4bd6f78

14 files changed

Lines changed: 817 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
- name: Install dependencies
2121
run: pnpm install
2222

23+
- name: Lint
24+
run: pnpm lint
25+
2326
- name: Build core
2427
run: pnpm --filter @understand-anything/core build
2528

eslint.config.mjs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import globals from 'globals';
4+
5+
export default tseslint.config(
6+
{
7+
ignores: [
8+
'**/node_modules/**',
9+
'**/dist/**',
10+
'**/build/**',
11+
'**/public/**',
12+
'**/coverage/**',
13+
'**/.understand-anything/**',
14+
'**/.claude-plugin/**',
15+
'**/.cursor-plugin/**',
16+
'**/.copilot-plugin/**',
17+
'**/.astro/**',
18+
'.private/**',
19+
],
20+
},
21+
eslint.configs.recommended,
22+
...tseslint.configs.recommended,
23+
{
24+
languageOptions: {
25+
globals: {
26+
...globals.node,
27+
},
28+
},
29+
rules: {
30+
'@typescript-eslint/no-unused-vars': [
31+
'error',
32+
{
33+
argsIgnorePattern: '^_',
34+
varsIgnorePattern: '^_',
35+
caughtErrorsIgnorePattern: '^_',
36+
destructuredArrayIgnorePattern: '^_',
37+
},
38+
],
39+
'no-irregular-whitespace': ['error', { skipComments: true }],
40+
},
41+
},
42+
{
43+
files: ['understand-anything-plugin/packages/dashboard/**/*.{ts,tsx,js,jsx}'],
44+
languageOptions: {
45+
globals: {
46+
...globals.browser,
47+
},
48+
},
49+
},
50+
{
51+
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.test.mjs', '**/__tests__/**/*.{ts,tsx,mjs}'],
52+
rules: {
53+
'@typescript-eslint/no-explicit-any': 'off',
54+
},
55+
},
56+
);

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"lint": "eslint ."
1313
},
1414
"devDependencies": {
15+
"@eslint/js": "^9.0.0",
16+
"eslint": "^9.0.0",
17+
"globals": "^17.6.0",
1518
"typescript": "^5.7.0",
19+
"typescript-eslint": "^8.0.0",
1620
"vitest": "^3.1.0"
1721
},
1822
"pnpm": {

0 commit comments

Comments
 (0)