eslint-plugin-baseline-js 0.5.0 → 0.6.1
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/README.md +29 -3
- package/dist/index.d.mts +14 -2
- package/dist/index.mjs +9927 -9609
- package/package.json +19 -21
- package/dist/index.cjs +0 -62759
- package/dist/index.d.cts +0 -58
package/README.md
CHANGED
|
@@ -144,12 +144,38 @@ and shows which ones are currently mapped by this plugin.
|
|
|
144
144
|
| `ignoreFeatures` | `string[]` | — | Skip specific web‑features by ID (supports regex `/.../`) across syntax delegates and Web API/JS builtin detection. |
|
|
145
145
|
| `ignoreNodeTypes` | `string[]` | — | Suppress reports by ESTree `node.type` (supports regex `/.../`). |
|
|
146
146
|
|
|
147
|
-
##
|
|
147
|
+
## Use with [oxlint](https://oxc.rs/)
|
|
148
|
+
|
|
149
|
+
Runs as an [oxlint JS plugin](https://oxc.rs/docs/guide/usage/linter/js-plugins). Just drop it into `.oxlintrc.json`:
|
|
150
|
+
|
|
151
|
+
```jsonc
|
|
152
|
+
// .oxlintrc.json
|
|
153
|
+
{
|
|
154
|
+
"jsPlugins": ["eslint-plugin-baseline-js"],
|
|
155
|
+
"rules": {
|
|
156
|
+
"baseline-js/use-baseline": [
|
|
157
|
+
"warn",
|
|
158
|
+
{
|
|
159
|
+
"available": "widely",
|
|
160
|
+
"includeWebApis": { "preset": "auto" },
|
|
161
|
+
"includeJsBuiltins": { "preset": "auto" }
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
> [!CAUTION]
|
|
169
|
+
> **No type-aware detection under oxlint.** Checks that need TypeScript type resolution (e.g., `Set.difference()`, `Iterator.map()`) won't fire. Use ESLint with the `type-aware` preset if you need them.
|
|
148
170
|
|
|
149
|
-
Baseline
|
|
171
|
+
## Baseline for HTML, CSS, and React
|
|
172
|
+
|
|
173
|
+
Baseline works best when HTML, CSS, JS, and React all align. For markup, styles, and React, enable the "use-baseline" rules from these ESLint plugins:
|
|
150
174
|
|
|
151
175
|
- ESLint for CSS: https://github.com/eslint/css
|
|
152
|
-
- HTML ESLint: https://github.com/yeonjuan/html-eslint
|
|
176
|
+
- HTML ESLint (HTML): https://github.com/yeonjuan/html-eslint
|
|
177
|
+
- HTML ESLint (React): https://github.com/yeonjuan/html-eslint/tree/main/packages/eslint-plugin-react
|
|
178
|
+
|
|
153
179
|
|
|
154
180
|
## Branding Note (Baseline)
|
|
155
181
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Rule } from "eslint";
|
|
2
2
|
|
|
3
3
|
//#region src/config.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Named constants for Baseline string options.
|
|
7
6
|
* Prefer using these to avoid typos in user configs.
|
|
@@ -16,7 +15,15 @@ type BaselineName = (typeof BASELINE)[keyof typeof BASELINE];
|
|
|
16
15
|
type BaselineOption = BaselineName | number;
|
|
17
16
|
//#endregion
|
|
18
17
|
//#region src/configs/baseline.d.ts
|
|
19
|
-
|
|
18
|
+
declare function baselineConfigs(opts?: {
|
|
19
|
+
available?: BaselineOption;
|
|
20
|
+
baseline?: BaselineOption;
|
|
21
|
+
env?: "browser" | "worker" | "node";
|
|
22
|
+
level?: "error" | "warn";
|
|
23
|
+
}): {
|
|
24
|
+
files: string[];
|
|
25
|
+
rules: Record<string, unknown>;
|
|
26
|
+
}[];
|
|
20
27
|
/**
|
|
21
28
|
* Recommended config: enable Baseline with Web APIs and JS builtins detection on auto preset.
|
|
22
29
|
* - baseline: defaults to 'widely'
|
|
@@ -48,8 +55,13 @@ declare function recommendedTsConfig(opts?: {
|
|
|
48
55
|
//#endregion
|
|
49
56
|
//#region src/index.d.ts
|
|
50
57
|
declare const _default: {
|
|
58
|
+
readonly meta: {
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly version: string;
|
|
61
|
+
};
|
|
51
62
|
readonly rules: Record<string, Rule.RuleModule>;
|
|
52
63
|
readonly configs: {
|
|
64
|
+
readonly baseline: typeof baselineConfigs;
|
|
53
65
|
readonly recommended: typeof recommendedConfig;
|
|
54
66
|
readonly "recommended-ts": typeof recommendedTsConfig;
|
|
55
67
|
};
|