@eslinted/core 14.0.0-rc.3 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,13 +11,10 @@ describe("Core", function () {
11
11
  });
12
12
  });
13
13
  describe("output", function () {
14
- it("is an array", function () {
14
+ it("is a non-empty array", function () {
15
15
  expect(configs)
16
- .an("array");
17
- });
18
- it("non-empty", function () {
19
- expect(configs)
20
- .has.lengthOf.above(1);
16
+ .an("array")
17
+ .not.empty;
21
18
  });
22
19
  it(`with length >= plugins + */ignores + */settings + ${scopes.length} scopes = ${scopes.length + 3} [Actual: ${configs.length}`, function () {
23
20
  expect(configs)
@@ -1 +1 @@
1
- {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,IAAI,MAAM,GAAG,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;AAEhC,QAAQ,CAAC,MAAM,EAAE;IACf,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,eAAe,EAAE;YAClB,MAAM,CAAC,IAAI,CAAC;iBACT,CAAC,CAAC,UAAU,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,QAAQ,EAAE;QACjB,EAAE,CAAC,aAAa,EAAE;YAChB,MAAM,CAAC,OAAO,CAAC;iBACZ,EAAE,CAAC,OAAO,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,WAAW,EAAE;YACd,MAAM,CAAC,OAAO,CAAC;iBACZ,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAG3B,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,qDAAqD,MAAM,CAAC,M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
1
- export type Plugins = ("@stylistic" | "@typescript-eslint" | "svelte" | "mocha" | "@html-eslint" | "jsonc" | "yml");
1
+ export type Plugins = ("@stylistic" | "@typescript-eslint" | "svelte" | "mocha" | "chai-friendly" | "@html-eslint" | "jsonc" | "yml");
2
2
  //# sourceMappingURL=plugins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/scopes/imports/plugins.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAClB,YAAY,GACZ,oBAAoB,GACpB,QAAQ,GACR,OAAO,GACP,cAAc,GACd,OAAO,GACP,KAAK,CACR,CAAC"}
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/scopes/imports/plugins.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAClB,YAAY,GACZ,oBAAoB,GACpB,QAAQ,GACR,OAAO,GACP,eAAe,GACf,cAAc,GACd,OAAO,GACP,KAAK,CACR,CAAC"}
@@ -5,33 +5,39 @@ describe("Scopes", function () {
5
5
  it("is a non-empty array", function () {
6
6
  expect(scopes)
7
7
  .an("array")
8
- .with.lengthOf.at.least(1);
8
+ .not.empty;
9
+ });
10
+ });
11
+ describe("members", function () {
12
+ it("are unique", function () {
13
+ expect(scopes.length)
14
+ .equals(new Set(scopes).size);
9
15
  });
10
16
  });
11
17
  describe("order", function () {
12
- it("jsonc > json", function () {
18
+ it("`jsonc` > `json`", function () {
13
19
  expect(scopes)
14
20
  .includes.members(["jsonc", "json"]);
15
21
  expect(scopes.indexOf("jsonc"))
16
22
  .greaterThan(scopes.indexOf("json"));
17
23
  });
18
- it("ts > js", function () {
19
- expect(scopes)
20
- .includes.members(["ts", "js"]);
21
- expect(scopes.indexOf("ts"))
22
- .greaterThan(scopes.indexOf("js"));
23
- });
24
- it("mocha > ts", function () {
24
+ it("`mocha` > `ts`", function () {
25
25
  expect(scopes)
26
26
  .includes.members(["mocha", "ts"]);
27
27
  expect(scopes.indexOf("mocha"))
28
28
  .greaterThan(scopes.indexOf("ts"));
29
29
  });
30
- it("svelte > ts", function () {
30
+ it("`svelte` > `ts`", function () {
31
31
  expect(scopes).includes.members(["svelte", "ts"]);
32
32
  expect(scopes.indexOf("svelte"))
33
33
  .greaterThan(scopes.indexOf("ts"));
34
34
  });
35
+ it("`ts` > `js`", function () {
36
+ expect(scopes)
37
+ .includes.members(["ts", "js"]);
38
+ expect(scopes.indexOf("ts"))
39
+ .greaterThan(scopes.indexOf("js"));
40
+ });
35
41
  });
36
42
  });
37
43
  //# sourceMappingURL=index.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../src/scopes/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAE3B,QAAQ,CAAC,QAAQ,EAAE;IACjB,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,sBAAsB,EAAE;YACzB,MAAM,CAAC,MAAM,CAAC;iBACX,EAAE,CAAC,OAAO,CAAC;iBACX,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,EAAE;QAChB,EAAE,CAAC,cAAc,EAAE;YACjB,MAAM,CAAC,MAAM,CAAC;iBACX,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;YACvC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;iBAC5B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,SAAS,EAAE;YACZ,MAAM,CAAC,MAAM,CAAC;iBACX,QAA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E,IAAI,CAAC,CAAC,CAAC;YAClC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBACzB,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tree.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.spec.d.ts","sourceRoot":"","sources":["../../src/scopes/tree.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import { expect } from "chai";
2
+ import { tree } from "./index.js";
3
+ const nodes = tree.map(([scope]) => scope);
4
+ describe("Scope Tree", function () {
5
+ describe("shape", function () {
6
+ it("is an array", function () {
7
+ expect(tree)
8
+ .an("array");
9
+ });
10
+ });
11
+ describe("members", function () {
12
+ it("are unique", function () {
13
+ expect(tree.length)
14
+ .equals(new Set(nodes).size);
15
+ });
16
+ it("omit `js`", function () {
17
+ expect(nodes)
18
+ .to.not.include.members(["js"]);
19
+ });
20
+ });
21
+ describe("order", function () {
22
+ it("`jsonc` < [`json`]?", function () {
23
+ expect(nodes)
24
+ .includes.members(["jsonc"]);
25
+ expect(nodes.indexOf("jsonc"))
26
+ .lessThan(-nodes.indexOf("json") * tree.length);
27
+ });
28
+ it("`mocha` < `ts`", function () {
29
+ expect(nodes)
30
+ .includes.members(["mocha", "ts"]);
31
+ expect(nodes.indexOf("mocha"))
32
+ .lessThan(nodes.indexOf("ts"));
33
+ });
34
+ it("`svelte` < `ts`", function () {
35
+ expect(nodes).includes.members(["svelte", "ts"]);
36
+ expect(nodes.indexOf("svelte"))
37
+ .lessThan(nodes.indexOf("ts"));
38
+ });
39
+ it("`ts` is last", function () {
40
+ expect(nodes)
41
+ .includes.members(["ts"]);
42
+ expect(nodes.indexOf("ts"))
43
+ .equals(tree.length - 1);
44
+ });
45
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C,MAAM,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,gBAAgB,EAAE;YACnB,MAAM,CAAC,KAAK,CAAC;iBACV,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;YACrC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;iBAC3B,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,iBAAiB,EAAE;YACpB,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YACjD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;iBAC5B,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,cAAc,EAAE;YACjB,MAAM,CAAC,KAAK,CAAC;iBACV,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAC5B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBACxB,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/test/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,IAAI,CAAC;AAO3B,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAkGvC,CAAC"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/test/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,IAAI,CAAC;AAO3B,eAAO,MAAM,SAAS,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAmGvC,CAAC"}
@@ -6,6 +6,7 @@ export const TestInput = {
6
6
  "@stylistic": Plugin,
7
7
  "@typescript-eslint": Plugin,
8
8
  mocha: Plugin,
9
+ "chai-friendly": Plugin,
9
10
  svelte: Plugin,
10
11
  jsonc: Plugin,
11
12
  yml: Plugin,
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/test/input.ts"],"names":[],"mappings":"AAEA,MACA,KAAK,GAAG,OAAO,EACf,GAAG,GAAG,KAAK,EACX,MAAM,GAAG,aAAa,CAAC;AAEvB,MAAM,CAAC,MAAM,SAAS,GAA+B;IACnD,OAAO,EAAE;QACP,OAAO,EAAE;YACP,cAAc,EAAE,MAAM;YACtB,YAAY,EAAE,MAAM;YACpB,oBAAoB,EAAE,MAAM;YAC5B,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;YACb,GAAG,EAAE,MAAM;SACH;QACV,OAAO,EAAE;YACP,EAAE,EAAE,YAAY;YAChB,MAAM,EAAE,gBAAgB;YACxB,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,eAAe;YACtB,GAAG,EAAE,aAAa;SACV;KACF;IACV,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE;QACR,QAAQ,EAAE;YACR,WAAW,EAAE,IAAI;YACjB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,IAAI;YACpB,6BAA6B,EAAE,OAAO;SACvC;QACD,KAAK,EAAE;YACL,EAAE,EAAE,CAAC,YAAY,CAAC;YAClB,EAAE,EAAE,CAAC,YAAY,CAAC;YAClB,MAAM,EAAE,CAAC,gBAAgB,CAAC;YAC1B,KAAK,EAAE,CAAC,eAAe,CAAC;YACxB,IAAI,EAAE,CAAC,cAAc,CAAC;YACtB,IAAI,EAAE,CAA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.0",
5
5
  "description": "Core ESLint flat config factory npm package `linted`.",
6
6
  "keywords": [],
7
7
  "repository": "github:jimmy-zhening-luo/linted-core",
package/src/index.spec.ts CHANGED
@@ -13,15 +13,10 @@ describe("Core", function () {
13
13
  });
14
14
  });
15
15
  describe("output", function () {
16
- it("is an array", function () {
16
+ it("is a non-empty array", function () {
17
17
  expect(configs)
18
- .an("array");
19
- });
20
- it("non-empty", function () {
21
- expect(configs)
22
- .has.lengthOf.above(1);
23
- // .not.empty;
24
- // replace with not.empty after new rule
18
+ .an("array")
19
+ .not.empty;
25
20
  });
26
21
  it(`with length >= plugins + */ignores + */settings + ${scopes.length} scopes = ${scopes.length + 3} [Actual: ${configs.length}`, function () {
27
22
  expect(configs)
@@ -3,6 +3,7 @@ export type Plugins = (
3
3
  | "@typescript-eslint"
4
4
  | "svelte"
5
5
  | "mocha"
6
+ | "chai-friendly"
6
7
  | "@html-eslint"
7
8
  | "jsonc"
8
9
  | "yml"
@@ -6,32 +6,38 @@ describe("Scopes", function () {
6
6
  it("is a non-empty array", function () {
7
7
  expect(scopes)
8
8
  .an("array")
9
- .with.lengthOf.at.least(1);
9
+ .not.empty;
10
+ });
11
+ });
12
+ describe("members", function () {
13
+ it("are unique", function () {
14
+ expect(scopes.length)
15
+ .equals(new Set(scopes).size);
10
16
  });
11
17
  });
12
18
  describe("order", function () {
13
- it("jsonc > json", function () {
19
+ it("`jsonc` > `json`", function () {
14
20
  expect(scopes)
15
21
  .includes.members(["jsonc", "json"]);
16
22
  expect(scopes.indexOf("jsonc"))
17
23
  .greaterThan(scopes.indexOf("json"));
18
24
  });
19
- it("ts > js", function () {
20
- expect(scopes)
21
- .includes.members(["ts", "js"]);
22
- expect(scopes.indexOf("ts"))
23
- .greaterThan(scopes.indexOf("js"));
24
- });
25
- it("mocha > ts", function () {
25
+ it("`mocha` > `ts`", function () {
26
26
  expect(scopes)
27
27
  .includes.members(["mocha", "ts"]);
28
28
  expect(scopes.indexOf("mocha"))
29
29
  .greaterThan(scopes.indexOf("ts"));
30
30
  });
31
- it("svelte > ts", function () {
31
+ it("`svelte` > `ts`", function () {
32
32
  expect(scopes).includes.members(["svelte", "ts"]);
33
33
  expect(scopes.indexOf("svelte"))
34
34
  .greaterThan(scopes.indexOf("ts"));
35
35
  });
36
+ it("`ts` > `js`", function () {
37
+ expect(scopes)
38
+ .includes.members(["ts", "js"]);
39
+ expect(scopes.indexOf("ts"))
40
+ .greaterThan(scopes.indexOf("js"));
41
+ });
36
42
  });
37
43
  });
@@ -0,0 +1,49 @@
1
+ import { expect } from "chai";
2
+ import { tree } from ".";
3
+
4
+ const nodes = tree.map(([scope]) => scope);
5
+
6
+ describe("Scope Tree", function () {
7
+ describe("shape", function () {
8
+ it("is an array", function () {
9
+ expect(tree)
10
+ .an("array");
11
+ });
12
+ });
13
+ describe("members", function () {
14
+ it("are unique", function () {
15
+ expect(tree.length)
16
+ .equals(new Set(nodes).size);
17
+ });
18
+ it("omit `js`", function () {
19
+ expect(nodes)
20
+ .to.not.include.members(["js"]);
21
+ });
22
+ });
23
+ describe("order", function () {
24
+ it("`jsonc` < [`json`]?", function () {
25
+ expect(nodes)
26
+ .includes.members(["jsonc"]);
27
+ expect(nodes.indexOf("jsonc"))
28
+ // @ts-expect-error: TEST: `json` is not in the tree
29
+ .lessThan(-nodes.indexOf("json") * tree.length);
30
+ });
31
+ it("`mocha` < `ts`", function () {
32
+ expect(nodes)
33
+ .includes.members(["mocha", "ts"]);
34
+ expect(nodes.indexOf("mocha"))
35
+ .lessThan(nodes.indexOf("ts"));
36
+ });
37
+ it("`svelte` < `ts`", function () {
38
+ expect(nodes).includes.members(["svelte", "ts"]);
39
+ expect(nodes.indexOf("svelte"))
40
+ .lessThan(nodes.indexOf("ts"));
41
+ });
42
+ it("`ts` is last", function () {
43
+ expect(nodes)
44
+ .includes.members(["ts"]);
45
+ expect(nodes.indexOf("ts"))
46
+ .equals(tree.length - 1);
47
+ });
48
+ });
49
+ });
package/src/test/input.ts CHANGED
@@ -12,6 +12,7 @@ export const TestInput: Parameters<typeof Core>[0] = {
12
12
  "@stylistic": Plugin,
13
13
  "@typescript-eslint": Plugin,
14
14
  mocha: Plugin,
15
+ "chai-friendly": Plugin,
15
16
  svelte: Plugin,
16
17
  jsonc: Plugin,
17
18
  yml: Plugin,