@nzyme/eslint 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1 @@
1
- export * from './jsdoc.js';
2
- export * from './typescript.js';
3
- export * from './imports.js';
4
1
  export * from './vue.js';
5
- export * from './packageJson.js';
6
- export * from './react.js';
7
- export * from './common.js';
package/dist/index.js CHANGED
@@ -1,8 +1,2 @@
1
- export * from './jsdoc.js';
2
- export * from './typescript.js';
3
- export * from './imports.js';
4
1
  export * from './vue.js';
5
- export * from './packageJson.js';
6
- export * from './react.js';
7
- export * from './common.js';
8
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
package/dist/vue.d.ts CHANGED
@@ -1 +1,9 @@
1
- export declare function vue(): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
1
+ /**
2
+ * Creates an ESLint config for Vue components.
3
+ *
4
+ * ESLint runs only for Vue rules — everything else is oxlint's. The file list covers `.tsx` as well
5
+ * as `.vue`, because render-function components live in `.tsx` and Vue rules apply to them too.
6
+ * No type information is used: no `projectService`, no `tsconfigRootDir`, so this config is
7
+ * completely decoupled from the repo's tsconfig layout.
8
+ */
9
+ export declare function vue(): import("eslint/config").ConfigObject[];
package/dist/vue.js CHANGED
@@ -1,30 +1,45 @@
1
+ import tsParser from '@typescript-eslint/parser';
1
2
  import pluginVue from 'eslint-plugin-vue';
2
- import tseslint from 'typescript-eslint';
3
3
  import { defineConfig } from 'eslint/config';
4
+ import vueParser from 'vue-eslint-parser';
5
+ /**
6
+ * Creates an ESLint config for Vue components.
7
+ *
8
+ * ESLint runs only for Vue rules — everything else is oxlint's. The file list covers `.tsx` as well
9
+ * as `.vue`, because render-function components live in `.tsx` and Vue rules apply to them too.
10
+ * No type information is used: no `projectService`, no `tsconfigRootDir`, so this config is
11
+ * completely decoupled from the repo's tsconfig layout.
12
+ */
4
13
  export function vue() {
5
14
  return defineConfig({
6
- plugins: {
7
- '@typescript-eslint': tseslint.plugin,
8
- },
15
+ files: ['**/*.vue', '**/*.tsx'],
9
16
  extends: [pluginVue.configs['flat/recommended']],
10
17
  rules: {
11
18
  'vue/multi-word-component-names': 'off',
12
19
  // Not needed in vue 3
13
20
  'vue/require-v-for-key': 'off',
21
+ 'vue/html-self-closing': 'off',
14
22
  'vue/require-default-prop': 'off',
15
23
  'vue/one-component-per-file': 'off',
16
- // allow importing h from vue for jsx
17
- '@typescript-eslint/no-unused-vars': [
18
- 'error',
19
- {
20
- args: 'all',
21
- argsIgnorePattern: '^_',
22
- caughtErrors: 'all',
23
- caughtErrorsIgnorePattern: '^_',
24
- destructuredArrayIgnorePattern: '^_',
25
- varsIgnorePattern: '(^_)|(^h$)',
26
- },
27
- ],
24
+ // These are not working with more advanced vue 3 features like exposed refs
25
+ 'vue/no-mutating-props': 'off',
26
+ // Formatting rules handled by oxfmt.
27
+ 'vue/html-indent': 'off',
28
+ 'vue/html-closing-bracket-newline': 'off',
29
+ 'vue/html-closing-bracket-spacing': 'off',
30
+ 'vue/html-end-tags': 'off',
31
+ 'vue/html-quotes': 'off',
32
+ 'vue/max-attributes-per-line': 'off',
33
+ 'vue/multiline-html-element-content-newline': 'off',
34
+ 'vue/singleline-html-element-content-newline': 'off',
35
+ 'vue/mustache-interpolation-spacing': 'off',
36
+ 'vue/first-attribute-linebreak': 'off',
37
+ },
38
+ languageOptions: {
39
+ parser: vueParser,
40
+ parserOptions: {
41
+ parser: tsParser,
42
+ },
28
43
  },
29
44
  });
30
45
  }
package/dist/vue.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vue.js","sourceRoot":"","sources":["../src/vue.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,UAAU,GAAG;IACf,OAAO,YAAY,CAAC;QAChB,OAAO,EAAE;YACL,oBAAoB,EAAE,QAAQ,CAAC,MAAuB;SACzD;QACD,OAAO,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAChD,KAAK,EAAE;YACH,gCAAgC,EAAE,KAAK;YACvC,sBAAsB;YACtB,uBAAuB,EAAE,KAAK;YAC9B,0BAA0B,EAAE,KAAK;YACjC,4BAA4B,EAAE,KAAK;YACnC,qCAAqC;YACrC,mCAAmC,EAAE;gBACjC,OAAO;gBACP;oBACI,IAAI,EAAE,KAAK;oBACX,iBAAiB,EAAE,IAAI;oBACvB,YAAY,EAAE,KAAK;oBACnB,yBAAyB,EAAE,IAAI;oBAC/B,8BAA8B,EAAE,IAAI;oBACpC,iBAAiB,EAAE,YAAY;iBAClC;aACJ;SACJ;KACJ,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"vue.js","sourceRoot":"","sources":["../src/vue.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG;IACf,OAAO,YAAY,CAAC;QAChB,KAAK,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;QAC/B,OAAO,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAChD,KAAK,EAAE;YACH,gCAAgC,EAAE,KAAK;YACvC,sBAAsB;YACtB,uBAAuB,EAAE,KAAK;YAC9B,uBAAuB,EAAE,KAAK;YAC9B,0BAA0B,EAAE,KAAK;YACjC,4BAA4B,EAAE,KAAK;YACnC,4EAA4E;YAC5E,uBAAuB,EAAE,KAAK;YAC9B,qCAAqC;YACrC,iBAAiB,EAAE,KAAK;YACxB,kCAAkC,EAAE,KAAK;YACzC,kCAAkC,EAAE,KAAK;YACzC,mBAAmB,EAAE,KAAK;YAC1B,iBAAiB,EAAE,KAAK;YACxB,6BAA6B,EAAE,KAAK;YACpC,4CAA4C,EAAE,KAAK;YACnD,6CAA6C,EAAE,KAAK;YACpD,oCAAoC,EAAE,KAAK;YAC3C,+BAA+B,EAAE,KAAK;SACzC;QACD,eAAe,EAAE;YACb,MAAM,EAAE,SAAS;YACjB,aAAa,EAAE;gBACX,MAAM,EAAE,QAAQ;aACnB;SACJ;KACJ,CAAC,CAAC;AACP,CAAC"}
package/oxlintrc.json ADDED
@@ -0,0 +1,288 @@
1
+ {
2
+ // Shared rule preset. No repo layout — ignore patterns and per-package overrides describe a
3
+ // particular repo's directories and belong in each repo's root `.oxlintrc.json`. An override
4
+ // keyed on a file KIND (`**/*.d.ts`) is not layout: it holds in any repo, so it lives here.
5
+ "plugins": ["typescript", "unicorn", "oxc", "import", "promise"],
6
+ // Our own rules, as a JS plugin. Declared by package name rather than by a relative path: after
7
+ // an npm install of this preset `../oxlint` does not exist, while the package does — it is a
8
+ // dependency of this one. Loading it means linting needs the workspace built, which is fine —
9
+ // `tsgo --build` runs before lint both in the verify protocol and in `setup.build.sh`, and an
10
+ // unbuilt tree makes oxlint refuse to start rather than quietly skip the rule.
11
+ "jsPlugins": ["@nzyme/oxlint"],
12
+ // Categories rather than a hand-kept list: a new oxlint rule in any of these arrives on its own,
13
+ // and the rules below record only what we decided against and why. `nursery` stays out — those
14
+ // are unstable by definition, which is a reason on the risk side rather than the cost side.
15
+ "categories": {
16
+ "correctness": "error",
17
+ "suspicious": "error",
18
+ "perf": "error",
19
+ "pedantic": "error",
20
+ "restriction": "error"
21
+ },
22
+ // Only two kinds of entry belong here: a rule the categories do not carry, and a rule whose
23
+ // options have to be spelled out. Everything else was removed after `oxlint --print-config`
24
+ // showed the effective rule set unchanged with it gone — 279 rules before and after.
25
+ "rules": {
26
+ "curly": "error",
27
+ // A call to an `@__NO_SIDE_EFFECTS__` function whose result nothing uses. Rollup takes the
28
+ // annotation at its word and deletes such a call — in the Healed API bundle it removed the
29
+ // `selectClosestObservation` call inside `deriveBmiObservations`, so BMI was never derived
30
+ // in the shipped build while the unbundled tests stayed green. Such a call is either dead
31
+ // code or proof the function has side effects and must lose the annotation.
32
+ "nzyme/no-unused-no-side-effects-result": "error",
33
+ // `x == null` is the idiomatic "null or undefined" check and is deliberately kept; without
34
+ // the carve-out the rule reports 375 of them and buries the handful of real loose
35
+ // comparisons.
36
+ "eqeqeq": ["error", "always", { "null": "ignore" }],
37
+ // Mirrors the pre-migration ESLint options: a leading underscore marks a binding as
38
+ // deliberately unused, in every position including catch parameters.
39
+ "no-unused-vars": [
40
+ "error",
41
+ {
42
+ "args": "all",
43
+ "argsIgnorePattern": "^_",
44
+ "caughtErrors": "all",
45
+ "caughtErrorsIgnorePattern": "^_",
46
+ "destructuredArrayIgnorePattern": "^_",
47
+ "varsIgnorePattern": "^_"
48
+ }
49
+ ],
50
+ "no-useless-assignment": "error",
51
+ "prefer-const": "error",
52
+ "prefer-rest-params": "error",
53
+ "prefer-spread": "error",
54
+
55
+ "typescript/consistent-type-imports": "error",
56
+ // The type-aware variant supersedes the base `require-await`, which the typescript-eslint
57
+ // docs prescribe disabling: the base rule cannot see that a function returns a promise
58
+ // without awaiting it, and reports the same locations a second time.
59
+
60
+ // Rules with zero violations in this repo. They cost no fix and from here on they block the
61
+ // class of bug from coming back — a rule that finds nothing is a reason to enable it, not to
62
+ // skip it.
63
+ "typescript/prefer-find": "error",
64
+
65
+ // Step 2 — findings whose fix has no interpretation to choose. Grouped here while the
66
+ // config is still an explicit list; the final shape moves them under `categories`.
67
+
68
+ // Warn, not error: a deprecation is advice about the future, not a defect today, and the
69
+ // replacement often sits in a third-party package on its own schedule. Blocking the build
70
+ // on someone else's `@deprecated` tag would turn an upstream release into our outage.
71
+ "typescript/no-deprecated": "warn",
72
+ "typescript/switch-exhaustiveness-check": ["error", { "considerDefaultExhaustiveForUnions": true }],
73
+
74
+ // `instanceof Function` only holds within one JS realm — it is false for a function that
75
+ // crossed a `node:vm` context, a worker or an iframe. `isFunction` from `@nzyme/utils` is
76
+ // the realm-safe check and narrows a union to its callable members.
77
+
78
+ "import/consistent-type-specifier-style": "error",
79
+ "import/newline-after-import": "error",
80
+ "import/no-duplicates": "error",
81
+
82
+ // Its autofix rewrites an array literal into `new Set([...])` with no regard for the
83
+ // runtime. The single finding in this repo was `ALLOWED_ORIGINS` in
84
+ // `packages/file-gateway/src/getFileGatewayCorsOrigin.ts`, which carries a comment stating
85
+ // that the CloudFront Functions `cloudfront-js-2.0` runtime does not expose `Set` and that
86
+ // using one there is a `ReferenceError` at load plus a 503 on every request. A lookup rule
87
+ // that cannot see the target runtime is not worth one micro-optimisation.
88
+ "unicorn/prefer-set-has": "off",
89
+
90
+ // Exists for `xs.map(Number)` and `xs.map(parseInt)`, where the index `map` also passes
91
+ // becomes a second argument. All 21 findings here were named single-parameter mappers
92
+ // (`map(deserializeEvent)`, `filter(isReservedOption)`), so the rule only turned readable
93
+ // point-free code into `x => f(x)` noise.
94
+ "unicorn/no-array-callback-reference": "off",
95
+ // Meant to stop `delete` from destroying a typed object's shape, but it cannot tell that
96
+ // apart from a delete on a genuine dictionary — and every finding here was the latter
97
+ // (`process.env`, `globalThis`, `Record<string, string>` dependency maps). Its suggested
98
+ // `Reflect.deleteProperty` is strictly more obscure for the same effect.
99
+ "typescript/no-dynamic-delete": "off",
100
+ // Fires when a default import shares a name with a named export, but does not distinguish a
101
+ // type from a value. `layout/Layout` exports `type Layout` alongside the component default;
102
+ // TypeScript keeps those in separate namespaces, so the only thing the rule bought was
103
+ // renaming `<Layout>` to `<LayoutComponent>` in three templates.
104
+ "import/no-named-as-default": "off",
105
+
106
+ // Off, not warn. The rule is right that a type parameter used once in a signature binds
107
+ // nothing — `xmlParse<T>(…) as T` and `ContextProvider.get<T>(key)` hand back whatever the
108
+ // caller asked for with no evidence behind it. But removing the parameter only moves the
109
+ // cast to the call sites; the honest fix gives the generic real evidence (return `unknown`
110
+ // and validate, or take a `ZodType<T>`), and that is an API migration across ~12 functions,
111
+ // not a lint pass. Left off rather than as a permanent warning so the linter keeps meaning
112
+ // "this is yours, now".
113
+ "typescript/no-unnecessary-type-parameters": "off",
114
+
115
+ // `dataset` lives on `HTMLElement`, but plenty of DOM code legitimately holds only an
116
+ // `Element` — `IntersectionObserverEntry.target` is typed that way, and the chat event
117
+ // observer reads `data-seq` off it. The rule's rewrite does not compile there, and the
118
+ // guard it would need buys nothing over `getAttribute`.
119
+ "unicorn/prefer-dom-node-dataset": "off",
120
+ // Targets `xs.map(x => ({ ...x, extra }))`, the idiomatic immutable update. Its replacement
121
+ // is less readable for an allocation count that is the same order either way, and none of
122
+ // the seven sites is a hot path (a logger call, two tests, an Effect promise, a computed
123
+ // over search results). `no-accumulating-spread`, which catches the genuinely quadratic
124
+ // `reduce` form, stays on.
125
+ "oxc/no-map-spread": "off",
126
+
127
+ // Wants `xs.map(x => String(x))` collapsed to `xs.map(String)`. That is the shape
128
+ // `no-array-callback-reference` exists to prevent, because the callback also receives the
129
+ // index — `['1','7','11'].map(Number)` happens to be fine but `.map(parseInt)` is not. We
130
+ // dropped that rule for being noisy on named mappers, which is not a reason to start
131
+ // actively producing the form it warned about.
132
+ "unicorn/prefer-native-coercion-functions": "off",
133
+
134
+ // Matches any `.postMessage(...)` by name, but the rule is about the browser's
135
+ // `window.postMessage`, where a missing target origin lets any origin read the message.
136
+ // All seven findings are `node:worker_threads` `Worker`/`parentPort.postMessage` (no such
137
+ // parameter exists in that API) and Slack's `chat.postMessage`.
138
+ "unicorn/require-post-message-target-origin": "off",
139
+ // `seed | 0` in `rngMulberry32` wraps into signed 32-bit range, which is the point;
140
+ // `Math.trunc` truncates without wrapping, so the rewrite changes the generator's output
141
+ // for out-of-range seeds.
142
+ "unicorn/prefer-math-trunc": "off",
143
+ // Matches `readAsText` by name. The only finding is `AdmZip`'s own `zip.readAsText()` —
144
+ // no `Blob` and no `FileReader` anywhere near it.
145
+ "unicorn/prefer-blob-reading-methods": "off",
146
+ // Its alternative is the Cookie Store API, which is async and unsupported in Safari and
147
+ // Firefox. `dom-utils`' `setCookie` is a synchronous helper, so the rule has no reachable
148
+ // fix here.
149
+ "unicorn/no-document-cookie": "off",
150
+
151
+ // Deletes the empty `export {};` that marks a file as an ESM module rather than a global
152
+ // script, and autofixes it silently. Both findings are that marker: `@nzyme/aws`'s package
153
+ // entry point and the `e2e/endpoints.ts` consumed via `import * as e2eHandlers`. Unlike
154
+ // `import/no-empty-named-blocks` below this one cannot be narrowed to declaration files —
155
+ // both sites are ordinary `.ts`.
156
+ "unicorn/require-module-specifiers": "off",
157
+
158
+ // ─── Rejected: conflicts with how this repo is written ────────────────────────────────
159
+ // Each of these is a coherent rule that argues with a decision already made here, so the
160
+ // finding count is not the point — enabling any of them would mean rewriting the codebase
161
+ // to a different house style.
162
+ "no-use-before-define": "off",
163
+ "no-undefined": "off",
164
+ "no-void": "off",
165
+ "no-plusplus": "off",
166
+ "no-bitwise": "off",
167
+ "no-empty-function": "off",
168
+ "no-underscore-dangle": "off",
169
+ "no-await-in-loop": "off",
170
+ "class-methods-use-this": "off",
171
+ "typescript/explicit-function-return-type": "off",
172
+ "typescript/explicit-module-boundary-types": "off",
173
+ "typescript/explicit-member-accessibility": "off",
174
+ "typescript/strict-boolean-expressions": "off",
175
+ "typescript/prefer-readonly-parameter-types": "off",
176
+ "typescript/promise-function-async": "off",
177
+ "typescript/no-invalid-void-type": "off",
178
+ "oxc/no-async-await": "off",
179
+ "oxc/no-optional-chaining": "off",
180
+ "oxc/no-rest-spread-properties": "off",
181
+ "oxc/no-barrel-file": "off",
182
+ "import/no-default-export": "off",
183
+ "import/no-relative-parent-imports": "off",
184
+ "import/no-unassigned-import": "off",
185
+ "import/unambiguous": "off",
186
+ "unicorn/consistent-function-scoping": "off",
187
+ "unicorn/no-process-exit": "off",
188
+ "unicorn/prefer-module": "off",
189
+ "unicorn/no-array-for-each": "off",
190
+ "unicorn/no-array-reduce": "off",
191
+ "unicorn/import-style": "off",
192
+ "unicorn/prefer-event-target": "off",
193
+ "unicorn/prefer-top-level-await": "off",
194
+
195
+ // ─── Rejected: a threshold, not a defect ──────────────────────────────────────────────
196
+ // A number someone picked. A function over the line is not wrong and one under it is not
197
+ // right, so the rule can only ever be noise or a reason to split code artificially.
198
+ "max-lines-per-function": "off",
199
+ "max-lines": "off",
200
+ "max-depth": "off",
201
+ "max-classes-per-file": "off",
202
+ "complexity": "off",
203
+ "max-nested-callbacks": "off",
204
+ "import/max-dependencies": "off",
205
+
206
+ // ─── Rejected: formatting or phrasing preference ──────────────────────────────────────
207
+ // These pick one readable spelling over another. `oxfmt` owns formatting here, and none of
208
+ // them describes a way for code to be wrong.
209
+ "no-inline-comments": "off",
210
+ "no-negated-condition": "off",
211
+ "no-else-return": "off",
212
+ "unicorn/no-negated-condition": "off",
213
+ "unicorn/no-lonely-if": "off",
214
+ "no-lonely-if": "off",
215
+ "unicorn/escape-case": "off",
216
+ "unicorn/no-useless-undefined": "off",
217
+ "unicorn/prefer-string-replace-all": "off",
218
+ "unicorn/prefer-string-slice": "off",
219
+ "unicorn/prefer-single-call": "off",
220
+ "unicorn/prefer-at": "off",
221
+ "unicorn/prefer-number-coercion": "off",
222
+ "unicorn/explicit-length-check": "off",
223
+ "sort-vars": "off",
224
+ "oxc/branches-sharing-code": "off",
225
+
226
+ // ─── Rejected: another rule here already covers it, better ────────────────────────────
227
+ // `no-eq-null` duplicates `eqeqeq`, whose `null` carve-out is deliberate. `require-await`
228
+ // has a type-aware variant already on, which the base rule double-reports. `ban-types` was
229
+ // superseded upstream by `no-restricted-types`. `default-case` asks for a fallback branch on
230
+ // every switch, where `switch-exhaustiveness-check` asks the sharper question. `no-redeclare`
231
+ // cannot tell a TypeScript overload set from an accident.
232
+ "no-eq-null": "off",
233
+ "require-await": "off",
234
+ "default-case": "off",
235
+ "no-redeclare": "off",
236
+ "require-unicode-regexp": "off",
237
+ "typescript/ban-types": "off",
238
+
239
+ // ─── Not adopted yet — measured, wanted, deferred on volume ───────────────────────────
240
+ // These are NOT rejected. Each describes a real defect class and each entry carries the
241
+ // count that is keeping it out, so the decision to adopt is a scheduling one rather than a
242
+ // fresh investigation. Anything here is a candidate for its own task.
243
+ // 1723 sites, 313 of them outside tests — `!` to `assert()` across production code.
244
+ "typescript/no-non-null-assertion": "off",
245
+ // 1039 sites. The cast rule `CLAUDE.md` is really asking for; too large to land in one pass.
246
+ "typescript/no-unsafe-type-assertion": "off",
247
+ // 284 sites. `console` bypasses the structured logger and its PHI filter.
248
+ "no-console": "off",
249
+ // 212 sites. `||` where `??` is meant silently swallows `0`, `''` and `false`.
250
+ "typescript/prefer-nullish-coalescing": "off",
251
+ // 189 sites. Returning a void expression usually means a mistaken arrow shorthand.
252
+ "typescript/no-confusing-void-expression": "off",
253
+ // 122 sites. Without `return await` inside `try`, the stack trace and the `catch` are lost.
254
+ "typescript/return-await": "off",
255
+ // 72 sites. Reassigning a parameter hides an aliasing bug on objects.
256
+ "no-param-reassign": "off",
257
+ // 31 sites. An async function passed where `void` is expected is a floating promise.
258
+ "typescript/strict-void-return": "off",
259
+ // 29 sites. `CLAUDE.md` forbids leaving TODOs; this is how that gets enforced.
260
+ "no-warning-comments": "off",
261
+
262
+ // Reports every computed access into a namespace import. That is exactly how generated
263
+ // `.loc` translation modules are consumed (`l[key]`), so the rule is noise here.
264
+ "import/namespace": "off",
265
+ // Fires only on string-array sorts in tests, where the default lexicographic order is the
266
+ // intended one. `ignoreStringArrays` is accepted by the schema but has no effect in
267
+ // oxlint's implementation, so there is no way to keep the numeric-sort protection alone.
268
+ "typescript/require-array-sort-compare": "off"
269
+ },
270
+ "overrides": [
271
+ {
272
+ // A Vue SFC references its own file to pull in the compiled CSS module
273
+ // (`import css from './Button.vue?vue&type=style&…&lang.module.scss'`). That is the
274
+ // documented way to get scoped styles, not the accidental self-reference the rule hunts.
275
+ "files": ["**/*.vue"],
276
+ "rules": { "import/no-self-import": "off", "import/no-cycle": "off" }
277
+ },
278
+ {
279
+ // In a declaration file an empty import is not dead code — it is what makes the file a
280
+ // module, without which its `declare global` block stops augmenting anything. Removing
281
+ // `import type {} from '@nzyme/utils'` from `dom-utils/src/shims.d.ts` silently dropped
282
+ // the `Navigator.userAgentData` augmentation and degraded every consumer to an error
283
+ // type, with no failure to point at. Ordinary source keeps the rule.
284
+ "files": ["**/*.d.ts"],
285
+ "rules": { "import/no-empty-named-blocks": "off" }
286
+ }
287
+ ]
288
+ }
package/package.json CHANGED
@@ -1,46 +1,49 @@
1
1
  {
2
2
  "name": "@nzyme/eslint",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
+ "description": "Shared Vue ESLint config and oxlint rule preset (framework)",
5
+ "license": "MIT",
6
+ "author": "Michał Kędrzyński <m.kedrzynski@gmail.com>",
4
7
  "repository": {
5
8
  "type": "git",
6
9
  "url": "https://github.com/kedrzu/nzyme.git"
7
10
  },
8
- "license": "MIT",
9
- "author": "Michał Kędrzyński <m.kedrzynski@gmail.com>",
10
- "sideEffects": false,
11
+ "files": [
12
+ "dist",
13
+ "oxlintrc.json"
14
+ ],
11
15
  "type": "module",
16
+ "sideEffects": false,
12
17
  "exports": {
13
18
  ".": {
14
19
  "import": "./dist/index.js",
15
20
  "types": "./dist/index.d.ts"
21
+ },
22
+ "./*.js": {
23
+ "types": "./dist/*.d.ts",
24
+ "import": "./dist/*.js",
25
+ "source": "./src/*.ts",
26
+ "default": "./dist/*.js"
16
27
  }
17
28
  },
18
- "files": [
19
- "dist"
20
- ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "scripts": {
33
+ "build": "tsgo --build tsconfig.esm.json",
34
+ "format": "oxfmt ./src > /dev/null"
35
+ },
21
36
  "dependencies": {
22
- "@eslint/js": "9.24.0",
23
- "eslint": "^9.24.0",
24
- "eslint-config-prettier": "^10.1.2",
25
- "eslint-plugin-import": "^2.31.0",
26
- "eslint-plugin-jsdoc": "^50.6.9",
27
- "eslint-plugin-monorepo": "^0.3.2",
28
- "eslint-plugin-package-json": "^0.29.1",
29
- "eslint-plugin-react": "^7.37.5",
30
- "eslint-plugin-vue": "^10.0.0",
31
- "eslint-plugin-workspaces": "^0.10.1",
32
- "globals": "^16.0.0",
33
- "jsonc-eslint-parser": "^2.4.0",
34
- "tslib": "^2.8.1",
35
- "typescript-eslint": "^8.29.1",
36
- "vue-eslint-parser": "^10.1.3"
37
+ "@nzyme/oxlint": "0.15.0",
38
+ "@typescript-eslint/parser": "8.71.0",
39
+ "eslint": "10.12.0",
40
+ "eslint-plugin-vue": "10.11.1",
41
+ "vue-eslint-parser": "10.4.1"
37
42
  },
38
43
  "devDependencies": {
39
- "@nzyme/tsconfig": "0.13.0",
40
- "jiti": "^2.4.2",
41
- "typescript": "^5.8.3"
42
- },
43
- "publishConfig": {
44
- "access": "public"
44
+ "@nzyme/tsconfig": "0.15.0",
45
+ "@types/node": "^26.6.4",
46
+ "@typescript/native-preview": "^7.0.0-dev.20260707.2",
47
+ "oxfmt": "0.71.0"
45
48
  }
46
49
  }
package/dist/common.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function common(): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
package/dist/common.js DELETED
@@ -1,5 +0,0 @@
1
- import { defineConfig, globalIgnores } from 'eslint/config';
2
- export function common() {
3
- return defineConfig([globalIgnores(['dist/**/*', 'dist-*/**/*', 'node_modules/**/*'])]);
4
- }
5
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,MAAM;IAClB,OAAO,YAAY,CAAC,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC"}
package/dist/imports.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export interface ImportGroup {
2
- pattern: string;
3
- group: 'builtin' | 'external' | 'internal' | 'parent' | 'sibling' | 'index';
4
- position?: 'before' | 'after';
5
- }
6
- export interface ImportsOptions {
7
- groups?: ImportGroup[];
8
- }
9
- export declare function imports(options?: ImportsOptions): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
package/dist/imports.js DELETED
@@ -1,42 +0,0 @@
1
- import importsPlugin from 'eslint-plugin-import';
2
- import { defineConfig } from 'eslint/config';
3
- export function imports(options = {}) {
4
- return defineConfig({
5
- extends: [importsPlugin.flatConfigs.recommended, importsPlugin.flatConfigs.typescript],
6
- ignores: ['dist/**/*', 'dist-*/**/*', 'node_modules/**/*'],
7
- rules: {
8
- 'sort-imports': [
9
- 'warn',
10
- {
11
- ignoreCase: false,
12
- ignoreDeclarationSort: true,
13
- ignoreMemberSort: false,
14
- allowSeparatedGroups: true,
15
- },
16
- ],
17
- 'import/order': [
18
- 'warn',
19
- {
20
- 'newlines-between': 'always',
21
- groups: ['builtin', 'external', 'internal', ['parent', 'sibling'], 'index'],
22
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md#pathgroups-array-of-objects
23
- pathGroups: options.groups ?? [
24
- {
25
- pattern: '@nzyme/**',
26
- group: 'internal',
27
- position: 'before',
28
- },
29
- ],
30
- pathGroupsExcludedImportTypes: ['builtin'],
31
- alphabetize: {
32
- order: 'asc',
33
- },
34
- },
35
- ],
36
- // we have TypeScript handling that
37
- 'import/no-unresolved': 'off',
38
- 'import/namespace': 'off',
39
- },
40
- });
41
- }
42
- //# sourceMappingURL=imports.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imports.js","sourceRoot":"","sources":["../src/imports.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAY7C,MAAM,UAAU,OAAO,CAAC,UAA0B,EAAE;IAChD,OAAO,YAAY,CAAC;QAChB,OAAO,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,aAAa,CAAC,WAAW,CAAC,UAAU,CAAC;QACtF,OAAO,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,mBAAmB,CAAC;QAC1D,KAAK,EAAE;YACH,cAAc,EAAE;gBACZ,MAAM;gBACN;oBACI,UAAU,EAAE,KAAK;oBACjB,qBAAqB,EAAE,IAAI;oBAC3B,gBAAgB,EAAE,KAAK;oBACvB,oBAAoB,EAAE,IAAI;iBAC7B;aACJ;YACD,cAAc,EAAE;gBACZ,MAAM;gBACN;oBACI,kBAAkB,EAAE,QAAQ;oBAC5B,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC;oBAC3E,gHAAgH;oBAChH,UAAU,EAAE,OAAO,CAAC,MAAM,IAAI;wBAC1B;4BACI,OAAO,EAAE,WAAW;4BACpB,KAAK,EAAE,UAAU;4BACjB,QAAQ,EAAE,QAAQ;yBACrB;qBACJ;oBACD,6BAA6B,EAAE,CAAC,SAAS,CAAC;oBAC1C,WAAW,EAAE;wBACT,KAAK,EAAE,KAAK;qBACf;iBACJ;aACJ;YACD,mCAAmC;YACnC,sBAAsB,EAAE,KAAK;YAC7B,kBAAkB,EAAE,KAAK;SAC5B;KACJ,CAAC,CAAC;AACP,CAAC"}
package/dist/jsdoc.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export interface JsdocOptions {
2
- ignores?: string[];
3
- }
4
- export declare function jsdoc(options?: JsdocOptions): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
package/dist/jsdoc.js DELETED
@@ -1,37 +0,0 @@
1
- import jsdocPlugin from 'eslint-plugin-jsdoc';
2
- import { defineConfig } from 'eslint/config';
3
- export function jsdoc(options = {}) {
4
- return defineConfig({
5
- plugins: {
6
- jsdoc: jsdocPlugin,
7
- },
8
- ignores: ['dist/**/*', 'dist-*/**/*', 'node_modules/**/*', ...(options.ignores || [])],
9
- rules: {
10
- 'jsdoc/require-jsdoc': [
11
- 1,
12
- {
13
- publicOnly: {
14
- esm: true,
15
- cjs: false,
16
- },
17
- contexts: [
18
- 'ClassDeclaration',
19
- 'ClassProperty',
20
- 'FunctionDeclaration',
21
- 'MethodDefinition',
22
- 'ExportNamedDeclaration > VariableDeclaration',
23
- 'TSDeclareFunction',
24
- 'TSEnumDeclaration',
25
- 'TSInterfaceDeclaration',
26
- 'TSMethodSignature',
27
- ':not(TSTypeParameterDeclaration) TSPropertySignature',
28
- 'TSTypeAliasDeclaration',
29
- ],
30
- },
31
- ],
32
- 'jsdoc/no-blank-block-descriptions': 'warn',
33
- 'jsdoc/no-blank-blocks': 'warn',
34
- },
35
- });
36
- }
37
- //# sourceMappingURL=jsdoc.js.map
package/dist/jsdoc.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsdoc.js","sourceRoot":"","sources":["../src/jsdoc.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAM7C,MAAM,UAAU,KAAK,CAAC,UAAwB,EAAE;IAC5C,OAAO,YAAY,CAAC;QAChB,OAAO,EAAE;YACL,KAAK,EAAE,WAAW;SACrB;QACD,OAAO,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QACtF,KAAK,EAAE;YACH,qBAAqB,EAAE;gBACnB,CAAC;gBACD;oBACI,UAAU,EAAE;wBACR,GAAG,EAAE,IAAI;wBACT,GAAG,EAAE,KAAK;qBACb;oBAED,QAAQ,EAAE;wBACN,kBAAkB;wBAClB,eAAe;wBACf,qBAAqB;wBACrB,kBAAkB;wBAClB,8CAA8C;wBAC9C,mBAAmB;wBACnB,mBAAmB;wBACnB,wBAAwB;wBACxB,mBAAmB;wBACnB,sDAAsD;wBACtD,wBAAwB;qBAC3B;iBACJ;aACJ;YAED,mCAAmC,EAAE,MAAM;YAC3C,uBAAuB,EAAE,MAAM;SAClC;KACJ,CAAC,CAAC;AACP,CAAC"}
@@ -1 +0,0 @@
1
- export declare function packageJson(): import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
@@ -1,14 +0,0 @@
1
- import packageJsonPlugin from 'eslint-plugin-package-json';
2
- import { defineConfig } from 'eslint/config';
3
- export function packageJson() {
4
- return defineConfig({
5
- plugins: {
6
- packageJson: packageJsonPlugin,
7
- },
8
- rules: {
9
- 'package-json/require-name': 'off',
10
- 'package-json/require-version': 'off',
11
- },
12
- });
13
- }
14
- //# sourceMappingURL=packageJson.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"packageJson.js","sourceRoot":"","sources":["../src/packageJson.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,UAAU,WAAW;IACvB,OAAO,YAAY,CAAC;QAChB,OAAO,EAAE;YACL,WAAW,EAAE,iBAAiB;SACjC;QACD,KAAK,EAAE;YACH,2BAA2B,EAAE,KAAK;YAClC,8BAA8B,EAAE,KAAK;SACxC;KACJ,CAAC,CAAC;AACP,CAAC"}
package/dist/react.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import reactPlugin from 'eslint-plugin-react';
2
- export declare function react(): (reactPlugin.ReactFlatConfig | undefined)[];
package/dist/react.js DELETED
@@ -1,8 +0,0 @@
1
- import reactPlugin from 'eslint-plugin-react';
2
- export function react() {
3
- return [
4
- reactPlugin.configs.flat.recommended, // This is not a plugin object, but a shareable config object
5
- reactPlugin.configs.flat['jsx-runtime'], // Add this if you are using React 17+
6
- ];
7
- }
8
- //# sourceMappingURL=react.js.map
package/dist/react.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,MAAM,UAAU,KAAK;IACjB,OAAO;QACH,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,6DAA6D;QACnG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,sCAAsC;KAClF,CAAC;AACN,CAAC"}
@@ -1,6 +0,0 @@
1
- export type Target = 'node' | 'browser';
2
- export interface TypescriptOptions {
3
- target?: Target[] | Target;
4
- project?: string | string[];
5
- }
6
- export declare function typescript(options?: TypescriptOptions): import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
@@ -1,67 +0,0 @@
1
- import workspaces from 'eslint-plugin-workspaces';
2
- import monorepo from 'eslint-plugin-monorepo';
3
- import globals from 'globals';
4
- import js from '@eslint/js';
5
- import tseslint from 'typescript-eslint';
6
- import prettier from 'eslint-config-prettier';
7
- export function typescript(options = {}) {
8
- const config = {
9
- ignores: ['dist/**/*', 'dist-*/**/*', 'node_modules/**/*', 'eslint.config.js'],
10
- files: ['**/*.{ts,tsx}'],
11
- plugins: {
12
- workspaces,
13
- monorepo,
14
- },
15
- languageOptions: {
16
- parserOptions: {
17
- project: options.project || './tsconfig.json',
18
- },
19
- },
20
- rules: {
21
- curly: 'error',
22
- 'require-await': 'error',
23
- '@typescript-eslint/no-unused-vars': [
24
- 'error',
25
- {
26
- args: 'all',
27
- argsIgnorePattern: '^_',
28
- caughtErrors: 'all',
29
- caughtErrorsIgnorePattern: '^_',
30
- destructuredArrayIgnorePattern: '^_',
31
- varsIgnorePattern: '^_',
32
- },
33
- ],
34
- '@typescript-eslint/consistent-type-imports': 'error',
35
- '@typescript-eslint/no-import-type-side-effects': 'error',
36
- 'workspaces/no-relative-imports': 'error',
37
- 'workspaces/no-absolute-imports': 'error',
38
- 'workspaces/require-dependency': 'error',
39
- 'monorepo/no-relative-import': 'error',
40
- },
41
- };
42
- if (Array.isArray(options.target)) {
43
- config.languageOptions = {
44
- ...config.languageOptions,
45
- globals: options.target.reduce((acc, target) => ({ ...acc, ...getTargetGlobals(target) }), {}),
46
- };
47
- }
48
- else if (options.target) {
49
- config.languageOptions = {
50
- ...config.languageOptions,
51
- globals: getTargetGlobals(options.target),
52
- };
53
- }
54
- return tseslint.config({
55
- extends: [js.configs.recommended, ...tseslint.configs.recommendedTypeChecked, prettier],
56
- ...config,
57
- });
58
- }
59
- function getTargetGlobals(target) {
60
- switch (target) {
61
- case 'node':
62
- return globals.node;
63
- case 'browser':
64
- return globals.browser;
65
- }
66
- }
67
- //# sourceMappingURL=typescript.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typescript.js","sourceRoot":"","sources":["../src/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAU9C,MAAM,UAAU,UAAU,CAAC,UAA6B,EAAE;IACtD,MAAM,MAAM,GAAkB;QAC1B,OAAO,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,CAAC;QAC9E,KAAK,EAAE,CAAC,eAAe,CAAC;QACxB,OAAO,EAAE;YACL,UAAU;YACV,QAAQ;SACX;QACD,eAAe,EAAE;YACb,aAAa,EAAE;gBACX,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,iBAAiB;aAChD;SACJ;QACD,KAAK,EAAE;YACH,KAAK,EAAE,OAAO;YACd,eAAe,EAAE,OAAO;YACxB,mCAAmC,EAAE;gBACjC,OAAO;gBACP;oBACI,IAAI,EAAE,KAAK;oBACX,iBAAiB,EAAE,IAAI;oBACvB,YAAY,EAAE,KAAK;oBACnB,yBAAyB,EAAE,IAAI;oBAC/B,8BAA8B,EAAE,IAAI;oBACpC,iBAAiB,EAAE,IAAI;iBAC1B;aACJ;YACD,4CAA4C,EAAE,OAAO;YACrD,gDAAgD,EAAE,OAAO;YACzD,gCAAgC,EAAE,OAAO;YACzC,gCAAgC,EAAE,OAAO;YACzC,+BAA+B,EAAE,OAAO;YACxC,6BAA6B,EAAE,OAAO;SACzC;KACJ,CAAC;IAEF,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAChC,MAAM,CAAC,eAAe,GAAG;YACrB,GAAG,MAAM,CAAC,eAAe;YACzB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAC1B,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,EAC1D,EAAE,CACL;SACJ,CAAC;IACN,CAAC;SAAM,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,CAAC,eAAe,GAAG;YACrB,GAAG,MAAM,CAAC,eAAe;YACzB,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC;SAC5C,CAAC;IACN,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,CAAC;QACnB,OAAO,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,sBAAsB,EAAE,QAAQ,CAAC;QACvF,GAAG,MAAM;KACZ,CAAC,CAAC;AACP,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc;IACpC,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,MAAM;YACP,OAAO,OAAO,CAAC,IAAI,CAAC;QACxB,KAAK,SAAS;YACV,OAAO,OAAO,CAAC,OAAO,CAAC;IAC/B,CAAC;AACL,CAAC"}