mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
1193c9dbaf
dogfood
34 lines
657 B
TypeScript
34 lines
657 B
TypeScript
import type { Node, Plugin } from "#oxlint/plugins";
|
|
|
|
const SPAN: Node = {
|
|
start: 0,
|
|
end: 0,
|
|
range: [0, 0],
|
|
loc: {
|
|
start: { line: 0, column: 0 },
|
|
end: { line: 0, column: 0 },
|
|
},
|
|
};
|
|
|
|
const plugin: Plugin = {
|
|
meta: {
|
|
name: "globals-plugin",
|
|
},
|
|
rules: {
|
|
globals: {
|
|
create(context) {
|
|
const { languageOptions } = context;
|
|
context.report({
|
|
message:
|
|
`\nglobals: ${JSON.stringify(languageOptions.globals, null, 2)}\n`
|
|
+ `env: ${JSON.stringify(languageOptions.env, null, 2)}`,
|
|
node: SPAN,
|
|
});
|
|
return {};
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
export default plugin;
|