linted 35.2.5 → 35.4.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.
@@ -0,0 +1,6 @@
1
+ export declare function directory(path: string, subpath?: string): string;
2
+ export declare function not(path: string, subpath?: string): string;
3
+ export declare function flat(path: string, subpath?: string): string;
4
+ export declare function recurse(path: string, subpath?: string): string;
5
+ export declare function file(extension: string, name?: string): string;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,UAajB;AAED,wBAAgB,GAAG,CACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,UAGjB;AAED,wBAAgB,IAAI,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,UAMjB;AAED,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,UAGjB;AAED,wBAAgB,IAAI,CAClB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,MAAkB,UAOzB"}
@@ -0,0 +1,28 @@
1
+ export function directory(path, subpath) {
2
+ return subpath === undefined
3
+ ? path
4
+ : path + (path.endsWith("/")
5
+ ? subpath.startsWith("/")
6
+ ? subpath.slice(1)
7
+ : subpath
8
+ : subpath.startsWith("/")
9
+ ? subpath
10
+ : "/" + subpath);
11
+ }
12
+ export function not(path, subpath) {
13
+ return "!" + directory(path, subpath);
14
+ }
15
+ export function flat(path, subpath) {
16
+ return directory(directory(path, subpath), "*");
17
+ }
18
+ export function recurse(path, subpath) {
19
+ return flat(path, subpath) + "*";
20
+ }
21
+ export function file(extension, name = "*") {
22
+ return "**"
23
+ + "/"
24
+ + name
25
+ + "."
26
+ + extension;
27
+ }
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tool/index.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CACvB,IAAY,EACZ,OAAgB;IAEhB,OAAO,OAAO,KAAK,SAAS;QAC1B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAI,GAAG,CACP,IAAI,CAAC,QAAQ,KAAgB;YAC3B,CAAC,CAAC,OAAO,CAAC,UAAU,KAAgB;gBAClC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;gBAClB,CAAC,CAAC,OAAO;YACX,CAAC,CAAC,OAAO,CAAC,UAAU,KAAgB;gBAClC,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,MAAiB,OAAO,CAC/B,CAAC;AACN,CAAC;AAED,MAAM,UAAU,GAAG,CACjB,IAAY,EACZ,OAAgB;IAEhB,OAAO,MAAW,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,IAAI,CAClB,IAAY,EACZ,OAAgB;IAEhB,OAAO,SAAS,CACd,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,MAEzB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,IAAY,EACZ,OAAgB;IAEhB,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,MAAY,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,IAAI,CAClB,SAAiB,EACjB,UAAwB;IAExB,OAAO;aACW;UACd,IAAI;UACJ,GAAG;UACH,SAAS,CAAC;AAChB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const enum Path {
2
+ Not = "!",
3
+ Directory = "/",
4
+ Flat = "*",
5
+ Recurse = "**"
6
+ }
7
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/tool/path.ts"],"names":[],"mappings":"AAAA,0BAAkB,IAAI;IACpB,GAAG,MAAM;IACT,SAAS,MAAM;IACf,IAAI,MAAM;IACV,OAAO,OAAc;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/tool/path.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "$schema": "https://json.schemastore.org/package",
4
4
  "$help": "https://docs.npmjs.com/cli/configuring-npm/package-json",
5
5
  "name": "linted",
6
- "version": "35.2.5",
6
+ "version": "35.4.0",
7
7
  "repository": "github:jimmy-zhening-luo/linted",
8
8
  "description": "ESLint mono-plugin bundler with strict, opinionated defaults for (Stylistic) JavaScript, TypeScript, Svelte, HTML, Tailwind/CSS, JSON, JSONC, YAML, and Mocha.",
9
9
  "keywords": [
@@ -35,6 +35,16 @@
35
35
  "type": "module",
36
36
  "main": "dist/index.js",
37
37
  "types": "dist/index.d.ts",
38
+ "exports": {
39
+ ".": {
40
+ "types": "./dist/index.d.ts",
41
+ "default": "./dist/index.js"
42
+ },
43
+ "./tool": {
44
+ "types": "./dist/tool/index.d.ts",
45
+ "default": "./dist/tool/index.js"
46
+ }
47
+ },
38
48
  "peerDependencies": {
39
49
  "eslint": "~9.39.1",
40
50
  "eslint-plugin-svelte": "~3.13.1",
@@ -0,0 +1,53 @@
1
+ import { Path } from "./path";
2
+
3
+ export function directory(
4
+ path: string,
5
+ subpath?: string,
6
+ ) {
7
+ return subpath === undefined
8
+ ? path
9
+ : path + (
10
+ path.endsWith(Path.Directory)
11
+ ? subpath.startsWith(Path.Directory)
12
+ ? subpath.slice(1)
13
+ : subpath
14
+ : subpath.startsWith(Path.Directory)
15
+ ? subpath
16
+ : Path.Directory + subpath
17
+ );
18
+ }
19
+
20
+ export function not(
21
+ path: string,
22
+ subpath?: string,
23
+ ) {
24
+ return Path.Not + directory(path, subpath);
25
+ }
26
+
27
+ export function flat(
28
+ path: string,
29
+ subpath?: string,
30
+ ) {
31
+ return directory(
32
+ directory(path, subpath),
33
+ Path.Flat,
34
+ );
35
+ }
36
+
37
+ export function recurse(
38
+ path: string,
39
+ subpath?: string,
40
+ ) {
41
+ return flat(path, subpath) + Path.Flat;
42
+ }
43
+
44
+ export function file(
45
+ extension: string,
46
+ name: string = Path.Flat,
47
+ ) {
48
+ return Path.Recurse
49
+ + Path.Directory
50
+ + name
51
+ + "."
52
+ + extension;
53
+ }
@@ -0,0 +1,6 @@
1
+ export const enum Path {
2
+ Not = "!",
3
+ Directory = "/",
4
+ Flat = "*",
5
+ Recurse = Flat + Flat,
6
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [
3
+ "index.ts",
4
+ "path.ts",
5
+ ],
6
+ "extends": "../tsconfig-src",
7
+ }
package/src/tsconfig.json CHANGED
@@ -13,5 +13,8 @@
13
13
  {
14
14
  "path": "settings",
15
15
  },
16
+ {
17
+ "path": "tool",
18
+ },
16
19
  ],
17
20
  }