@byscripts/eslint-plugin 0.3.2 → 0.5.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/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @byscripts/eslint-plugin
2
+
3
+ Custom ESLint rules for Vue 3 projects.
4
+
5
+ ## Rules
6
+
7
+ | Rule | Description | Fixable |
8
+ | ------------------------------------- | ----------------------------------------------------------- | ------- |
9
+ | `byscripts/vue-block-attribute-order` | Enforces attribute order on `<script>` and `<style>` blocks | Yes |
10
+
11
+ ### `vue-block-attribute-order`
12
+
13
+ Default order:
14
+
15
+ - `<script>`: `lang`, `setup`
16
+ - `<style>`: `lang`, `scoped`
17
+
18
+ Custom order via rule options:
19
+
20
+ ```js
21
+ "byscripts/vue-block-attribute-order": ["error", {
22
+ script: ["setup", "lang"],
23
+ style: ["scoped", "lang"],
24
+ }]
25
+ ```
26
+
27
+ ## Dev
28
+
29
+ ```bash
30
+ pnpm build # compile src/ -> dist/index.mjs + dist/index.d.mts
31
+ pnpm publish --access public # publish to npm
32
+ ```
33
+
34
+ ## Notes
35
+
36
+ - Built with `tsdown --dts`
37
+ - Peer dependency: `eslint ^9.22.0`
38
+ - Requires `vue-eslint-parser` in the consumer project (for `parserServices.getDocumentFragment()`)
@@ -0,0 +1,28 @@
1
+ import { Rule } from "eslint";
2
+
3
+ //#region src/vue-block-attribute-order.d.ts
4
+ declare const _default: {
5
+ meta: {
6
+ type: "layout";
7
+ fixable: "code";
8
+ schema: {
9
+ type: "object";
10
+ additionalProperties: {
11
+ type: "array";
12
+ items: {
13
+ type: "string";
14
+ };
15
+ };
16
+ }[];
17
+ messages: {
18
+ wrongOrder: string;
19
+ };
20
+ };
21
+ create(context: Rule.RuleContext): {
22
+ Program?: undefined;
23
+ } | {
24
+ Program(): void;
25
+ };
26
+ };
27
+ //#endregion
28
+ export { _default as default };
@@ -1,9 +1,8 @@
1
- //#region src/block-attribute-order.ts
2
1
  const DEFAULT_ORDER = {
3
2
  script: ["lang", "setup"],
4
3
  style: ["lang", "scoped"]
5
4
  };
6
- const blockAttributeOrder = {
5
+ var vue_block_attribute_order_default = {
7
6
  meta: {
8
7
  type: "layout",
9
8
  fixable: "code",
@@ -57,10 +56,4 @@ const blockAttributeOrder = {
57
56
  } };
58
57
  }
59
58
  };
60
-
61
- //#endregion
62
- //#region src/index.ts
63
- var src_default = { blockAttributeOrder };
64
-
65
- //#endregion
66
- export { src_default as default };
59
+ export { vue_block_attribute_order_default as default };
package/package.json CHANGED
@@ -1,24 +1,28 @@
1
1
  {
2
2
  "name": "@byscripts/eslint-plugin",
3
- "version": "0.3.2",
3
+ "version": "0.5.0",
4
+ "repository": {
5
+ "url": "https://github.com/ByScripts/toolbox"
6
+ },
4
7
  "type": "module",
5
8
  "files": [
6
9
  "dist"
7
10
  ],
8
11
  "exports": {
9
- ".": {
10
- "types": "./dist/index.d.mts",
11
- "default": "./dist/index.mjs"
12
+ "./vue-block-attribute-order": {
13
+ "types": "./dist/vue-block-attribute-order.d.mts",
14
+ "default": "./dist/vue-block-attribute-order.mjs"
12
15
  }
13
16
  },
14
17
  "devDependencies": {
15
18
  "@tsconfig/node22": "^22.0.5",
16
- "tsdown": "^0.20.3"
19
+ "obuild": "^0.4.31"
17
20
  },
18
21
  "peerDependencies": {
19
- "eslint": "^9.22.0"
22
+ "eslint": "^9.22.0 || ^10.0.0"
20
23
  },
24
+ "license": "MIT",
21
25
  "scripts": {
22
- "build": "tsdown --dts"
26
+ "build": "obuild"
23
27
  }
24
28
  }
package/dist/index.d.mts DELETED
@@ -1,8 +0,0 @@
1
- import * as eslint from "eslint";
2
-
3
- //#region src/index.d.ts
4
- declare const _default: {
5
- blockAttributeOrder: eslint.Rule.RuleModule;
6
- };
7
- //#endregion
8
- export { _default as default };