-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy patheslint.config.js
More file actions
128 lines (127 loc) · 4.11 KB
/
Copy patheslint.config.js
File metadata and controls
128 lines (127 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Flat ESLint config (ESLint 10 — eslintrc format is no longer supported).
// Scope: first-party vanilla-JS source at the repo root. Sub-projects that ship
// their own flat config (chat/, agent-payments-sdk/, character-studio/) and
// vendored/generated/build output are ignored here. TypeScript sources are left
// to each package's own tsc/typecheck pipeline, so we lint JS extensions only
// and avoid pulling in typescript-eslint at the root.
import js from '@eslint/js';
import globals from 'globals';
export default [
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/dist-lib/**',
'**/dist-artifact/**',
'**/build/**',
'**/.vercel/**',
'**/.svelte-kit/**',
'**/coverage/**',
// Vendored / external library code
'contracts/lib/**',
'character-studio/**',
'docs/pumpfun-program/**',
// Vendored third-party browser libs (Draco/Basis compression,
// the scene-studio editor's bundled acorn/codemirror/esprima/etc.,
// and MediaPipe's Emscripten-generated WASM glue).
'**/draco/**',
'**/basis/**',
'public/scene-studio/libs/**',
// Any directory named `vendor` holds third-party code we don't own
// and must not lint (e.g. extensions/*/vendor/readability.js).
'**/vendor/**',
'**/*.bundle.js',
'public/dashboard/avaturn-sdk.js',
// Self-contained sub-projects with their own ESLint flat config
'chat/**',
'public/chat/**',
'agent-payments-sdk/**',
// Generated output
'data/_generated/**',
// Saved Workflow-DSL scripts (top-level await/return + injected
// runtime globals like agent()/log() — not standalone ES modules).
'scripts/wf-*.mjs',
// Bundled/minified build artifacts
'**/*.min.js',
// Bundler output formats (tsup/esbuild IIFE + global builds) and
// TypeDoc-generated API-doc assets: single-line minified code where
// minifier variable reuse trips no-redeclare/no-func-assign. These are
// generated, never hand-edited, and must not gate the lint on real
// source. (Hand-authored robinhood/**/docs demos stay linted.)
'**/*.iife.js',
'**/*.global.js',
'**/docs/api/assets/**',
'public/embed-sdk.js',
'public/embed.js',
'public/wallet-login.js',
'public/artifact.js',
'public/bazaar.js',
'public/paywall.js',
],
},
js.configs.recommended,
{
files: ['**/*.{js,mjs,jsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: { jsx: true },
},
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
// This codebase predates linting, so the first pass is a warn-level
// baseline: it surfaces issues without failing the gate, and the team
// ratchets rules up to error as files are cleaned. High-value
// structural rules that are already clean (no-dupe-keys, no-func-assign)
// stay at error so regressions are caught immediately.
'no-unused-vars': 'warn',
'no-console': 'warn',
'no-undef': 'warn',
'no-empty': 'warn',
'no-constant-condition': 'warn',
'no-constant-binary-expression': 'warn',
'no-prototype-builtins': 'warn',
'no-useless-escape': 'warn',
'no-useless-assignment': 'off',
'no-cond-assign': 'warn',
'no-fallthrough': 'warn',
'no-irregular-whitespace': 'warn',
'no-control-regex': 'off',
'no-unreachable': 'warn',
'no-unassigned-vars': 'warn',
'no-async-promise-executor': 'warn',
'no-misleading-character-class': 'warn',
'no-unsafe-finally': 'warn',
'no-unused-private-class-members': 'warn',
'no-unused-labels': 'warn',
'preserve-caught-error': 'warn',
},
},
{
// Service workers run in their own global scope (self, clients,
// registration, skipWaiting, …). Flat config replaces the old
// `/* eslint-env serviceworker */` directive with explicit globals.
files: ['**/push-sw.js', '**/*-sw.js', '**/service-worker.js'],
languageOptions: {
globals: { ...globals.serviceworker },
},
},
{
files: ['**/*.cjs'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'commonjs',
globals: { ...globals.node },
},
rules: {
'no-unused-vars': 'warn',
'no-console': 'warn',
'no-undef': 'warn',
},
},
];