@geoql/oxlint-plugin-vue-doctor 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +30 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vinayak Kulkarni
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# `@geoql/oxlint-plugin-vue-doctor`
|
|
2
|
+
|
|
3
|
+
> oxlint JS plugin for Vue 3 anti-patterns and AI-slop detection.
|
|
4
|
+
|
|
5
|
+
Pairs with oxlint's built-in `vue` plugin via the `jsPlugins` config field. See [`docs/ARCHITECTURE.md`](../../docs/ARCHITECTURE.md) for how it fits with `@geoql/doctor-core`.
|
|
6
|
+
|
|
7
|
+
## Usage (standalone oxlint config)
|
|
8
|
+
|
|
9
|
+
```jsonc
|
|
10
|
+
// .oxlintrc.json
|
|
11
|
+
{
|
|
12
|
+
"plugins": ["vue"],
|
|
13
|
+
"jsPlugins": ["@geoql/oxlint-plugin-vue-doctor"],
|
|
14
|
+
"rules": {
|
|
15
|
+
"vue-doctor/no-em-dash-in-string": "error",
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Rules (alpha)
|
|
21
|
+
|
|
22
|
+
| Rule | Category | Severity |
|
|
23
|
+
| --------------------------------- | -------- | -------- |
|
|
24
|
+
| `vue-doctor/no-em-dash-in-string` | ai-slop | error |
|
|
25
|
+
|
|
26
|
+
More rules land per the [issue tracker](https://github.com/geoql/doctor/issues).
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
MIT © Vinayak Kulkarni
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/rule-types.d.ts
|
|
2
|
+
interface SourceLocation {
|
|
3
|
+
start: {
|
|
4
|
+
line: number;
|
|
5
|
+
column: number;
|
|
6
|
+
};
|
|
7
|
+
end: {
|
|
8
|
+
line: number;
|
|
9
|
+
column: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
interface AstNode {
|
|
13
|
+
type: string;
|
|
14
|
+
loc?: SourceLocation;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
interface ReportDescriptor {
|
|
18
|
+
node: AstNode;
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
interface RuleContext {
|
|
22
|
+
report: (descriptor: ReportDescriptor) => void;
|
|
23
|
+
getFilename?: () => string | undefined;
|
|
24
|
+
settings?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
type RuleVisitor = (node: AstNode) => void;
|
|
27
|
+
interface Rule {
|
|
28
|
+
create: (context: RuleContext) => Record<string, RuleVisitor>;
|
|
29
|
+
}
|
|
30
|
+
interface Plugin {
|
|
31
|
+
meta: {
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
34
|
+
rules: Record<string, Rule>;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/plugin.d.ts
|
|
38
|
+
declare const plugin: Plugin;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { type Rule, type RuleContext, plugin as default, plugin };
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/define-rule.ts
|
|
2
|
+
function defineRule(rule) {
|
|
3
|
+
return rule;
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/rules/ai-slop/no-em-dash-in-string.ts
|
|
7
|
+
const EM_DASH = "—";
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/plugin.ts
|
|
10
|
+
const plugin = {
|
|
11
|
+
meta: { name: "vue-doctor" },
|
|
12
|
+
rules: { "no-em-dash-in-string": defineRule({ create(context) {
|
|
13
|
+
return { Literal(node) {
|
|
14
|
+
const literal = node;
|
|
15
|
+
if (typeof literal.value !== "string") return;
|
|
16
|
+
if (!literal.value.includes(EM_DASH)) return;
|
|
17
|
+
context.report({
|
|
18
|
+
node,
|
|
19
|
+
message: "Em dash in string literal reads as AI-generated output; use comma, colon, or parentheses."
|
|
20
|
+
});
|
|
21
|
+
} };
|
|
22
|
+
} }) }
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/index.ts
|
|
26
|
+
var src_default = plugin;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { src_default as default, plugin };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/define-rule.ts","../src/rules/ai-slop/no-em-dash-in-string.ts","../src/plugin.ts","../src/index.ts"],"sourcesContent":["import type { Rule } from './rule-types.js';\n\nexport function defineRule(rule: Rule): Rule {\n return rule;\n}\n","import { defineRule } from '../../define-rule.js';\nimport type { AstNode, RuleContext } from '../../rule-types.js';\n\nconst EM_DASH = '\\u2014';\n\ninterface LiteralNode extends AstNode {\n type: 'Literal';\n value: unknown;\n}\n\nexport const noEmDashInString = defineRule({\n create(context: RuleContext) {\n return {\n Literal(node: AstNode) {\n const literal = node as LiteralNode;\n if (typeof literal.value !== 'string') return;\n if (!literal.value.includes(EM_DASH)) return;\n context.report({\n node,\n message:\n 'Em dash in string literal reads as AI-generated output; use comma, colon, or parentheses.',\n });\n },\n };\n },\n});\n","import type { Plugin } from './rule-types.js';\nimport { noEmDashInString } from './rules/ai-slop/no-em-dash-in-string.js';\n\nexport const plugin: Plugin = {\n meta: { name: 'vue-doctor' },\n rules: {\n 'no-em-dash-in-string': noEmDashInString,\n },\n};\n","import { plugin } from './plugin.js';\n\nexport default plugin;\nexport { plugin };\nexport type { Rule, RuleContext } from './rule-types.js';\n"],"mappings":";AAEA,SAAgB,WAAW,MAAkB;CAC3C,OAAO;;;;ACAT,MAAM,UAAU;;;ACAhB,MAAa,SAAiB;CAC5B,MAAM,EAAE,MAAM,cAAc;CAC5B,OAAO,EACL,wBDI4B,WAAW,EACzC,OAAO,SAAsB;EAC3B,OAAO,EACL,QAAQ,MAAe;GACrB,MAAM,UAAU;GAChB,IAAI,OAAO,QAAQ,UAAU,UAAU;GACvC,IAAI,CAAC,QAAQ,MAAM,SAAS,QAAQ,EAAE;GACtC,QAAQ,OAAO;IACb;IACA,SACE;IACH,CAAC;KAEL;IAEJ,CCnB2B,EACzB;CACF;;;ACND,IAAA,cAAe"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@geoql/oxlint-plugin-vue-doctor",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "oxlint JS plugin for Vue 3 anti-patterns and AI-slop detection. Pairs with oxlint's built-in vue plugin via jsPlugins. TypeScript, ESM.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"ai-slop",
|
|
8
|
+
"geoql",
|
|
9
|
+
"lint",
|
|
10
|
+
"oxlint",
|
|
11
|
+
"oxlint-plugin",
|
|
12
|
+
"vue",
|
|
13
|
+
"vue3"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/geoql/doctor#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/geoql/doctor/issues"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "Vinayak Kulkarni",
|
|
22
|
+
"email": "inbox.vinayak@gmail.com",
|
|
23
|
+
"url": "https://vinayakkulkarni.dev"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/geoql/doctor.git",
|
|
28
|
+
"directory": "packages/oxlint-plugin-vue-doctor"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"type": "module",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"import": "./dist/index.js",
|
|
38
|
+
"types": "./dist/index.d.ts"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^25.9.1",
|
|
43
|
+
"typescript": "^6.0.3",
|
|
44
|
+
"vitest": "^4.1.7"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"oxlint": "^1.66.0"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"lint": "vp lint src",
|
|
54
|
+
"lint:fix": "vp lint src --fix",
|
|
55
|
+
"format": "vp fmt",
|
|
56
|
+
"format:check": "vp fmt --check",
|
|
57
|
+
"build": "vp pack",
|
|
58
|
+
"test": "vitest run"
|
|
59
|
+
}
|
|
60
|
+
}
|